Thanks for posting this. I'm brand new to steemit and just started exploring the API, but I'm having a lot of trouble with the lack of documentation. Do you have any good resources you could share?
Even the examples in the documentation are limited. For example:
steem.api.getDiscussionsByTrending(query, function(err, result) {
console.log(err, result);
});
There are tons of examples like this, but I can'd find any documentation on how to properly build the query object. I'm looking to fill in some of these blanks, so any resources you can suggest would be much appreciated!
I'm having the same trouble. I got some of the queries working:
https://github.com/AdamCox9/Steemit-NodeJS-Bot-Tutorial/blob/master/start.js
https://github.com/AdamCox9/Steemit-Follow-Bot/blob/master/follow_trending_authors.js
I hope these samples help. The code in GitHub is a newer version than in the articles.
I finally got somewhere with the the help of this:
https://github.com/steemit/steem-js/issues/256
steem.api.setOptions({ url: 'https://api.steemit.com' }); var query = { tag: 'blockchain', limit: 10 }; steem.api.getDiscussionsByTrending(query, function (err, discussions) { console.log(err, discussions); });```
Thanks! I will try this out!
It works like a charm for me. I think it really opens up the world for some automation even on a read-only basis.
Heres some good code snippets you might find interesting: https://github.com/drov0/steemsnippets
The fact that it's documented is music to my eyes :) Looking forward to sharing some of my scripts soon!
Here are some really good examples to upvote, downvote, comment and transfer: https://steemit.com/steemjs/@fabien/steem-js-comment-upvote-downvote-transfert-you-wanted-it-you-got-it
Thanks, I'm going to play around more and I'll post my findings.