Upcoming Changes to api.steemit.com

avatar

API changes.jpg

In as soon as 7 days (2018-12-07 23:00:00 UTC), the api.steemit.com endpoint will begin to route select steemd methods directly to hivemind. If you rely on this endpoint for any of the methods below, you should begin testing your applications against api.steemitdev.com as soon as possible.

This is in preparation for the removal of tags and follows plugins from our full nodes, the functionality of which has been ported to the hivemind service. While hivemind attempts to mimic the existing request/response format as well as all of the underlying logic, there are notable exceptions which will be outlined in this post.

As we disclosed in our last post, Steemit Inc.’s top priority is dramatically lowering the cost of running a Steem node. By routing these API calls to Hivemind, we greatly decrease the amount of resources our full nodes use.

Background

Hive's condenser_api implementation goal is to port a relevant subset of steemd's tags and follows functionalities to support instances of condenser with minimal changes required. This allows node operators to lower steemd resource requirements while laying the infrastructure for next-generation social APIs.

While we have attempted to ensure relevant data is still available, in some cases this is simply impossible. A prime example of this is the get_state call, whose response is a monolith which attempts to account for an extremely wide variety of data. Portions of the returned data is irrelevant to most apps, and some of it is entirely out of hive's scope (example: witness schedule). As another example, when loading a discussion thread, all involved accounts objects are returned in full (including balances, authorities, statistics). This results in a lot of extra bandwidth used when only a small fraction of the information is relevant.

In some cases, portions of API responses unused by condenser have simply not been implemented in hive -- either to save time or complexity. In other cases, expected values may be slightly different but of a compatible format. Hive cannot guarantee data is accurate as of the latest block. Because interfaces often rely on supporting information such as steem_per_vests or feed_price, hive does store and return some marginally-out-of-scope-yet-accessible data, but it will be cached with a TTL of up to several minutes. Those values can still be obtained through other API calls to steemd.


API Changes - Overview

We will migrate the API by overriding specific steemd methods passed to api.steemit.com.

These methods will now be served by hivemind:

Follows Queries

    get_followers                 [following, start_follower, follow_type, limit]
    get_following                 [follower, start_following, follow_type, limit]
    get_follow_count              [account]

Content Monolith

    get_state                     [path]

Trending Tags

    get_trending_tags             [start_tag, limit]         (!) only supports ('', 250)

Discussion Queries

    get_discussions_by_trending   {tag, limit, start_author, start_permlink}    trending
    get_discussions_by_hot        {tag, limit, start_author, start_permlink}    hot
    get_discussions_by_promoted   {tag, limit, start_author, start_permlink}    promoted
    get_discussions_by_created    {tag, limit, start_author, start_permlink}    created

    get_discussions_by_blog       {tag, limit, start_author, start_permlink}    account-blog
    get_discussions_by_feed       {tag, limit, start_author, start_permlink}    account-feed
    get_discussions_by_comments        {limit, start_author, start_permlink}    account-comments
    get_replies_by_last_update    [author, permlink, limit];                    account-replies

Exceptions

These calls will NOT be forwarded to hivemind, and will be forwarded to a light steemd node:

get_state.params=['@<user>/transfers']
get_state.params=['~witnesses']

Not ported

Deprecated/Unused Discussion Queries - NOT ported!

    get_post_discussions_by_payout        {tag, limit, start_author, start_permlink}    payout
    get_comment_discussions_by_payout     {tag, limit, start_author, start_permlink}    payout_comments
    get_discussions_by_cashout            {tag, limit, start_author, start_permlink}    UNUSED/cashout
    get_discussions_by_children           {tag, limit, start_author, start_permlink}    UNUSED/responses
    get_discussions_by_votes              {tag, limit, start_author, start_permlink}    UNUSED/votes
    get_discussions_by_active             {tag, limit, start_author, start_permlink}    DEPRECATED
    get_discussions_by_trending30         {tag, limit, start_author, start_permlink}    DEPRECATED (DNE)
    get_discussions_by_payout             {tag, limit, start_author, start_permlink}    UNUSED (DNE)
    get_discussions_by_author_before_date [author, start_permlink, before_date, limit]  UNUSED



Additionally, the following have not been ported, which means they may become unavailable.

    get_feed_entries()
    get_feed()
    get_blog_entries()
    get_blog()

    get_account_reputations()
    get_reblogged_by()
    get_blog_authors()
    get_tags_used_by_author()



These may be available for some time, but will be served by a light node. We cannot guarantee their availability.

