This article desribes the API of the STEEM full node (**not** of the wallet API). ## Prerequisits This article assumes that you have a full node running and listening to port ``8092``, locally. You can achieve this by ``` ./programs/steemd/steemd --rpc-endpoint=127.0.0.1:8092 ``` We open up the RPC endpoint so that we can interface with the node using RPC-JSON calls. ## Call Format In Graphene, RPC calls are state-less and accessible via regular JSON formated RPC-HTTP-calls. The correct structure of the JSON call is ```json { "jsonrpc": "2.0", "id": 1 "method": "get_account", "params": [["xeroc", "steemit"]], } ``` The `get_accounts` call is available in the full node's API and takes only one argument which is an array of account ids (here: `["xeroc", "steemit"]`). ### Example Call with `curl` Such as call can be submitted via ``curl``: ```sh curl --data '{"jsonrpc": "2.0", "method": "get_accounts", "params": [["xeroc","steemit"]], "id": 1}' http://127.0.0.1:8090/rpc ``` ## Successful Calls The API will return a properly JSON formated response carrying the same ``id`` as the request to distinguish subsequent calls. ```json { "id":1, "result": "data" } ``` ## Errors In case of an error, the resulting answer will carry an ``error`` attribute and a detailed description: ```json { "id": 0 "error": { "data": { "code": error-code, "name": " .. name of exception .." "message": " .. message of exception ..", "stack": [ .. stack trace .. ], }, "code": 1, }, } ``` ## Available Calls Even though, the `help` call does not exist, it gives us an error message that contains all available API calls in the stack trace: ``` curl --data '{"jsonrpc": "2.0", "method": "help", "params": [], "id": 1}' http://127.0.0.1:8090/rpc ``` ```json { "id": 1, "error": { "message": <...>, "data": { "message": "Assert Exception", "name": "assert_exception", "stack": [ { "data": { "name": "help", "api": { "set_subscribe_callback": 0, "get_dynamic_global_properties": 12, "get_accounts": 17, "get_active_categories": 9, "get_account_references": 18, "get_trending_categories": 7, "get_content": 36, "get_state": 6, "get_discussions_by_total_pending_payout": 38, "cancel_all_subscriptions": 3, "get_block_header": 4, "get_active_votes": 35, "get_current_median_history_price": 15, "lookup_witness_accounts": 26, "verify_account_authority": 34, "get_key_references": 16, "set_pending_transaction_callback": 1, "get_required_signatures": 31, "get_recent_categories": 10, "get_order_book": 28, "lookup_accounts": 20, "get_account_history": 23, "get_chain_properties": 13, "get_feed_history": 14, "verify_authority": 33, "get_discussions_by_last_update": 40, "get_conversion_requests": 22, "get_discussions_in_category_by_last_update": 41, "get_block": 5, "get_witness_count": 27, "get_best_categories": 8, "get_potential_signatures": 32, "lookup_account_names": 19, "get_transaction": 30, "get_witnesses": 24, "get_witness_by_account": 25, "get_account_count": 21, "get_transaction_hex": 29, "get_content_replies": 37, "get_discussions_in_category_by_total_pending_payout": 39, "get_miner_queue": 43, "get_active_witnesses": 42, "set_block_applied_callback": 2, "get_config": 11 } }, "context": { "line": 109, "hostname": "", "timestamp": "2016-04-13T16:15:17", "method": "call", "thread_name": "th_a", "level": "error", "file": "api_connection.hpp" }, "format": "itr != _by_name.end(): no method with name '${name}'" } ], "code": 10 }, "code": 1 } } ``` Further documentation about the calls can be found in the sources in [libraries/app/include/steemit/app/database_api.hpp](https://github.com/steemit/steem/blob/master/libraries/app/include/steemit/app/database_api.hpp).
author | xeroc |
---|---|
permlink | steem-api |
category | undefined |
json_metadata | {} |
created | 2016-04-13 16:25:15 |
last_update | 2016-04-13 16:25:15 |
depth | 0 |
children | 7 |
last_payout | 2016-08-24 05:37:24 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 2.165 HBD |
curator_payout_value | 0.493 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 4,602 |
author_reputation | 118,819,064,085,695 |
root_title | "Steem API" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 130 |
net_rshares | 9,119,547,146,105 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
dantheman | 0 | -379,669,000,000 | -1% | ||
barrie | 0 | 0 | 100% | ||
steempty | 0 | 6,938,179,567,974 | 100% | ||
anonymous | 0 | 1,284,865,000,000 | 100% | ||
hello | 0 | 325,020,000,000 | 100% | ||
world | 0 | 153,384,000,000 | 100% | ||
fufubar1 | 0 | 59,412,000,000 | 100% | ||
cyrano | 0 | 399,714,000,000 | 100% | ||
anonymous1 | 0 | 14,997,000,000 | 100% | ||
red | 0 | 1,441,000,000 | 1% | ||
roadscape | 0 | 163,137,000,000 | 100% | ||
xeroc | 0 | 22,986,000,000 | 100% | ||
mineralwasser | 0 | 0 | 100% | ||
boombastic | 0 | 0 | 100% | ||
mrs.agsexplorer | 0 | 0 | 100% | ||
bingo-0 | 0 | 0 | 100% | ||
bingo-1 | 0 | 0 | 100% | ||
proctologic | 0 | 11,017,871,369 | 100% | ||
sandwich | 0 | 14,813,089,349 | 100% | ||
maxim-ananko | 0 | 1,823,667,252 | 100% | ||
razem-io | 0 | 460,025,046 | 100% | ||
oaldamster | 0 | 33,715,981,033 | 100% | ||
murh | 0 | 1,746,610,316 | 33.01% | ||
zebbra2014 | 0 | 2,444,457,397 | 100% | ||
johnerfx | 0 | 9,294,495,054 | 100% | ||
johnerminer | 0 | 857,180,938 | 100% | ||
m0se | 0 | 24,128,343,144 | 100% | ||
cool | 0 | 3,250,572,419 | 100% | ||
rubybian | 0 | 0 | 100% | ||
zer0sum | 0 | 2,295,825,546 | 100% | ||
rodomonte | 0 | 321,157,591 | 100% | ||
auxon | 0 | 9,466,944,111 | 100% | ||
mahnunchik | 0 | 246,680,271 | 100% | ||
dudutaulois | 0 | 256,708,943 | 100% | ||
mynameisbrian | 0 | 16,347,537,675 | 100% | ||
steemerman | 0 | 111,601,274 | 100% | ||
alex.chien | 0 | 0 | 100% | ||
pigatron | 0 | 3,419,058,842 | 100% | ||
unlizw | 0 | 62,770,561 | 100% | ||
flashjordan | 0 | 0 | 100% | ||
sift666 | 0 | 0 | -100% | ||
steemboy | 0 | 0 | 100% | ||
anthonyadavisii | 0 | 0 | 1% | ||
bcruise808 | 0 | 0 | 100% | ||
eeple | 0 | 0 | 100% | ||
sultanaceh | 0 | 0 | 2% |
"method": "get_account" should be "method": "get_accounts" ... thanks for the post!
author | auxon |
---|---|
permlink | re-xeroc-steem-api-20160721t173402486z |
category | undefined |
json_metadata | {} |
created | 2016-07-21 17:34:03 |
last_update | 2016-07-21 17:34:03 |
depth | 1 |
children | 0 |
last_payout | 2016-08-24 05:37:24 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 84 |
author_reputation | 585,484,586,007 |
root_title | "Steem API" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 252,816 |
net_rshares | 30,653,584,379 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
auxon | 0 | 9,881,542,067 | 100% | ||
ausbitbank | 0 | 20,772,042,312 | 100% | ||
sift666 | 0 | 0 | -100% |
@xeroc Hallo, thanks a lot for the post! I'm pretty new to Steemit and Python coding, but I have managed to successfully run some API's off other websites in the past. At the start, where you say "./programs/steemd/steemd --rpc-endpoint=127.0.0.1:8092" can be used to open a RPC endpoint. Do I run that in my CMD? I'm pretty lost. All I basically want is to run script in python, to just print a live list of the activity on the Steemit block chain. Something very similar to http://steemstream.com/ but only in my python window. Please help!
author | marcelhattingh |
---|---|
permlink | re-xeroc-steem-api-20160714t113339648z |
category | undefined |
json_metadata | {"users":["xeroc"],"links":["http://steemstream.com/"]} |
created | 2016-07-14 11:33:39 |
last_update | 2016-07-14 11:33:39 |
depth | 1 |
children | 2 |
last_payout | 2016-08-24 05:37:24 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.025 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 542 |
author_reputation | 557,841,623,208 |
root_title | "Steem API" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 108,907 |
net_rshares | 13,980,847,140 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
sandwich | 0 | 11,780,835,483 | 100% | ||
zebbra2014 | 0 | 2,200,011,657 | 100% | ||
sift666 | 0 | 0 | -100% | ||
nodex | 0 | 0 | 100% |
probably need to get each block as it comes in and display what each block has: curl http://127.0.0.1:8090": "2.0", "method": "call", "params": ["database_api", "get_block", [10000]], "id": 3}' returns: {"id":3,"result":{"previous":"0000270f17162d089d8cbf634b7ce434df782c9c","timestamp":"2016-03-25T00:34:48","witness":"itsascam","transaction_merkle_root":"340b3605652c91cd41456656c1915a7b5b46dffa","extensions":[],"witness_signature":"20546ff92d26a7d3ba3e3331a95c6389c9018620f9430fdee8857e925bf7fa13806dbadd7371a244706ba3df0e1ffb0db084aa4019950594d6289a11f4256b66b8","transactions":[{"ref_block_num":9999,"ref_block_prefix":137172503,"expiration":"2016-03-25T01:34:45","operations":[["pow",{"worker_account":"steemit59","block_id":"0000270f17162d089d8cbf634b7ce434df782c9c","nonce":"2069557240858032527","work":{"worker":"STM65wH1LZ7BfSHcK69SShnqCAH5xdoSZpGkUjmzHJ5GCuxEK9V5G","input":"1125c3ab09a55396c55ed60283cd6634d455d7bc1b9efb169952c654923e9f7e","signature":"20194bba7b31c53f7bc74efd9d0524e71ae87e4b60072313d866dac4c722c30da8365c3c28c972f8b06892cf1c60703d4abf550c24f66098e57a7f9671b41caf42","work":"0000000435a0bfad8471034a209d7556b4c16d77b22a66970de224f6fedad95a"},"props":{"account_creation_fee":"100.000 STEEM","maximum_block_size":131072,"sbd_interest_rate":1000}}]],"extensions":[],"signatures":[]}]}} So you would need a loop that checks for the latest blocknumber and then iterate until you reach that number, then for each block call a parsing function, extracting the info you want to display
author | jl777 |
---|---|
permlink | re-marcelhattingh-re-xeroc-steem-api-20160717t112759269z |
category | undefined |
json_metadata | {"links":["http://127.0.0.1:8090"]} |
created | 2016-07-17 11:28:00 |
last_update | 2016-07-17 11:33:45 |
depth | 2 |
children | 0 |
last_payout | 2016-08-24 05:37:24 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.025 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 1,510 |
author_reputation | 14,988,697,980,664 |
root_title | "Steem API" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 142,890 |
net_rshares | 14,634,567,455 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
sandwich | 0 | 12,082,908,188 | 100% | ||
zebbra2014 | 0 | 2,444,457,397 | 100% | ||
iotaardor | 0 | 107,201,870 | 100% | ||
sift666 | 0 | 0 | -100% | ||
nodex | 0 | 0 | 100% |
Danke @marcelhattingh, dein Tipp <b>127</b> wurde notiert, viel GlΓΌck!
author | nodex |
---|---|
permlink | re-re-xeroc-steem-api-20160714t113339648z |
category | undefined |
json_metadata | {"tags":["deutsch"],"app":"steemjs"} |
created | 2018-09-27 07:12:36 |
last_update | 2018-09-27 07:12:36 |
depth | 2 |
children | 0 |
last_payout | 2018-10-04 07:12:36 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 70 |
author_reputation | 9,874,165,210,636 |
root_title | "Steem API" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 72,258,845 |
net_rshares | 170,989,019 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
dbchild | 0 | 170,989,019 | 100% |
Hi @xeroc, Great post! I'm looking for an API that allows me to create content (POSTs). I have been reading the documentation and it seems that we can only retrieve information or just create a comments or up-vote. I wonder if you could point me to some API that allows creating POST in steemit.com. Thanks, @realskilled
author | realskilled |
---|---|
permlink | re-xeroc-steem-api-20171008t222001326z |
category | undefined |
json_metadata | {"tags":[null],"users":["xeroc","realskilled"],"app":"steemit/0.1"} |
created | 2017-10-08 22:20:00 |
last_update | 2017-10-08 22:20:00 |
depth | 1 |
children | 0 |
last_payout | 2017-10-15 22:20:00 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 325 |
author_reputation | -65,196,368,224 |
root_title | "Steem API" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 17,143,421 |
net_rshares | 0 |
thanks for the post, would you happen to have any ideas on how i can programatically post to steemit with an API?
author | steemboy |
---|---|
permlink | re-xeroc-steem-api-20170806t065317491z |
category | undefined |
json_metadata | {"tags":[null],"app":"steemit/0.1"} |
created | 2017-08-06 06:53:18 |
last_update | 2017-08-06 06:53:18 |
depth | 1 |
children | 0 |
last_payout | 2017-08-13 06:53:18 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 113 |
author_reputation | -4,629,348,551 |
root_title | "Steem API" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 10,917,060 |
net_rshares | 0 |
https://steemit.com/life/@vaerospace/it-seems-that-if-you-dare-use-a-footer-in-your-comments-mentioning-your-posts-or-sevices
author | vaerospace |
---|---|
permlink | re-xeroc-steem-api-20171026t142444923z |
category | undefined |
json_metadata | {"tags":[null],"links":["https://steemit.com/life/@vaerospace/it-seems-that-if-you-dare-use-a-footer-in-your-comments-mentioning-your-posts-or-sevices"],"app":"steemit/0.1"} |
created | 2017-10-26 14:24:33 |
last_update | 2017-10-26 14:24:33 |
depth | 1 |
children | 0 |
last_payout | 2017-11-02 14:24:33 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 125 |
author_reputation | 1,406,057,356,244 |
root_title | "Steem API" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 18,620,291 |
net_rshares | 0 |