How to Get Transfer History of SteemIt Accounts via SteemIt API/transfer-history?


SteemIt API/transfer-history is made available to public, free of charge, on four API servers world wide.

Let’s have a quick look on how to use this API:

1
curl -X POST -d "id=justyy" https://uploadbeta.com/api/steemit/transfer-history/
curl -X POST -d "id=justyy" https://uploadbeta.com/api/steemit/transfer-history/

It will soon returns a JSON-encoded string, with a first few lines that look like this:

[{"time":"8\/14\/2017, 6:37:15 PM",
"time_desc":"1 hour ago",
"transaction":"Claim rewards: 8.203 SBD and 6.842 STEEM POWER",
"memo":""},
{"time":"8\/14\/2017, 6:00:12 PM",
"time_desc":"2 hours ago",
"transaction":"Claim rewards: 0.052 STEEM POWER",
"memo":""},... ...

And, here is how you use it in your production code.

1
2
3
4
5
6
7
8
$id = 'justyy';
$tx = json_decode(file_get_contents("https://uploadbeta.com/api/steemit/transfer-history/?id=" . $id), true);
foreach ($tx as $r) {
  echo $r['time'];
  echo $r['time_desc'];
  echo $r['memo'];
  echo $r['transaction'];
}
$id = 'justyy';
$tx = json_decode(file_get_contents("https://uploadbeta.com/api/steemit/transfer-history/?id=" . $id), true);
foreach ($tx as $r) {
  echo $r['time'];
  echo $r['time_desc'];
  echo $r['memo'];
  echo $r['transaction'];
}

SteemIt API/transfer-history Servers

Like the API/steemit/account API, Four servers can also be chosen depending on your locations:

  • (East USA):https://helloacm.com/api/steemit/transfer-history/
  • (West USA):https://steakovercooked.com/api/steemit/transfer-history/
  • (Tokyo Japan):https://happyukgo.com/api/steemit/transfer-history/
  • (London, UK):https://uploadbeta.com/api/steemit/transfer-history/

Using CloudFlare CDN Edge Servers

You could also use CloudFlare CDN Edge server to speed up the API requests by caching it on the edge servers, you need to use it like this:

/api/steemit/transfer-history/?cached&id=justyy

How it works?

The following shows how easy it is to grab the page directly using phpQuery.

compress.zlib://https://steemit.com/@$id/transfers

Full PHP Source Code:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// https://helloacm.com/how-to-get-transfer-history-of-steemit-accounts-via-steemit-apitransfer-history/
  $id = $_GET['id'] ?? (($_POST['id']) ?? '');
  require_once('phpQuery.php');
  function getTransfer($id) {
    $doc = phpQuery::newDocumentFile("compress.zlib://https://steemit.com/@$id/transfers");
    $arr = array();
    foreach(pq('tr.Trans') as $p) {
      $tx = array();
      $x = pq($p);
      $tx['time'] = $x->find('td:first>span')->attr('title');
      $tx['time_desc'] = trim(strip_tags($x->find('td:first')->html()));
      $tx['transaction'] = trim(strip_tags($x->find('td:eq(1)')->html()));
      $tx['memo'] = trim(strip_tags($x->find('td:eq(2)')->html()));
      $arr[] = $tx;             
    }
    return $arr;
  }
  $data = getTransfer($id);
  header("Access-Control-Allow-Origin: *");
  header('Content-Type: application/json');
  die(json_encode($data));
// https://helloacm.com/how-to-get-transfer-history-of-steemit-accounts-via-steemit-apitransfer-history/
  $id = $_GET['id'] ?? (($_POST['id']) ?? '');
  require_once('phpQuery.php');
  function getTransfer($id) {
    $doc = phpQuery::newDocumentFile("compress.zlib://https://steemit.com/@$id/transfers");
    $arr = array();
    foreach(pq('tr.Trans') as $p) {
      $tx = array();
      $x = pq($p);
      $tx['time'] = $x->find('td:first>span')->attr('title');
      $tx['time_desc'] = trim(strip_tags($x->find('td:first')->html()));
      $tx['transaction'] = trim(strip_tags($x->find('td:eq(1)')->html()));
      $tx['memo'] = trim(strip_tags($x->find('td:eq(2)')->html()));
      $arr[] = $tx;             
    }
    return $arr;
  }
  $data = getTransfer($id);
  header("Access-Control-Allow-Origin: *");
  header('Content-Type: application/json');
  die(json_encode($data));

You may also like: SteemIt API/transfer-history 最简单获取帐号钱包记录的API

–EOF (The Ultimate Computing & Technology Blog) —

GD Star Rating
loading...
489 words
Last Post: How to Retrieve SteemIt Account Information via API steemit/account?
Next Post: How to Use Steem API/transfer-history and IFTTT to sync to Slack?

The Permanent URL is: How to Get Transfer History of SteemIt Accounts via SteemIt API/transfer-history?

Leave a Reply