Many of these calls are very similar (or identical) to one of the supported methods. If this is not the case, please leave a comment and we'll evaluate the options.

Not ported, still available through steemd's condenser_api

As these are still part of consensus and consumers often expect them to be 100% accurate and up-to-date, they are not currently served by hivemind and will continue to be available through steemd.

Content Primitives

    get_content                   [author, permlink]
    get_content_replies           [parent_author, parent_permlink]

    get_active_votes              [author, permlink]
    get_account_votes             [account]

Steemd configuration changes

After a period of testing, the follow and tags plugins will be removed from our API nodes. We will however add the reputation plugin, which allows us to continue using the existing reputation metrict. It used to be a subset of follow plugin functionality, and it's the only piece logic which is not easily reproducible outside of steemd. If you were relying on reputation methods provided by follow_api, you will need to update your code to use reputation_api.


API Changes - Detail

Legacy call method

call         ['condenser_api', method, params]

The legacy-style call method takes [api, method, [params]] as parameters. Hive routes these calls to the appropriate internal method.

Concerns
  • api must be set to condenser_api
  • It is not recommended to use this method

Follows Queries

condenser_api.get_followers
condenser_api.get_following
condenser_api.get_follow_count

These are straightforward, simple replacements.

Concerns
  • steemd follows plugin can hold multiple follow 'states'; hive enforces one
    • the feature is undocumented but small chance of edge cases
    • internally, hive follow state must be blank, followed or muted

Content Primitives

condenser_api.get_content
condenser_api.get_content_replies


Important: while hive offers these methods as part of its condenser_api, api.steemit.com will continue to serve these directly from steemd. However, hive does leverage it internally to build responses for get_state as well as the various get_discussions_* methods.

Concerns
  • hive's comment response format is a subset of steemd's.
  • deprecated/useless fields have been removed or normalized
  • some fields of questionable utility are not unimplemented

Content Monolith

condenser_api.get_state

Notice! Hive will refuse to serve these routes:

  • /@account/transfers
  • /witnesses and /~witnesses

Hive does serve these routes, requested by condenser, which are not mapped to anything, but steemd handles them anyway:

  • /@account/followed - dummy
  • /@account/followers - dummy
  • /@account/permissions - dummy
  • /@account/password - dummy
  • /@account/settings - dummy
Concerns
  • embedded get_dynamic_global_properties data is truncated
  • hive does not keep up-to-date keys for accounts.. but on /@account/xxx pages, it still serves minimal account data.

Trending Tags

condenser_api.get_trending_tags
Concerns
  • the parameters [start_tag, limit] must be left blank or passed as ['', 250]
  • only primary tags ("category") counted in these stats (not all tags, as per current implementation)

Discussion Queries

Global

condenser_api.get_discussions_by_trending
condenser_api.get_discussions_by_hot
condenser_api.get_discussions_by_promoted
condenser_api.get_discussions_by_created

Account/blog-specific

condenser_api.get_discussions_by_blog
condenser_api.get_discussions_by_feed
condenser_api.get_discussions_by_comments
condenser_api.get_replies_by_last_update
Concerns
  • all get_content concerns apply here; otherwise identical

Testing & Feedback

If your app or service relies on any of the above calls and uses api.steemit.com, please begin testing against api.steemitdev.com as soon as possible. If there is an unsupported API call on which you are critically relying on, let us know in the comments and we'll find a solution.

Note that at this time, no steemd APIs are changing -- only the API as provided by api.steemit.com.

If any apps are still relying on get_state, we highly recommend ceasing use as soon as possible.

The Steemit Team



0
0
0.000
73 comments
avatar

As long as everything is well documented, I'm sure there won't be any significant issues.

0
0
0.000
avatar

please, the only thing I request is to take a break from adding and changing functionalities and spend some weeks on building easier and better documentation and tutorials!
Really the API is amazing, but the documentation is not beginner friendly at all! I am working on a tutorial series trying to make things simple for non programmers to understand because I want people to be bottlenecked by their creativity only, not their technical knowledge, but I alone can't do it, please, take your time to make a tutorial series, does not matter if you "steal" my students and my earnings from the tutorials but put more effort on making tutorials and noob friendly documentation, this is a must for scalability! people just can't understand easily how to use your API to the fullest, you can add and modify as many functionalities as you want, but if steem dapps development stays intellectually elitist we won't have mass adoption because some people might have great ideas for simple apps but they can't execute it without breaking their backs trying to understand how does it work!

Posted using Partiko Android

0
0
0.000
avatar

spend some weeks on building easier and better documentation and tutorials!

