Steem API/converter (SBD, STEEM, VESTS)


We have so many concepts in STEEMIT namely: SBD, STEEM, STEEM POWER (SP) and VESTS. There are conversions between them. For instances:

  • How much SBD can we get per STEEM?
  • How much STEEM per SBD?
  • 1 SP = ? VESTS
  • 1M VESTS = ? STEEM
  • 1 VESTS = ? STEEM POWER
  • What is the current median price of SBD?

I have added an handy API to fetch all these data, which now is deployed to four API servers world wide:

East USA:https://helloacm.com/api/steemit/converter/?cached
West USA:https://steakovercooked.com/api/steemit/converter/?cached
London, UK:https://uploadbeta.com/api/steemit/converter/?cached
Tokyo, Japan:https://happyukgo.com/api/steemit/converter/?cached

An example to invoke the API on the Linux Bash:

1
curl -s -X GET "https://helloacm.com/api/steemit/converter/?cached"
curl -s -X GET "https://helloacm.com/api/steemit/converter/?cached"

That returns the JSON key-pairs:

{
"steem_to_sbd": 1.084,
"sbd_to_steem": 0.9225092250922509, 
"sp_to_vests": 2059.117814239809, 
"steem_per_mvests": 485.64486844050873, 
"vests_to_sp": 0.0004856448684405087, 
"sbd_median_price": 1.084
}

The results are cached and updated every hour. Using our favorite programming language PHP, this can be pretty easy to use:

1
2
$converter = json_decode(file_get_contents("https://helloacm.com/api/steemit/converter/?cached"), true);
echo "1 STEEM = ". $converter['steem_to_sbd']. " SBD";
$converter = json_decode(file_get_contents("https://helloacm.com/api/steemit/converter/?cached"), true);
echo "1 STEEM = ". $converter['steem_to_sbd']. " SBD";

Update: the ticker (internal market price) is also contained in the latest API.

{"sbd_to_steem": 0.29282576866764276, "steem_to_sbd": 3.415, "ticker": {"sbd_volume": "4565.642 SBD", "steem_volume": "4735.916 STEEM", "latest": "0.97290322580645161", "highest_bid": "0.97227083576401041", "percent_change": "1.10562934851359773", "lowest_ask": "0.97227911674756606"}, "steem_per_mvests": 489.6342091988457, "sp_to_vests": 2042.3409582357358, "vests_to_sp": 0.0004896342091988457, "sbd_median_price": 3.415}

that adds the key ticker (steem.get_ticker()):

"ticker":{  
      "sbd_volume":"4565.642 SBD",
      "steem_volume":"4735.916 STEEM",
      "latest":"0.97290322580645161",
      "highest_bid":"0.97227083576401041",
      "percent_change":"1.10562934851359773",
      "lowest_ask":"0.97227911674756606"
   },

where the price is the ratio between STEEM and SBD. For example, in above example, the highest bid is 1 STEEM = 0.9722 SBD (Steem Dollars).

You may also like: STEEM API 系列之获取货币转换

–EOF (The Ultimate Computing & Technology Blog) —

GD Star Rating
loading...
421 words
Last Post: SteemIt: Quick Way to Check if You Are a Minnow or Whale
Next Post: Monte Carlo solution for Mathematics × Programming Competition #7

The Permanent URL is: Steem API/converter (SBD, STEEM, VESTS)

Leave a Reply