Reporting API

Everyone loves seeing the additional crypto they are earning. Staked provides an API for full access to the details.

get
Get Balance Of Address

https://mainnet.staked.cloud/api/reports/:chain/delegator/:address/balance
Get the balance of an address that has delegated to Staked.
Request
Response
Request
Path Parameters
chain
required
string
Chain Name
address
required
string
Address to get balance for
Query Parameters
api_key
required
string
Your API key
Response
200: OK
// Simple Balance Response:
{
"balance": 5000000,
"timestamp": "2019-07-08T17:09:08.753866",
"address": "KT1W4Rda7pHrqmbDk4xDZ97YpgqAVHE5hndr"
}
// Filter by Transaction Kind:
[
...
{
"id": 149085,
"kind": "PAID",
"transaction_time": "2019-06-05T21:17:06",
"transaction_address": "4CA0DE34960577F5ED8D75CB573322FD5FD1A9F02ADEA9CDFB8C0C8F0DC90492",
"holding_address": "KT1W4Rda7pHrqmbDk4xDZ97YpgqAVHE5hndr",
"amount": null,
"reward": 193873,
"fees": 100,
"total": 193973,
"denom": null,
"block_reference": 554796
},
{
"id": 149086,
"kind": "PAID",
"transaction_time": "2019-05-15T05:19:51",
"transaction_address": "3471B104CC9A5FAF5CBF6441412D9E1E5108DE28CBB913E7E8440BBC842C8542",
"holding_address": "KT1W4Rda7pHrqmbDk4xDZ97YpgqAVHE5hndr",
"amount": null,
"reward": 109348,
"fees": 0,
"total": 109348,
"denom": null,
"block_reference": 283855
},
...
]
React w/ Axios
jQuery
Node.js
Swift
React w/ Axios
import axios from "axios";
const api_key = 'YOUR API KEY';
const chain = 'TEZOS';
const address = 'KT1W4Rda7pHrqmbDk4xDZ97YpgqAVHE5hndr';
var api = axios.create({
baseURL: "https://mainnet.staked.cloud/api",
timeout: 1000000
});
api.defaults.headers.post["Content-Type"] = "application/json";
api.get(`/reports/${chain}/delegator/${address}/balance?api_key=${api_key}`).then(response => {
console.log(res);
})
jQuery
const api_key = 'YOUR API KEY';
const chain = 'TEZOS';
const address = 'KT1W4Rda7pHrqmbDk4xDZ97YpgqAVHE5hndr';
var request = {
"url": `https://mainnet.staked.cloud/api/reports/${chain}/delegator/${address}/balance?api_key=${api_key}`,
"method": "GET",
"timeout": 0,
};
$.ajax(request).done(function (response) {
console.log(response);
});
Node.js
var http = require('http');
const api_key = 'YOUR API KEY';
const chain = 'TEZOS';
const address = 'KT1W4Rda7pHrqmbDk4xDZ97YpgqAVHE5hndr';
var options = {
'method': 'GET',
'hostname': 'mainnet.staked.cloud',
'path': `/api/reports/${chain}/delegator/${address}/balance?api_key=${api_key}`
};
var req = http.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function (chunk) {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
res.on("error", function (error) {
console.error(error);
});
});
req.end();
Swift
import Alamofire
let api_key = 'YOUR API KEY';
let chain = 'TEZOS';
let address = 'KT1W4Rda7pHrqmbDk4xDZ97YpgqAVHE5hndr';
AF.request("https://mainnet.staked.cloud/api/reports/\(chain)/delegator/\(address)/balance?api_key=\(api_key)").response { response in
debugPrint(response)
}

get
Get Transactions and Rewards of Address

https://mainnet.staked.cloud/api/reports/:chain/delegator/:address/txns
Get the transactions and rewards for an address that has delegated to Staked. Use the kind parameter to specify which transactions and rewards to query.
Request
Response
Request
Path Parameters
chain
required
string
Chain Name
address
required
string
Address to get transaction data for
Query Parameters
api_key
required
string
Your API Key
kind
optional
string
Transaction kind
start
optional
string
Start date. Format: YYYY-MM-DD
end
optional
string
End date. Format: YYYY-MM-DD
Response
200: OK
[
{
"id": id,
"kind": Transaction Kind,
"transaction_time": Transaction Time,
"transaction_address": Transaction Address,
"holding_address": Holding Address,
"amount": Amount,
"reward": Reward,
"fees": Fees,
"total": Total,
"denom": Denomination,
"block_reference": Block Reference
}
]

Transaction Kind Enum

Meaning

STK

Delegation Transactions

UNSTK

Undelegation Transactions

SCH

Scheduled Future Rewards

PEND

Rewards in Frozen Period

PYBL

Rewards Pending Distribution

PAID

Paid Rewards