create account

Using Lightsteem to query Hivemind by emrebeyler

View this thread on: hive.blogpeakd.comecency.com
· @emrebeyler · (edited)
$4.67
Using Lightsteem to query Hivemind

I use [Lightsteem](https://lightsteem.readthedocs.io) to test and query Hivemind endpoints. Structure-wise, Hive's RPC server part is compatible with the steemd RPC nodes. So, it's a simple configuration touch.

# condenser_api

Example to get followers of an account:

```
from lightsteem.client import Client

c = Client(nodes=["https://hivemind.emrebeyler.me"])
followers = c.get_followers("emrebeyler", "", "blog", 10)
print(followers)
```
***
You can find the list of methods [here](https://steemit.com/hivemind/@emrebeyler/introducing-a-public-hivemind-node).

# hive_api


- Example to get the database head state

```
from lightsteem.client import Client

c = Client(nodes=["https://hivemind.emrebeyler.me"])
head_state = c('hive').db_head_state()
print(head_state)
```
***

Output:

```
{'db_head_block': 29371204,
 'db_head_time': '2019-01-11 20:15:51',
 'db_head_age': 10}
```
***
- Auto-complete endpoint

```
from lightsteem.client import Client

c = Client(nodes=["https://hivemind.emrebeyler.me"])

# search for accounts starting with dpoll, 
# from emrebeyler's perspective.

accounts = c('hive').get_accounts_ac(["dpoll", "emrebeyler"])

print(accounts)
```
***

Output:

```
{'friend': [{'name': 'dpoll.curation',
   'vote_sp': 24280,
   'joined_at': '2018-11-04 09:21:42',
   'reputation': 54.57,
   'context': {'is_following': True}},
  {'name': 'dpoll.sponsors',
   'vote_sp': 0,
   'joined_at': '2018-11-13 06:41:12',
   'reputation': 25.0,
   'context': {'is_following': True}}],
 'global': [{'name': 'dpolly0',
   'vote_sp': 0,
   'joined_at': '2016-08-07 10:01:54',
   'reputation': 25.0},
  {'name': 'dpolls.app',
   'vote_sp': 0,
   'joined_at': '2018-08-27 08:05:54',
   'reputation': 25.0},
  {'name': 'dpoll.xyz',
   'vote_sp': 0,
   'joined_at': '2018-09-21 10:32:06',
   'reputation': 25.0},
  {'name': 'dpoll.test',
   'vote_sp': 0,
   'joined_at': '2018-11-23 20:53:15',
   'reputation': 25.0},
  {'name': 'dpoll.funds',
   'vote_sp': 0,
   'joined_at': '2018-11-19 06:58:42',
   'reputation': 25.0},
  {'name': 'dpoll.economy',
   'vote_sp': 0,
   'joined_at': '2018-05-05 14:55:45',
   'reputation': 25.0},
  {'name': 'dpoll.app',
   'vote_sp': 0,
   'joined_at': '2018-04-23 14:19:00',
   'reputation': 25.0},
  {'name': 'dpoll-xyz',
   'vote_sp': 0,
   'joined_at': '2018-11-16 08:50:45',
   'reputation': 25.0},
  {'name': 'dpoll',
   'vote_sp': 0,
   'joined_at': '2018-03-13 13:23:57',
   'reputation': 25.0}]}
```
***
- get_accounts 

```
from lightsteem.client import Client

c = Client(nodes=["https://hivemind.emrebeyler.me"])

# retrieve basic data of the passed accounts
accounts = c('hive').get_accounts([["foo", "bar"]])

print(accounts)
```
***
Output:

```
[{'name': 'foo',
  'vote_sp': 0,
  'joined_at': '2016-04-05 09:18:45',
  'reputation': 25.0},
 {'name': 'bar',
  'vote_sp': 0,
  'joined_at': '2016-05-01 14:59:12',
  'reputation': 25.0}]
```
***
For the Beem fans, it's also possible with Beem's [internal GrapheneRPC client](https://steemit.com/hivemind/@holger80/re-isnochys-re-emrebeyler-introducing-a-public-hivemind-node-20190110t215153601z).
👍  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , and 65 others
properties (23)
authoremrebeyler
permlinkusing-lightsteem-to-query-hivemind
categoryhivemind
json_metadata{"community":"busy","app":"busy/2.5.6","format":"markdown","tags":["hivemind","programming","lightsteem","development","busy"],"users":["emrebeyler","holger80"],"links":["https://lightsteem.readthedocs.io","https://steemit.com/hivemind/@emrebeyler/introducing-a-public-hivemind-node","https://steemit.com/hivemind/@holger80/re-isnochys-re-emrebeyler-introducing-a-public-hivemind-node-20190110t215153601z"],"image":[]}
created2019-01-11 20:29:12
last_update2019-01-11 20:31:15
depth0
children6
last_payout2019-01-18 20:29:12
cashout_time1969-12-31 23:59:59
total_payout_value3.760 HBD
curator_payout_value0.909 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length3,107
author_reputation448,535,049,068,622
root_title" Using Lightsteem to query Hivemind"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id78,245,819
net_rshares9,703,009,027,498
author_curate_reward""
vote details (129)
@beerlover ·
<div class='pull-right'>https://cdn.steemitimages.com/DQmaHThyECGhEx8tSfHZbiMFRNYjJ35K92cDgiJjkzBUaJo/One%20sip%20of%20BEER%20for%20you.gif<p><sup><a href='https://steem-engine.com/?p=market&t=BEER'>View or trade </a> <code>BEER</code>.</sup></p></div><center><br> <p> Hey @emrebeyler, here is a little bit of <code>BEER</code> from @isnochys for you. Enjoy it!</p> <p>Learn how to <a href='https://steemit.com/beer/@beerlover/what-is-proof-of-stake-with-beer'>earn FREE BEER each day </a> by staking.</p> </center><div></div>
properties (22)
authorbeerlover
permlinkre-using-lightsteem-to-query-hivemind-20200111t060713z
categoryhivemind
json_metadata"{"app": "beem/0.21.1"}"
created2020-01-11 06:07:15
last_update2020-01-11 06:07:15
depth1
children0
last_payout2020-01-18 06:07:15
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length526
author_reputation25,806,928,345,618
root_title" Using Lightsteem to query Hivemind"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id94,284,473
net_rshares0
@isnochys ·
One year old !BEER
properties (22)
authorisnochys
permlinkre-using-lightsteem-to-query-hivemind-20200111t060703z
categoryhivemind
json_metadata"{"app": "beem/0.20.23"}"
created2020-01-11 06:07:06
last_update2020-01-11 06:07:06
depth1
children0
last_payout2020-01-18 06:07:06
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length18
author_reputation47,894,613,197,575
root_title" Using Lightsteem to query Hivemind"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id94,284,471
net_rshares0
@partiko ·
Thank you so much for participating the Partiko Delegation Plan Round 1! We really appreciate your support! As part of the delegation benefits, we just gave you a 3.00% upvote! Together, let’s change the world!
properties (22)
authorpartiko
permlinkre-using-lightsteem-to-query-hivemind-20190111t223117
categoryhivemind
json_metadata""
created2019-01-11 22:31:18
last_update2019-01-11 22:31:18
depth1
children0
last_payout2019-01-18 22:31:18
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length210
author_reputation39,207,160,334,751
root_title" Using Lightsteem to query Hivemind"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id78,249,791
net_rshares0
@pennsif ·
This post has been included in the latest edition of  [**SOS Daily News**](https://steemit.com/steem/@pennsif/sosdailynewsnewsaboutthestateofsteem11january2019-56l4079453) - a digest of all you need to know about the State of Steem.

***

* *Editor of the [**The State of Steem SoS Daily News**](https://steemit.com/steem/@pennsif/sosdailynewsnewsaboutthestateofsteem11january2019-56l4079453).*

* *Promoter of [**The State of Steem SoS Weekly Forums**](https://steemit.com/dtube/@pennsif/k8811wa6).*

* *Editor of the [**weekly listing of steem radio shows, podcasts & social broadcasts**](https://steemit.com/mspwaves/@pennsif/schedule-of-radio-shows-podcasts-and-social-broadcasts-supported-by-dsound-week-beginning-7-january-2019).*

* *Founder of the [**A Dollar A Day**](https://steemit.com/adollaraday/@adollaraday/a-dollar-a-day-charitable-giving-project-ususd-5000-donated-in-8-months-we-made-it) charitable giving project.*

***
properties (22)
authorpennsif
permlinkre-emrebeyler-using-lightsteem-to-query-hivemind-20190112t143550149z
categoryhivemind
json_metadata{"tags":["hivemind"],"links":["https://steemit.com/steem/@pennsif/sosdailynewsnewsaboutthestateofsteem11january2019-56l4079453","https://steemit.com/dtube/@pennsif/k8811wa6","https://steemit.com/mspwaves/@pennsif/schedule-of-radio-shows-podcasts-and-social-broadcasts-supported-by-dsound-week-beginning-7-january-2019","https://steemit.com/adollaraday/@adollaraday/a-dollar-a-day-charitable-giving-project-ususd-5000-donated-in-8-months-we-made-it"],"app":"steemit/0.1"}
created2019-01-12 14:35:51
last_update2019-01-12 14:35:51
depth1
children0
last_payout2019-01-19 14:35:51
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length938
author_reputation636,410,097,572,565
root_title" Using Lightsteem to query Hivemind"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id78,277,192
net_rshares0
@pinkwonder ·
I really like your posts. I just at the beginning of the exploring of steem api with python, now I see yet one python library for it, additional to beem and steem-python.
properties (22)
authorpinkwonder
permlinkre-emrebeyler-using-lightsteem-to-query-hivemind-20190113t192743357z
categoryhivemind
json_metadata{"community":"busy","app":"busy/2.5.6","format":"markdown","tags":["hivemind"],"users":[],"links":[],"image":[]}
created2019-01-13 19:27:45
last_update2019-01-13 19:27:45
depth1
children1
last_payout2019-01-20 19:27:45
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length170
author_reputation12,337,737,438,559
root_title" Using Lightsteem to query Hivemind"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id78,329,214
net_rshares0
@emrebeyler ·
Glad you like my content :-)
properties (22)
authoremrebeyler
permlinkre-pinkwonder-re-emrebeyler-using-lightsteem-to-query-hivemind-20190114t074414332z
categoryhivemind
json_metadata{"tags":["hivemind"],"app":"steemit/0.1"}
created2019-01-14 07:44:15
last_update2019-01-14 07:44:15
depth2
children0
last_payout2019-01-21 07:44:15
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length28
author_reputation448,535,049,068,622
root_title" Using Lightsteem to query Hivemind"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id78,351,289
net_rshares0