Reporting API

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

get
Get Simple 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"
}

Balance Object Schema

Field

Description

Type

balance

Staking balance

Number

block

Block of latest snapshot

Number

timestamp

Timestamp at latest snapshot

String

address

Address queried

String

conversion_factor_power

Decimals used in Number values (used to keep precision)

Number

attributes

Extra information depending on the chain

Object

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 Detailed Balance of Address

https://mainnet.staked.cloud/api/reports/:chain/delegator/:address/detailed_balance
Get the detailed balance (summary view of rewards and the staked balance) of an address. The detail param is used to describe the results - "monthly" returns an array of detailed balance objects aggregated by month, "by_period" returns an array of detailed balance objects for each state change (delegation or reward).
Request
Response
Request
Path Parameters
chain
required
string
Chain Name
address
required
string
Address to get detailed balance for
Query Parameters
api_key
optional
string
Your API Key
detail
required
string
"by_period" or "monthly"
Response
200: OK
{
"results": [
{
"timestamp": "2020-08-27T14:12:31.722731",
"block": null,
"total_delegation": 3874585409425.0,
"delegation": 3876252281981.0,
"balance": 3897899084922.0,
"total_reward_and_fees": 23313675497.0,
"reward_and_fees": 23313675497.0,
"total_reward": 23304218223.0,
"reward": 23304218223.0,
"total_fees": 9457274.0,
"fees": 9457274.0,
"total_gross_return": 0.006681130527750926,
"gross_return": 0.006681130527750926,
"annualized_gross_return": 0.016456788919817385,
"block_explorer_url": null,
"kind": null,
"conversion_factor_power": 6,
"currency": "Tezos"
}
],
"page": 1,
"pages": 1,
"per_page": 10,
"total": 1
}

Response Object Schema

Field

Description

Type

results

Array of Detailed Balance Objects

Array

page

Current page of results

Number

pages

Total number of pages

Number

per_page

Results per page

Number

total

Total number of results

Number

Detailed Balance Object Schema

Detailed balance objects are returned for every state change of an account (stake, reward, unstake).

Field

Description

Type

timestamp

Timestamp of snapshot

String

block

Block of snapshot

Number

total_delegation

Total amount delegated

Number

delegation

Delegated amount in state change

Number

balance

Staking balance at snapshot

Number

total_reward_and_fees

Total accumulated reward and fees up to snapshot

Number

reward_and_fees

Reward and fees earned in state change

Number

total_reward

Total accumulated reward up to snapshot

Number

reward

Reward earned in state change

Number

total_fees

Total fees accumulated up to snapshot

Number

fees

Fees in state change

Number

total_gross_return

Total gross return up to snapshot

Number

gross_return

Gross return from state change

Number

annualized_gross_return

Annualized gross return

Number

block_explorer_url

Block Explorer URL for state change

String

kind

Kind of state change ("Delegation" or "Reward")

String

conversion_factor_power

Decimals used in Number values (used to keep precision)

Number

currency

Name of currency

String

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 Object Schema

Field

Description

Type

id

Transaction identifier

String

kind

Kind of transaction

Transaction Kind Enum

transaction_time

Timestamp of transaction

String

transaction_address

Hash or identifier of transaction on blockchain

String

holding_address

Address queried

String

Amount

Amount of value in transaction

Number

Reward

Reward in transaction

Number

Fees

Fees in transaction

Number

Total

Net value in transaction

Number

conversion_factor_power

Decimals used in Number values (used to keep precision)

Number

denom

Denomination

Number

block_reference

Block the transaction was included in

Number

Transaction Kind Enum

Value

Meaning

STK

Delegation Transactions

UNSTK

Undelegation Transactions

SCH

Scheduled Future Rewards

PEND

Rewards in Frozen Period

PYBL

Rewards Pending Distribution

PAID

Paid Rewards