Introducing SteemData WebAPI by furion

View this thread on steempeak.com
· @furion ·
Introducing SteemData WebAPI
![](https://i.imgur.com/uNyoNRR.jpg)
> SteemData helps developers and researchers build better STEEM applications. We parse the STEEM blockchain for you, and provide the data as a fast and convenient MongoDB service.

SteemData is a very useful tool, however it does require you to have at least some familiarity with MongoDB. Using MongoDB is fairly easy, but it does add a small barrier to entry for some users.

For example:
What if you don't want to include MongoDB driver as a dependency in your project?
What if all you need is just a simple query to enrich your Steem mobile app?

This is where SteemData WebAPI comes into play.

https://vimeo.com/208151012


## Features

### XML and JSON support
The API will return XML or JSON, based on your request headers.
To get json, simply pass `Content-Type: application/json`.

### Simple Querying
We can query for various simple conditions using a `where` field. For example,
we could look up an individual user by username like this:
```
https://webapi.steemdata.com/Accounts?where=name==furion
```

Alternatively, we can also construct more powerful queries by passing in MongoDB
query objects.

For example, lets find all transfers incoming to a specific account (@furion):
```
https://webapi.steemdata.com/Operations?where={"type": "transfer", "to": "furion"}
```

### Sorting
We can sort by using a `sort` field. Prepending field name with `-` changes order from ascending to descending.

For example, we can find latest transfers with this query:
```
https://webapi.steemdata.com/Operations?where=type==transfer&sort=-timestamp
```


### HATEOAS for navigation and pagination
[HATEOAS](https://en.wikipedia.org/wiki/HATEOAS) is a specification for linking to resources. These links can be followed by the client programatically.

For example, `GET https://webapi.steemdata.com/Operations` will contain the following links:
```
{
  "_meta": {
    "page": 1,
    "max_results": 50,
    "total": 34679606
  },
  "_links": {
    "last": {
      "href": "Operations?page=693593",
      "title": "last page"
    },
    "parent": {
      "href": "/",
      "title": "home"
    },
    "next": {
      "href": "Operations?page=2",
      "title": "next page"
    },
    "self": {
      "href": "Operations",
      "title": "Operations"
    }
  },
  "_items": [
    ...
  ]
}
```

We can simply follow the links for pagination, as well as see how many pages there are.

Additionally, each item will also have a link to itself:
```
"_items": [
  {
    "_links": {
        "self": {
          "href": "Operations/e35709a49ee67090905a42cebabf8eee9f0de11d",
          "title": "Operation"
        }
      },
    ...
  }
]
```

## Available Endpoints
WebAPI gives you access to all SteemData MongoDB collections.
https://webapi.steemdata.com/Operations
https://webapi.steemdata.com/AccountOperations
https://webapi.steemdata.com/Accounts
https://webapi.steemdata.com/Posts
https://webapi.steemdata.com/PriceHistory

Feel free to play around with this with `curl` or a GUI tool like `Postman`.



## Need custom functionality for your app?
While WebAPI can work well for most of data fetching related queries, occasionally, a more complex solution is required.

If you need a fast, bandwidth efficient, composite or aggregate query, or custom business logic, feel free to contact me, and I will create you a custom endpoint on Api0.

Api0 is a special API that leverages the power of SteemData and offers custom endpoints for STEEM app developers.

Example Endpoint:
https://api0.steemdata.com/busy.org/furion/with_metadata/followers
👍  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , and 122 others
👎  , , ,
properties (23)
post_id2,139,447
authorfurion
permlinkintroducing-steemdata-webapi
categorysteemdata
json_metadata"{"app": "steemit/0.1", "format": "markdown", "links": ["https://player.vimeo.com/video/208151012", "https://en.wikipedia.org/wiki/HATEOAS", "https://webapi.steemdata.com/Operations", "https://webapi.steemdata.com/AccountOperations", "https://webapi.steemdata.com/Accounts", "https://webapi.steemdata.com/Posts", "https://webapi.steemdata.com/PriceHistory", "https://api0.steemdata.com/busy.org/furion/with_metadata/followers"], "image": ["https://i.imgur.com/uNyoNRR.jpg"], "tags": ["steemdata", "steem", "steemit", "steemdev"]}"
created2017-03-13 17:44:54
last_update2017-03-13 17:44:54
depth0
children12
net_rshares41,058,778,773,433
last_payout2017-04-13 19:13:03
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length3,574
author_reputation116,591,440,117,983
root_title"Introducing SteemData WebAPI"
beneficiaries[]
max_accepted_payout0.000 SBD
percent_steem_dollars10,000
author_curate_reward""
vote details (190)
@jillstein2016 ·
https://i.imgur.com/3Iql50J.png
properties (22)
post_id2,139,453
authorjillstein2016
permlinkre-introducing-steemdata-webapi-20170313t174548
categorysteemdata
json_metadata{}
created2017-03-13 17:46:00
last_update2017-03-13 17:46:00
depth1
children0
net_rshares0
last_payout2017-04-13 19:13:03
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length31
author_reputation-7,413,102,413,009
root_title"Introducing SteemData WebAPI"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
@smooth ·
A downvote was applied to partially counter earlier whale votes as an experiment to reduce whale domination of voting influence. Not intended to express an opinion on the content nor result in a net reduction of rewards or reputation (automated notice)
properties (22)
post_id2,139,539
authorsmooth
permlinkre-furion-introducing-steemdata-webapi-counterbot
categorysteemdata
json_metadata{}
created2017-03-13 17:56:15
last_update2017-03-13 17:56:15
depth1
children0
net_rshares0
last_payout2017-04-13 19:13:03
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length252
author_reputation119,002,354,889,508
root_title"Introducing SteemData WebAPI"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
@raymonjohnstone ·
Props bro :)
properties (22)
post_id2,140,425
authorraymonjohnstone
permlinkre-furion-introducing-steemdata-webapi-20170313t194201046z
categorysteemdata
json_metadata"{"app": "steemit/0.1", "tags": ["steemdata"]}"
created2017-03-13 19:42:00
last_update2017-03-13 19:42:00
depth1
children0
net_rshares0
last_payout2017-04-13 19:13:03
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length12
author_reputation14,125,375,446,227
root_title"Introducing SteemData WebAPI"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
@inertia ·
$0.03
This is really cool, @furion*!!*  Are there any plans to update things like `total_pending_payout_value`?

E.g.:

```
Posts?where={"mode": "first_payout", "total_pending_payout_value.amount": {"$gt": 0}}
```
👍  , , , , , , , ,
properties (23)
post_id2,140,935
authorinertia
permlinkre-furion-introducing-steemdata-webapi-20170313t204214167z
categorysteemdata
json_metadata"{"app": "steemit/0.1", "users": ["furion"], "tags": ["steemdata"]}"
created2017-03-13 20:42:15
last_update2017-03-13 20:42:15
depth1
children2
net_rshares221,138,151,921
last_payout2017-04-13 19:13:03
cashout_time1969-12-31 23:59:59
total_payout_value0.019 SBD
curator_payout_value0.006 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length207
author_reputation227,335,189,892,062
root_title"Introducing SteemData WebAPI"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
author_curate_reward""
vote details (9)
@furion ·
Yes, @good-karma asked me about a similar, but related thing. It will be fixed by 1.3 release.
properties (22)
post_id2,144,718
authorfurion
permlinkre-inertia-re-furion-introducing-steemdata-webapi-20170314t084758273z
categorysteemdata
json_metadata"{"app": "steemit/0.1", "users": ["good-karma"], "tags": ["steemdata"]}"
created2017-03-14 08:47:57
last_update2017-03-14 08:47:57
depth2
children1
net_rshares0
last_payout2017-04-13 19:13:03
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length94
author_reputation116,591,440,117,983
root_title"Introducing SteemData WebAPI"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
@inertia · (edited)
Also seeing a problem with this:

```javascript
db.getCollection('AccountOperations').find({type: 'transfer', to: 'banjo'})
```

I can see one of the expected transaction by @matrixdweller, but not the one right before it by @thedegensloth.  Here's the transaction that's missing:

https://steemd.com/tx/e1b43edc3eff584a1190a7d9056ae58b72f9d1f6
properties (22)
post_id2,232,438
authorinertia
permlinkre-furion-re-inertia-re-furion-introducing-steemdata-webapi-20170323t225645939z
categorysteemdata
json_metadata"{"app": "steemit/0.1", "users": ["matrixdweller", "thedegensloth"], "links": ["https://steemd.com/tx/e1b43edc3eff584a1190a7d9056ae58b72f9d1f6"], "tags": ["steemdata"]}"
created2017-03-23 22:56:45
last_update2017-03-23 22:57:15
depth3
children0
net_rshares0
last_payout2017-04-13 19:13:03
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length344
author_reputation227,335,189,892,062
root_title"Introducing SteemData WebAPI"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
@joele ·
Is there an API to vote? if yes, sample please.
properties (22)
post_id2,143,465
authorjoele
permlinkre-furion-introducing-steemdata-webapi-20170314t034144706z
categorysteemdata
json_metadata"{"app": "steemit/0.1", "tags": ["steemdata"]}"
created2017-03-14 03:41:39
last_update2017-03-14 03:41:39
depth1
children0
net_rshares0
last_payout2017-04-13 19:13:03
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length47
author_reputation2,677,797,783,703
root_title"Introducing SteemData WebAPI"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
@nextgen622 ·
Very cool. Great work @furion on all the tools you're building for Steem.
properties (22)
post_id2,145,530
authornextgen622
permlinkre-furion-introducing-steemdata-webapi-2017314t22191158z
categorysteemdata
json_metadata"{"app": "esteem/1.3.9", "format": "markdown+html", "tags": "steemdata"}"
created2017-03-14 11:19:21
last_update2017-03-14 11:19:21
depth1
children0
net_rshares0
last_payout2017-04-13 19:13:03
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length73
author_reputation134,896,288,259,165
root_title"Introducing SteemData WebAPI"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
@unipsycho ·
Great work on this furion, nice to see, I hope to dive into it sometime, but havne't had a chance yet!
properties (22)
post_id2,147,967
authorunipsycho
permlinkre-furion-introducing-steemdata-webapi-20170314t174157606z
categorysteemdata
json_metadata"{"app": "steemit/0.1", "tags": ["steemdata"]}"
created2017-03-14 17:41:54
last_update2017-03-14 17:41:54
depth1
children0
net_rshares0
last_payout2017-04-13 19:13:03
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length102
author_reputation78,624,076,172,973
root_title"Introducing SteemData WebAPI"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
@xeroc ·
Glad to see you are looking into Flask(API)!
properties (22)
post_id2,148,182
authorxeroc
permlinkre-furion-introducing-steemdata-webapi-20170314t181850335z
categorysteemdata
json_metadata"{"app": "steemit/0.1", "tags": ["steemdata"]}"
created2017-03-14 18:18:51
last_update2017-03-14 18:18:51
depth1
children2
net_rshares0
last_payout2017-04-13 19:13:03
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length44
author_reputation119,919,245,915,690
root_title"Introducing SteemData WebAPI"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
@furion ·
After a bumpy ride with JavaScript frameworks, I am Flask-everything :)
properties (22)
post_id2,148,278
authorfurion
permlinkre-xeroc-re-furion-introducing-steemdata-webapi-20170314t183737020z
categorysteemdata
json_metadata"{"app": "steemit/0.1", "tags": ["steemdata"]}"
created2017-03-14 18:37:36
last_update2017-03-14 18:37:36
depth2
children1
net_rshares0
last_payout2017-04-13 19:13:03
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length71
author_reputation116,591,440,117,983
root_title"Introducing SteemData WebAPI"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
@xeroc ·
If you ever want to see some of Streemian.com's or BitShares.eu's backend, just let me know. Both are FLASK heavy
properties (22)
post_id2,148,284
authorxeroc
permlinkre-furion-re-xeroc-re-furion-introducing-steemdata-webapi-20170314t183854525z
categorysteemdata
json_metadata"{"app": "busy/1.0.0", "tags": ["steemdata"]}"
created2017-03-14 18:38:54
last_update2017-03-14 18:38:54
depth3
children0
net_rshares0
last_payout2017-04-13 19:13:03
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length113
author_reputation119,919,245,915,690
root_title"Introducing SteemData WebAPI"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000