![steemnode.png](https://steemitimages.com/DQmNfuy8skgxXnAMNtM8tBjwu8Bo9ffB9bux8fcDE4WeZHg/steemnode.png) Did you know that steemit.com's front-end (condenser) serves profile data for use in other applications via JSON? Check it out, example: [steemit.com/@username.json](https://steemit.com/@username.json). Just fill in your username and go. SBD, STEEM, and VESTS balances are available in addition to quite a bit more. steemit.com serves content in gzip compressed format, so you do need to load a library and pipe it in order to get valid JSON - easy enough. I'm sure some of you will find this useful :) This is an example and it just displays a few objects, but it's as simple as this: ``` const https = require('https'); const zlib = require('zlib'); let options = { host: 'steemit.com', path: '/@username.json' }; https.get(options, function (res) { let json = ''; let gunzip = zlib.createGunzip(); res.pipe(gunzip); gunzip.on('data', function (chunk) { json += chunk; }); gunzip.on('end', function () { if (res.statusCode === 200) { try { let data = JSON.parse(json); console.log('STEEM balance: ' + data.user.balance); console.log('SBD balance: ' + data.user.sbd_balance); console.log('VEST balance: ' + data.user.vesting_shares); } catch (e) { console.log('Error parsing JSON'); } } else { console.log('Non-200 status code received: ' + res.statusCode); } }).on('error', function (err) { console.log('Error pulling JSON: ' + err); }); }); ``` Enjoy and Steem On!
post_id | 3,326,127 |
---|---|
author | justinw |
permlink | pulling-wallet-and-other-profile-data-from-steemit-com-username-json-using-javascript |
category | steemdev |
json_metadata | "{"app": "steemit/0.1", "format": "markdown", "links": ["https://steemit.com/@username.json"], "image": ["https://steemitimages.com/DQmNfuy8skgxXnAMNtM8tBjwu8Bo9ffB9bux8fcDE4WeZHg/steemnode.png"], "tags": ["steemdev", "steemit", "steem", "javascript", "nodejs"]}" |
created | 2017-06-03 06:46:00 |
last_update | 2017-06-03 06:46:00 |
depth | 0 |
children | 1 |
net_rshares | 13,849,865,820,390 |
last_payout | 2017-06-10 06:46:00 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 172.476 SBD |
curator_payout_value | 44.542 SBD |
pending_payout_value | 0.000 SBD |
promoted | 0.000 SBD |
body_length | 1,539 |
author_reputation | 8,275,186,260,175 |
root_title | "Pulling wallet (and other) profile data from steemit.com/@username.json using javascript" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 SBD |
percent_steem_dollars | 10,000 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
gtg | 0 | 1,277,643,238,269 | 100% | ||
fyrstikken | 0 | 105,831,422,154 | 2% | ||
furion | 0 | 726,308,671,427 | 100% | ||
ausbitbank | 0 | 1,171,150,490,321 | 32% | ||
igster | 0 | 45,165,056,564 | 100% | ||
transisto | 0 | 3,497,601,955,937 | 90% | ||
krystle | 0 | 13,632,206,451 | 32% | ||
cryptos | 0 | 24,489,242,363 | 50% | ||
julianita | 0 | 2,297,472,601,793 | 100% | ||
slorunner | 0 | 99,957,286 | 100% | ||
infobot | 0 | 57,285,217 | 100% | ||
bosjaya | 0 | 357,146,622 | 100% | ||
dragosroua | 0 | 58,338,631,822 | 100% | ||
raluca | 0 | 2,925,921,263 | 100% | ||
justinw | 0 | 32,028,213,692 | 100% | ||
revdocwelch | 0 | 0 | 100% | ||
playfulfoodie | 0 | 22,379,008,403 | 100% | ||
crystalandbones | 0 | 1,674,297,715 | 100% | ||
tarazkp | 0 | 3,096,080,311 | 32% | ||
vikx | 0 | 87,413,368 | 30% | ||
trafalgar | 0 | 957,066,221,108 | 19% | ||
sasagood | 0 | 495,727,010 | 100% | ||
awesomianist | 0 | 675,945,090 | 32% | ||
aismor | 0 | 653,775,298 | 100% | ||
waphilip | 0 | 0 | 100% | ||
oroger | 0 | 1,578,704,990 | 100% | ||
recrypto | 0 | 2,024,178,870 | 100% | ||
roomservice | 0 | 45,730,434,329 | 100% | ||
leomichael | 0 | 288,545,925 | 100% | ||
dikkyamiputra | 0 | 1,394,135,842 | 100% | ||
zygimantas | 0 | 4,571,850,210 | 100% | ||
newsflash | 0 | 3,553,670,758,874 | 100% | ||
bindia | 0 | 620,272,422 | 100% | ||
adnanrahic | 0 | 756,429,444 | 100% | ||
mimulusamsterdam | 0 | 0 | 100% | ||
gdenocewelch | 0 | 0 | 100% | ||
andrew5602 | 0 | 0 | 100% | ||
fode | 0 | 0 | 100% | ||
contenidos | 0 | 0 | 100% | ||
gaildenocewelch | 0 | 0 | 100% | ||
anddres | 0 | 0 | 100% |
post_id | 3,327,836 |
---|---|
author | rhino |
permlink | re-justinw-pulling-wallet-and-other-profile-data-from-steemit-com-username-json-using-javascript-20170603t081641798z |
category | steemdev |
json_metadata | "{"app": "steemit/0.1", "tags": ["steemdev"]}" |
created | 2017-06-03 08:16:42 |
last_update | 2017-06-03 08:16:42 |
depth | 1 |
children | 0 |
net_rshares | 36,341,439,567 |
last_payout | 2017-06-10 08:16:42 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.098 SBD |
curator_payout_value | 0.029 SBD |
pending_payout_value | 0.000 SBD |
promoted | 0.000 SBD |
body_length | 12 |
author_reputation | 2,958,769,349,525 |
root_title | "Pulling wallet (and other) profile data from steemit.com/@username.json using javascript" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 SBD |
percent_steem_dollars | 10,000 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
rhino | 0 | 4,313,225,875 | 100% | ||
justinw | 0 | 32,028,213,692 | 100% |