@igormuba, nope that's up to the community now.

0
0
0.000
avatar
(Edited)

I don't deny the community should also do something, as part of my witness campaign I am trying the best I can to make beginner friendly tutorials and translate them to 2 languages, but I am just only person and I feel overwhelmed by some many things and tasks left to do, sadly I can't find other people that care about bringing Steem API development to the masses...

Posted using Partiko Android

0
0
0.000
avatar

Reducing the resource cost of full nodes is great news, thanks for this. standby for some additional votes incoming for further visibility.

0
0
0.000
avatar

Exactly what I want to see. Great progress! Testing asap.

0
0
0.000
avatar

To listen to the audio version of this article click on the play image.

Brought to you by @tts. If you find it useful please consider upvoting this reply.

0
0
0.000
avatar

Hive has been one of the things I've been most ready to see get up and really rolling. I'm going to be very interested in seeing the spread of findings and needs of the dApps out there as they start testing.

0
0
0.000
avatar

do you think 1 week is gonna be enough for them?

0
0
0.000
avatar

Hive has been running for many months now. We're just moving more data over to it. We can always switch from Hive back to steemd very quickly and I believe this is actually part of the testing plans. More details coming, but this is a very low risk change due to it being so easily reversible and having nothing to do with the blockchain.

0
0
0.000
avatar

Andy beat me to the punch. I do hope so. We've seen hive making things faster and smoother in some cases for a while now already, but tags and follows especially is a biggie, hurdle wise. One week should be enough to suss out if things aren't forwarding properly, I imagine... It just means that people actually have to point their services at it sometime in the next week and see if it all goes tits up. Won't know if people don't try.

0
0
0.000
avatar

Are there any public nodes available anymore, there used to be all these but they are all offline to me? http://steemistry.com/nodes/

0
0
0.000
avatar

This is our old page and it's wildly out of date/broken since a few changes ago, with me not having had a chance to get back to it! I recommend checking https://geo.steem.pl. This is a good kick in the ass reminder to fix it.

0
0
0.000
avatar
(Edited)

Are there any wss connections, I built an old script based on piston?

0
0
0.000
avatar

Hey, websockets have been deprecated. I'm not actually sure off the top of my head which, if any, public endpoints are supporting them. If you do want to keep rolling with them that's cool, but you should probably look at spinning up your own node for it in that case.

0
0
0.000
avatar

Ok we shall have @asgarth take a look for @steempeak functionality. Didn't realize it would be 2 days after the announcements and 7 days notice. But it is what it is we will make it

0
0
0.000
avatar

Oh I should update... we're ready to go thanks @roadscape for the help along the way. Hopefully asgarth helped test the system nicely.

0
0
0.000
avatar

So if I use steemit.js with a call like steem.api.getState how do I go about converting/updating.
This couldn't have come at a worse time for me as I'm moving house. Will probably have to put @steeming-hot out of action for a while

0
0
0.000
avatar

You should first see if your app works with getState on api.steemitdev.com. If it does, you're good. If not, this is how to switch if you were using dsteem:

https://developers.steem.io/tutorials-javascript/get_state_replacement_api

But the general point is, if you use their getState(‘witnesses’), use databaseAPI.call('get_witnesses_by_vote', ['', 10]) instead.

0
0
0.000
avatar

Hey thanks @inertia I don't think I will have to modify the code as i use steem.api.getState('@username/blog', function(err, result)

Guess I will find out next weekend :)

0
0
0.000
avatar

All you do is change the endpoint from api.steemit.com to api.stemitdev.com and make sure your scripts still work :-)

0
0
0.000
avatar

So I'm guessing as long as I pull the steem.js file from the steemit cdn it should update accordingly

0
0
0.000
avatar

There are API changes coming soon. Data served will be slightly different. You can be proactive and test the new results now by using api.stemitdev.com or just wait until api.steemit.com switches over and see if anything breaks.

0
0
0.000
avatar

Hi guys.
If I want to get the list of @user's posts, how can I do it instead of get_blog?

Posted using Steeve, an AI-powered Steem interface

0
0
0.000
avatar
(Edited)

.

0
0
0.000
avatar

Thank you!

0
0
0.000
avatar

Were you able to leverage this call successfully?

0
0
0.000
avatar

Didnt have time to test it yet, maybe today - will let you know!

0
0
0.000
avatar

Yep, working good:) Find me on discord: https://discord.gg/9gmwuU if you need help.

0
0
0.000
avatar

Is this able to fetch all posts now? (as opposed to it being truncated before?)

0
0
0.000
avatar

