Yesterday I was blown away as I read @emrebeyler post about the launch of his new [Hivemind API](https://steemit.com/utopian-io/@emrebeyler/tower-a-rest-api-implementation-on-the-top-of-hivemind). <center>![Captura de pantalla 2019-01-18 a la(s) 15.55.57.png](https://cdn.steemitimages.com/DQmWWZecb78gy3FQfKEevYKaM1UkhqEmFW563Y7fGJv8CPx/Captura%20de%20pantalla%202019-01-18%20a%20la(s)%2015.55.57.png)</center> You could of course head over to [tower.emrebeyler.me](https://tower.emrebeyler.me) and play with the very simple to use Graphic Interface that @emrebeyler has built for us, but if you want to do some development I found that the simplest way for me was to query his API to fetch a result, then you could turn that result into a variable and do all sort of things with it. In this guide I will provide two examples of how we could get: 1.- The number 1 account in Venezuela sorted by Followers. 2.- The account in Venezuela with the most reputation. We all know Venezuela is pretty big in Steemit, but lets find out who is the king! # Fetch account by Location and Followers To know what URL you should use for your query, you can go to [tower.emrebeyler.me](https://tower.emrebeyler.me), pick the filters that you wish to look for and then paste the output after the https://tower.emrebeyler.me/ domain : ![Captura de pantalla 2019-01-18 a la(s) 16.05.10.png](https://cdn.steemitimages.com/DQmQH8QTX2NsZyhSBtz5b4Hd6tKhRN4Xp1D8arKTM1bmnGh/Captura%20de%20pantalla%202019-01-18%20a%20la(s)%2016.05.10.png) So the url you want to use is: [https://tower.emrebeyler.me/api/v1/accounts/?limit=1&location__contains=Venezuela&ordering=-followers](https://tower.emrebeyler.me) The minus sign (-) before "followers" specifies that we want the result ordered by the account with most followers first. So, our python3 script would look something like this: ```` from urllib.request import urlopen import json url = urlopen('https://tower.emrebeyler.me/api/v1/accounts/?limit=10&location__contains=enezuela&ordering=-followers').read() result = json.loads(url) one = result['results'][0]["name"] fone = result['results'][0]["followers"] print (one, fone) ```` What we are doing is basically querying the .json output that can be very long and hard to understand into a simple python script that would give us the account with most followers in Venezuela, this is the result: `provenezuela 6094` So with more that 6k followers we now know that @provenezuela is the king of Steemit followers in Venezuela, but how about the account with most rep? - well I was excited to see the result of this since its an old friend of mine in Steemit :) We will use the exact same code but we will only change the "followers" parameter and change it for "reputation": ```` from urllib.request import urlopen import json url = urlopen('https://tower.emrebeyler.me/api/v1/accounts/?limit=10&location__contains=enezuela&ordering=-reputation').read() result = json.loads(url) one = result['results'][0]["name"] fone = result['results'][0]["reputation"] print (one, fone) ```` And the outcome is... `elyaque 70.34` My man @elyaque who is an old-timer in Steemit has an amazing 70.34 rep! So, with a little bit of magic and a bit more code, you could use this outputs to follow certain accounts, send a message to them or vote for their latest post. I have created a personal [Python-Steem repository on GitHub](https://github.com/PixelNoob/python-steem) with some very simple scripts that would allow you to do just that. Feel free to check it out, fork it and contribute. ____ </br> *Check out my [new witness page](https://witness.chitty.tech) to find out what I am doing for Steem and support my work voting for my witness:* https://steemconnect.com/sign/account-witness-vote?witness=chitty&approve=1
post_id | 68,995,867 |
---|---|
author | chitty |
permlink | query-a-hivemind-api-with-python |
category | steem |
json_metadata | {"tags":["steem","steemit","api","python","code"],"users":["emrebeyler","provenezuela","elyaque"],"image":["https:\/\/cdn.steemitimages.com\/DQmWWZecb78gy3FQfKEevYKaM1UkhqEmFW563Y7fGJv8CPx\/Captura%20de%20pantalla%202019-01-18%20a%20la(s)%2015.55.57.png","https:\/\/cdn.steemitimages.com\/DQmQH8QTX2NsZyhSBtz5b4Hd6tKhRN4Xp1D8arKTM1bmnGh\/Captura%20de%20pantalla%202019-01-18%20a%20la(s)%2016.05.10.png"],"links":["https:\/\/steemit.com\/utopian-io\/@emrebeyler\/tower-a-rest-api-implementation-on-the-top-of-hivemind","https:\/\/tower.emrebeyler.me","https:\/\/tower.emrebeyler.me\/","https:\/\/github.com\/PixelNoob\/python-steem","https:\/\/witness.chitty.tech","https:\/\/steemconnect.com\/sign\/account-witness-vote?witness=chitty&approve=1"],"app":"steemit\/0.1","format":"markdown"} |
created | 2019-01-18 19:26:33 |
last_update | 2019-01-18 19:26:33 |
depth | 0 |
children | 8 |
net_rshares | 123,150,132,500,840 |
last_payout | 2019-01-25 19:26:33 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 55.080 SBD |
curator_payout_value | 17.316 SBD |
pending_payout_value | 0.000 SBD |
promoted | 0.000 SBD |
body_length | 3,817 |
author_reputation | 84,463,031,858,396 |
root_title | "Query a Hivemind Api with Python" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 SBD |
percent_steem_dollars | 0 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
ajvest | 0 | 147,612,946,444 | 100% | ||
hcf27 | 0 | 3,044,243,880 | 100% | ||
chitty | 0 | 96,158,610,736 | 100% | ||
vinotinto | 0 | 1,870,471,808 | 100% | ||
g-dubs | 0 | 1,745,529,340 | 5% | ||
albertogm | 0 | 81,928,107,977 | 100% | ||
ausbitbank | 0 | 1,212,921,644,688 | 100% | ||
hykert | 0 | 53,209,284,029 | 100% | ||
coliraver | 0 | 968,245,128 | 100% | ||
iamoscar | 0 | 110,877,954 | 50% | ||
capo | 0 | 1,314,499,266 | 100% | ||
steemweekly | 0 | 461,881,063 | 100% | ||
cardboard | 0 | 4,653,367,022 | 100% | ||
estaterrestre | 0 | 16,796,664,383 | 100% | ||
newhope | 0 | 1,585,146,510,844 | 19% | ||
maximdraws | 0 | 693,685,396 | 5% | ||
alexis555 | 0 | 1,368,452,785,610 | 19% | ||
blockchainnomad | 0 | 62,954,847,862 | 100% | ||
josuepalacios | 0 | 866,902,095 | 50% | ||
provenezuela | 0 | 291,031,317,750 | 100% | ||
scotty777 | 0 | 126,618,032 | 10% | ||
ericarthurblair | 0 | 4,821,524,121 | 10% | ||
freethink | 0 | 26,944,761,238 | 100% | ||
lewmen | 0 | 248,459,859 | 50% | ||
sphinx | 0 | 98,525,813 | 100% | ||
pearica | 0 | 12,815,767,992 | 90% | ||
xyzashu | 0 | 30,906,542,189 | 100% | ||
veleje | 0 | 13,032,505,480 | 100% | ||
fandy | 0 | 94,459,867 | 25.47% | ||
analealsuarez | 0 | 402,973,544 | 50% | ||
ashokcan143 | 0 | 1,930,988,338 | 100% | ||
appreciator | 0 | 13,369,541,360,001 | 17.75% | ||
imdazu | 0 | 913,842,651 | 90% | ||
foruni73 | 0 | 55,038,465,862 | 100% | ||
vandrei.razvan | 0 | 38,410,414,784 | 100% | ||
cifer | 0 | 1,237,151,990 | 12% | ||
psicoluigi | 0 | 117,004,851 | 25% | ||
enrique89 | 0 | 3,274,949,197 | 100% | ||
rosatravels | 0 | 114,856,297,300 | 100% | ||
criptorafa | 0 | 31,387,062,460 | 100% | ||
szabolcs | 0 | 49,397,757 | 100% | ||
boomerang | 0 | 11,858,155,183,213 | 41.83% | ||
upme | 0 | 18,587,666,993,003 | 30.22% | ||
myjourney | 0 | 8,393,491,816 | 100% | ||
untaljames | 0 | 1,074,725,406 | 60% | ||
postpromoter | 0 | 16,090,524,988,725 | 47.59% | ||
jaff8 | 0 | 38,683,551,393 | 25% | ||
nithog | 0 | 494,061,136 | 100% | ||
emrebeyler | 0 | 882,550,243,030 | 100% | ||
smartsteem | 0 | 33,926,201,029,995 | 25.47% | ||
cnsteem | 0 | 43,041,855,753 | 100% | ||
rafalex51 | 0 | 241,893,878 | 50% | ||
precisesound | 0 | 554,235,525 | 100% | ||
aidnessanchez | 0 | 1,319,928,393 | 100% | ||
neexal | 0 | 336,801,369 | 100% | ||
cfminer | 0 | 1,708,368,839 | 100% | ||
freddysanchez | 0 | 29,331,980,043 | 100% | ||
lapanterarosa | 0 | 364,716,705 | 70% | ||
madefrance | 0 | 373,163,148 | 30% | ||
maximize | 0 | 1,992,789,687 | 90% | ||
minimize | 0 | 1,967,208,427 | 90% | ||
omardrea | 0 | 333,388,777 | 50% | ||
munawire | 0 | 1,490,025,474 | 100% | ||
yusrizakaria | 0 | 10,160,304,298 | 100% | ||
sonofgod87 | 0 | 211,734,157 | 50% | ||
criminalacorm | 0 | 60,405,667,851 | 100% | ||
kamilo.sin.k2105 | 0 | 479,665,828 | 100% | ||
yckifoundation | 0 | 269,748,337 | 100% | ||
therising | 0 | 15,522,345,988,748 | 13.5% | ||
lamcf6088 | 0 | 506,996,594 | 100% | ||
samsguitar | 0 | 236,133,427 | 50% | ||
kgakakillerg | 0 | 6,188,685,549 | 3% | ||
sergionatera | 0 | 200,776,220 | 50% | ||
mcanimation | 0 | 252,425,765 | 100% | ||
conrack | 0 | 246,892,706 | 50% | ||
dailyupvotes | 0 | 1,325,856,731,451 | 83.33% | ||
albertozambrano | 0 | 576,079,596 | 50% | ||
yohamartinez | 0 | 108,101,662 | 30% | ||
startuplaunchpad | 0 | 79,845,242,100 | 100% | ||
conkamil | 0 | 247,668,874 | 50% | ||
j-porcupine | 0 | 244,568,124 | 50% | ||
caacupe | 0 | 3,639,383,925 | 20% | ||
marcost4 | 0 | 246,881,722 | 50% | ||
rsmartt777 | 0 | 18,997,087 | 90% | ||
godzu | 0 | 248,459,849 | 50% | ||
bolivarvicbang | 0 | 247,668,864 | 50% | ||
wuencaldera | 0 | 195,348,500 | 50% | ||
marena5 | 0 | 1,489,763,667 | 100% | ||
adrigervazzi | 0 | 226,976,734 | 50% | ||
edgarjbb | 0 | 164,451,695 | 50% | ||
carita-feliz | 0 | 247,097,970 | 50% | ||
lauraoficial02 | 0 | 525,823,715 | 100% | ||
andresalviarez | 0 | 226,338,887 | 50% | ||
indiannedark | 0 | 246,828,178 | 50% | ||
braeorias | 0 | 248,459,921 | 50% | ||
dan1321 | 0 | 398,829,027 | 100% | ||
melor9 | 0 | 410,057,545 | 50% | ||
marivic10 | 0 | 165,342,155 | 50% | ||
jidgabol | 0 | 89,060,690 | 100% | ||
tianalaunik | 0 | 339,209,127 | 50% | ||
cafu12 | 0 | 248,459,849 | 50% | ||
mariadelfi | 0 | 248,459,869 | 50% | ||
turboucoin | 0 | 491,131,696 | 100% | ||
lucky222 | 0 | 271,153,811,420 | 100% | ||
vyaduka | 0 | 4,093,732,775 | 20.91% | ||
aleestra | 0 | 1,904,155,823 | 100% | ||
rgirgin | 0 | 511,786,025 | 100% | ||
upyougo | 0 | 7,271,621,316 | 75% | ||
nodaji | 0 | 1,160,639,816 | 0.61% | ||
sbdback | 0 | 1,309,963,601 | 1.42% | ||
simmani | 0 | 1,019,225,249 | 1.41% | ||
fullvote | 0 | 1,283,861,559 | 0.55% | ||
brightsun | 0 | 0 | 5% | ||
isther69 | 0 | 233,315,125 | 50% | ||
roime | 0 | 1,980,459,977 | 90% | ||
jesusunda | 0 | 101,048,811 | 25% | ||
crytiblock | 0 | 7,102,073,275 | 70% | ||
wookiju | 0 | 5,432,888,490 | 90% | ||
teriyaki | 0 | 8,409,277,128 | 90% | ||
simmanis | 0 | 919,926,839 | 17.12% | ||
sojucaps1 | 0 | 2,343,847,601 | 90% | ||
nacis | 0 | 354,808,356 | 100% | ||
singhcapital | 0 | 5,576,119,365,174 | 100% | ||
vitasoy | 0 | 83,020,476 | 100% | ||
kamicurate | 0 | 1,966,944,153 | 100% | ||
samirajpoot | 0 | 0 | 100% | ||
tipu.curator | 0 | 15,682,782,748 | 50% | ||
disha66 | 0 | 80,435,802 | 100% | ||
yol26 | 0 | 543,540,521 | 100% | ||
jaccc | 0 | 50,684,659,527 | 75% | ||
corte | 0 | 86,690,808 | 100% | ||
mgranja | 0 | 51,609,766,824 | 22% | ||
rahuldevsaini | 0 | 251,362,788 | 100% | ||
olligamer | 0 | 124,059,530 | 100% | ||
youngsolkim | 0 | 519,301,179 | 100% | ||
neno001hr | 0 | 131,875,057 | 100% | ||
karimhaiek | 0 | 447,523,897 | 100% | ||
dustin-grim | 0 | 354,301,163 | 100% | ||
queenshimi | 0 | 276,400,052 | 100% | ||
lobojt | 0 | 18,909,162 | 100% | ||
zmustapha | 0 | 458,676,922 | 100% | ||
mahdin | 0 | 367,879,576 | 100% |
Gracias por esta info @chitty ! hemos trabajado dos largos años para alcanzar nuestro nivel de seguidores :)
post_id | 68,996,130 |
---|---|
author | provenezuela |
permlink | re-chitty-query-a-hivemind-api-with-python-20190118t193509221z |
category | steem |
json_metadata | {"tags":["steem"],"users":["chitty"],"app":"steemit\/0.1"} |
created | 2019-01-18 19:35:09 |
last_update | 2019-01-18 19:35:09 |
depth | 1 |
children | 0 |
net_rshares | 95,398,635,997 |
last_payout | 2019-01-25 19:35:09 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.042 SBD |
curator_payout_value | 0.013 SBD |
pending_payout_value | 0.000 SBD |
promoted | 0.000 SBD |
body_length | 108 |
author_reputation | 14,603,079,328,664 |
root_title | "Query a Hivemind Api with Python" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 SBD |
percent_steem_dollars | 10,000 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
chitty | 0 | 91,236,213,258 | 100% | ||
coliraver | 0 | 947,950,937 | 100% | ||
enrique89 | 0 | 3,214,471,802 | 100% |
Excellent! I'a trying to learn java but is not so easy to star with it.
post_id | 68,998,985 |
---|---|
author | yol26 |
permlink | re-chitty-query-a-hivemind-api-with-python-20190118t210617712z |
category | steem |
json_metadata | {"tags":["steem"],"app":"steemit\/0.1"} |
created | 2019-01-18 21:06:18 |
last_update | 2019-01-18 21:06:18 |
depth | 1 |
children | 0 |
net_rshares | 33,050,874,343 |
last_payout | 2019-01-25 21:06:18 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 SBD |
curator_payout_value | 0.000 SBD |
pending_payout_value | 0.000 SBD |
promoted | 0.000 SBD |
body_length | 71 |
author_reputation | 704,332,579,924 |
root_title | "Query a Hivemind Api with Python" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 SBD |
percent_steem_dollars | 10,000 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
chitty | 0 | 33,050,874,343 | 36% |
This post has received a 41.83 % upvote from @boomerang.
post_id | 68,999,609 |
---|---|
author | boomerang |
permlink | re-query-a-hivemind-api-with-python-20190118t213025 |
category | steem |
json_metadata | {} |
created | 2019-01-18 21:30:24 |
last_update | 2019-01-18 21:30:24 |
depth | 1 |
children | 0 |
net_rshares | 0 |
last_payout | 2019-01-25 21:30:24 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 SBD |
curator_payout_value | 0.000 SBD |
pending_payout_value | 0.000 SBD |
promoted | 0.000 SBD |
body_length | 56 |
author_reputation | 3,503,034,741,265 |
root_title | "Query a Hivemind Api with Python" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 SBD |
percent_steem_dollars | 10,000 |
Thanks for sharing... Posted using [Partiko Android](https://steemit.com/@partiko-android)
post_id | 69,000,419 |
---|---|
author | ashokcan143 |
permlink | ashokcan143-re-chitty-query-a-hivemind-api-with-python-20190118t220050031z |
category | steem |
json_metadata | {"app":"partiko","client":"android"} |
created | 2019-01-18 22:00:51 |
last_update | 2019-01-18 22:00:51 |
depth | 1 |
children | 0 |
net_rshares | 22,562,323,041 |
last_payout | 2019-01-25 22:00:51 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 SBD |
curator_payout_value | 0.000 SBD |
pending_payout_value | 0.000 SBD |
promoted | 0.000 SBD |
body_length | 91 |
author_reputation | 3,696,389,924,413 |
root_title | "Query a Hivemind Api with Python" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 SBD |
percent_steem_dollars | 10,000 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
chitty | 0 | 22,584,090,892 | 25% | ||
cheetah | 0 | -21,767,851 | -0.08% |
You got a 83.33% upvote from @dailyupvotes courtesy of @digitalart! @dailyupvotes is the only bot with guaranteed ROI of at least 1%
post_id | 69,001,523 |
---|---|
author | dailyupvotes |
permlink | re-chitty-query-a-hivemind-api-with-python-20190118t224931177z |
category | steem |
json_metadata | {"app":"postpromoter\/2.1.0"} |
created | 2019-01-18 22:49:30 |
last_update | 2019-01-18 22:49:30 |
depth | 1 |
children | 0 |
net_rshares | 92,772,633,998 |
last_payout | 2019-01-25 22:49:30 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.040 SBD |
curator_payout_value | 0.013 SBD |
pending_payout_value | 0.000 SBD |
promoted | 0.000 SBD |
body_length | 134 |
author_reputation | 747,021,898,927 |
root_title | "Query a Hivemind Api with Python" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 SBD |
percent_steem_dollars | 10,000 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
chitty | 0 | 92,772,633,998 | 100% |
Great python tutorial @chitty ! I recently made a javascript tool using this same tower/hivemind api for searching users by location that your readers may be interested in. It's available at <a href="http://steemviz.com/aussiesearch ">here</a>, and <a href="https://github.com/ausbitbank/steemviz/blob/master/aussiesearch.js">source code is here</a> :)
post_id | 69,018,546 |
---|---|
author | ausbitbank |
permlink | re-chitty-query-a-hivemind-api-with-python-20190119t100708620z |
category | steem |
json_metadata | "{"tags":["steem"],"users":["chitty"],"links":["http:\/\/steemviz.com\/aussiesearch ","https:\/\/github.com\/ausbitbank\/steemviz\/blob\/master\/aussiesearch.js"],"app":"steemit\/0.1"}" |
created | 2019-01-19 10:07:09 |
last_update | 2019-01-19 10:07:09 |
depth | 1 |
children | 1 |
net_rshares | 50,047,948,791 |
last_payout | 2019-01-26 10:07:09 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.021 SBD |
curator_payout_value | 0.006 SBD |
pending_payout_value | 0.000 SBD |
promoted | 0.000 SBD |
body_length | 355 |
author_reputation | 225,597,006,884,358 |
root_title | "Query a Hivemind Api with Python" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 SBD |
percent_steem_dollars | 10,000 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
chitty | 0 | 48,177,476,983 | 49% | ||
vinotinto | 0 | 1,870,471,808 | 100% |
Wow! This is really useful and and easy to use! Thanks for sharing it @ausbitbank Posted using [Partiko iOS](https://steemit.com/@partiko-ios)
post_id | 69,093,352 |
---|---|
author | chitty |
permlink | chitty-re-ausbitbank-re-chitty-query-a-hivemind-api-with-python-20190121t021049293z |
category | steem |
json_metadata | {"app":"partiko","client":"ios"} |
created | 2019-01-21 02:10:48 |
last_update | 2019-01-21 02:10:48 |
depth | 2 |
children | 0 |
net_rshares | 0 |
last_payout | 2019-01-28 02:10:48 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 SBD |
curator_payout_value | 0.000 SBD |
pending_payout_value | 0.000 SBD |
promoted | 0.000 SBD |
body_length | 144 |
author_reputation | 84,463,031,858,396 |
root_title | "Query a Hivemind Api with Python" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 SBD |
percent_steem_dollars | 10,000 |
Congratulations @chitty! Your post was mentioned in the [Steem Hit Parade](https://steemit.com/hit-parade/@arcange/daily-hit-parade-20190118) in the following category: * Pending payout - Ranked 9 with $ 63,95
post_id | 69,032,519 |
---|---|
author | arcange |
permlink | re-query-a-hivemind-api-with-python-20190118t173933000z |
category | steem |
json_metadata | {} |
created | 2019-01-19 16:39:51 |
last_update | 2019-01-19 16:39:51 |
depth | 1 |
children | 0 |
net_rshares | 0 |
last_payout | 2019-01-26 16:39:51 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 SBD |
curator_payout_value | 0.000 SBD |
pending_payout_value | 0.000 SBD |
promoted | 0.000 SBD |
body_length | 211 |
author_reputation | 231,443,210,169,699 |
root_title | "Query a Hivemind Api with Python" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 SBD |
percent_steem_dollars | 10,000 |