Hm, you still need to provide limit (how many recent posts).

0
0
0.000
avatar

Oh I mean if you keep querying farther and farther back in time, you eventually fetch all posts? Hmm I should try it.

0
0
0.000
avatar

@steemitdev,
Sounds good and wanna see how it works soon! One more thing, cost deduction is a good idea, but try to manage it while keeping Steem future at the bright side!

Cheers~

0
0
0.000
avatar

How can I keep using the discussion queries in Steem.JS like steem.api.getDiscussionsByBlog() or steem.api.getDiscussionsByTrending()?

When I try these functions on api.steemitdev.com I get this error: RPCError: Server error.

0
0
0.000
avatar

Hi @penguinpablo, could you share the exact request? Working to get better error details exposed from the server but the most common cause is omitting some arguments.

0
0
0.000
avatar
(Edited)

Hi @roadscape! Thanks for your response.
Here's the Javascript code:

steem.api.setOptions({url:'https://api.steemitdev.com'});
steem.api.getDiscussionsByBlog({tag:'penguinpablo',limit:1}, function(err, result) {
 console.log(err);
});

Results in:

RPCError: Server error

It works using api.steemit.com, but not on api.steemitdev.com.

0
0
0.000
avatar

What if you specify "useAppbaseApi": true in the config?

0
0
0.000
avatar

I tried

steem.api.setOptions({url:'https://api.steemitdev.com', useAppbaseApi:true});

...But unfortunately the same error.

0
0
0.000
avatar

Ok I believe this is due to (1) using the legacy call format, combined with (2) not specifying start_author and start_permlink. If you include both of those keys and set them to blank, it should work. Please confirm that this solves the problem and we'll loosen the call format restriction.

0
0
0.000
avatar

That nailed it, thank you!
And we don't even need to set the useAppbaseApi: true option

0
0
0.000
avatar

👍I've gone ahead and made those two parameters optional again since a lot of calls seem to be omitting them. Also the API will be returning more helpful error messages now.

0
0
0.000
avatar

hey @roadscape,
facing same issue as reported by @penguinpablo, my function call is about discussions by created though.
I tried both steemjs (steem.api.getDiscussionsByCreated(query, async function (err, result)) and dsteem (client.database.getDiscussions('created', query)), both returning server errors when tested on https://api.steemitdev.com, while they work properly on https://api.steemit.com
useAppbaseApi did not solve it either for steemjs
Thoughts?

0
0
0.000
avatar

See reply above and let me know if it helps.

0
0
0.000
avatar
(Edited)

It's a steem-js issue, possibly pulling older version.

0
0
0.000
avatar

I'm using 'get_discussions_by_author_before_date' in my tools because it returns the account's posts without the resteems and I can load up to 100 posts with only one call. Is there any way to achieve this with 'get_discussions_by_blog'?

I've seen that there was a resteems-filter in earlier versions (params.hide == "resteemed", later by setting a discussion_query_filter with params.filter_by), but it seems not to be possible anymore in newer versions.

I think that's an important thing to think about because it will otherwise create much overhead for loading 100 posts and I guess many apps would use that instead of filtering the received posts on the client-side.

0
0
0.000
avatar

Hi @steemchiller, adding support for this call as it's become clear there is no replacement for it. As far as I can tell, the before_date parameter is broken, is that true? Do you paginate at all via start_permlink?

0
0
0.000
avatar

Thanks @roadscape, great to hear! Yes, if I remember correctly, both the before_date and start_permlink parameters did never really work. I don't need them currently but would be nice to get the start_permlink param to work in future.

0
0
0.000
avatar

Ok, I've implemented get_discussions_by_author_before_date in hivemind; and while it ignores before_date (which does seem to be completely broken in steemd anyway), it will correctly obey start_permlink. This call is very similar to get_discussions_by_blog except it ignores reblogs. And as broken as it is, it turns out it's quite popular. Can't wait for a shiny/clean new set of APIs 😝

0
0
0.000
avatar
(Edited)

Perfect! Yes, a clean new set of APIs would be much appreciated. One thing I noticed is that the returned items now contain a post_id, without hivemind it was just id. That's no problem for me, but maybe it would be better to use the old identifier. Just in case someone is using it already...


Update:

  1. The field last_update seems to be missing in the posts result. When using get_state( [tag] / @[author] / [permlink] ) the field is there in the result.content[] items but it is always returned as empty string.

  2. The field curator_payout_value is always returned as '0.000 SBD'. Without hivemind it contains the correct amount as soon as a post has been paid out.

  3. The method get_follow_count returns incorrect numbers in follower_count and following_count for my account.

0
0
0.000
avatar

Hast du Lust, dich mit mir zu unterhalten? Ich bin @afrog.

0
0
0.000
avatar

Moin @afrog, ich bin gerade sehr beschäftigt und mein Weekly-Post ist auch schon wieder längst überfällig, aber ich werde mich in den kommenden Tagen nochmal bei dir melden. Deinen SteemWiki-Post werde ich natürlich gleich mal resteemen ;)

0
0
0.000
avatar
(Edited)

Moin @steemchiller. Du bist sogar beschäftigt, wenn sie dich in Gips einschlagen, Danke für die Meldung. Auf Dich habe ich gehofft. Danke für den Resteem. Das brauchen Neue auf dem Steem ganz besonders.

0
0
0.000
avatar

Thanks for the update, could you please file the first two issues at https://github.com/steemit/hivemind? The third one is already at https://github.com/steemit/hivemind/issues/157.

0
0
0.000
avatar

Hi, Roadscape. Sorry for posting an off-topic comment, but I couldn't reach you elsewhere. I saw you are supporting algorithmic curation via delegation to Steem-UA.

Have you heard about Steeve, an AI-powered Steem interface? We are combining algorithmic curation with manual curation by human readers. Steeve offers real users recommendations of potentially interesting posts outside their normal feed, which they then manually check and upvote if they like them.

The most popular posts are then rewarded with our @steevebot. This incentivizes

  1. creation of good content
  2. better curation

And of course this way we can cover much much more posts than when people upvote only what they find on their feed. You can read more about it here. I would be interested in hearing your thoughts on this approach.

Posted using Steeve, an AI-powered Steem interface

0
0
0.000
avatar

Dear Roadscape, this is how major stakeholders treat nowadays active developers who are working on improving the situation on Steem?

Posted using Steeve, an AI-powered Steem interface

0
0
0.000
avatar

I left the smallest possible downvote to collapse a completely off-topic comment in a discussion thread which I am monitoring for critical technical issues

0
0
0.000
avatar

I get it and I don't mind the small downvote, I just expected you would suggest a different communication channel, as it's hard for us to reach you.

I know you are very busy, but I genuinely thought you would be interested in our project, as it tries to tackle an important problem and aims to improve Steem as a whole.

Posted using Steeve, an AI-powered Steem interface

0
0
0.000
avatar

Just dropping in on the most recent transaction I could find of yours @steemchiller, to show my support.

In your next update, would really like to hear what you think about all that is happening with Steemit Inc, the proposal from BlockTrades (is this Dan's company?), etc.

I'm pretty new "in here," but for the first time, I have some real concerns. And I don't know the history like I suspect you do. I certainly don't have your technical background, but highly value your opinion.

Appreciate all you do! 👍


P.S. Hope I'm not breaking any protocols by replying here in the middle of another exchange ...

0
0
0.000
avatar

Wow finally deciding to Optimize, that means you guys weren't doing it along the way...

That's why Agile programming practices suck!

You did not have a Chief Architect and Lead Designers and the classic top down hierarchy. These issues would have been caught early QA and you wouldn't be in the desperate situation your in now @ned.

Hopefully you've learned your lesson and get someone in there who has built a firm from the 15 to 200 employee stage and then bring in someone else to move the firm to the next level.

A Leader who sees the both the good and more importantly the pitfalls from experience and inspires people to come up with solutions and think when it is right to go tried and true and when outside the box is needed.

Not a Boss who just tells people what has to go on.

You need to learn something from the AMC show run of "Halt or Catch Fire.".

0
0
0.000
avatar

Hi, I use steem.api.getRebloggedBy in my bot, whats an alternative to this as it no longer works. Thanks :)

0
0
0.000
avatar

get_reblogged_by is no longer supported?
Is there a replacement or should I read 30,000,000 blocks to find out who is resteeming my articles?

I also use
get_discussions_by_author_before_date
get_feed
get_content
get_active_votes
get_account_votes

0
0
0.000
avatar

hello
when i using "get_discussions_by_blog" with "filter_tags" or "select_tags ", i come across with this error "filter_tags not supported (hivemind-alpha)"
Can I not use this combination?
this is my code: http://dpaste.com/13ZHMKC
thank you

avatar
(Edited)

Hello, I'm using Steem.js personally and I'm trying to to filter trending query with multiple tags but can't find a way to do this from official docs. Is this still possible?

Select_tags : [tag1, tag2] doesn't work anymore with hivemind it seems.

0
0
0.000