Yields API

Pull current and historical yield data for all assets supported by our infrastructure.

get
Get Yields

https://mainnet.staked.cloud/api/yields
This endpoint allows you to get staking data for all currencies.
Request
Response
Query Parameters
api_key
required
string
Your API key
date
optional
string
Get data from a specific date, default is current day. Format: YYYY-MM-DD
extended
optional
boolean
Get more staking data in the response such as inflation, staking rate, etc
by_key
optional
string
Filters for assets associated with api_key
currencies
optional
array
List of currencies to return, default is all
200: OK
Data successfully retrieved.
// With 'extended' set to false
[
...
{
"currency": "Cosmos",
"yield": "0.09647",
"timestamp": "2019-09-03T12:00:06.559048",
},
{
"currency": "Tezos",
"yield": "0.07155",
"timestamp": "2019-09-03T12:00:48.148923",
}
...
]
// With 'extended' set to true
[
...
{
"currency": "Cosmos",
"yield": "0.09647",
"timestamp": "2019-09-03T12:00:06.559048",
"total_supply": 243828455907213,
"circulating_supply": 243828455907213,
"staked_supply": 177578277871531,
"staking_rate": "0.728290",
"inflation": "0.070256",
"inflation_total": "0.070256"
},
{
"currency": "Tezos",
"yield": "0.07155",
"timestamp": "2019-09-03T12:00:48.148923",
"total_supply": 806071727,
"circulating_supply": 806071727,
"staked_supply": 567656000,
"staking_rate": "0.704220",
"inflation": "0.050389",
"inflation_total": "0.050389"
}
...
]
React w/ Axios
jQuery
Node.js
Swift
import axios from "axios";
const api_key = 'YOUR API KEY';
var api = axios.create({
baseURL: "https://mainnet.staked.cloud/api",
timeout: 1000000
});
api.defaults.headers.post["Content-Type"] = "application/json";
api.get(`/yields?api_key=${api_key}&extended=true&by_key=false`).then(response => {
console.log(res);
})
const api_key = 'YOUR API KEY';
var request = {
"url": `https://mainnet.staked.cloud/api/yields?api_key=${api_key}&extended=true&by_key=false`,
"method": "GET",
"timeout": 0,
};
$.ajax(request).done(function (response) {
console.log(response);
});
svar http = require('http');
const api_key = 'YOUR API KEY';
var options = {
'method': 'GET',
'hostname': 'mainnet.staked.cloud',
'path': `/api/yields?api_key=${api_key}&extended=true&by_key=false`
};
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();
import Alamofire
let api_key = 'YOUR API KEY';
AF.request("https://mainnet.staked.cloud/api/yields?api_key=\(api_key)&extended=true&by_key=false").response { response in
debugPrint(response)
}

get
Get Currency Yield Timeseries

https://mainnet.staked.cloud/api/yields/currency/:currency/timeseries
This endpoint allows you to get a timeseries of staking data for a specific currency.
Request
Response
Path Parameters
currency
required
string
Currency name. Ex: "Decred"
Query Parameters
api_key
required
string
Your API key
interval
required
integer
Interval, in days
num_entries
required
string
Number of entries
date
optional
string
Timeseries start date, default is current day. Format: YYYY-MM-DD
extended
optional
boolean
Get more staking data in the response such as inflation, staking rate, etc
200: OK
// With 'extended' set to false
{
"timeseries": [
...
{
"currency": "Decred",
"yield": "0.09693",
"timestamp": "2019-09-03T12:00:48.864127"
},
{
"currency": "Decred",
"yield": "0.09663",
"timestamp": "2019-09-02T12:01:00.440379"
}
...
],
"missed": [
...
"2019-09-04",
...
]
}
// with 'extended' set to true
{
"timeseries": [
...
{
"currency": "Decred",
"yield": "0.09674",
"timestamp": "2019-09-05T12:00:27.535454",
"total_supply": 10340411,
"circulating_supply": 10340411,
"staked_supply": 5209150,
"staking_rate": "0.503770",
"inflation": "0.051799",
"inflation_total": "0.172663"
},
{
"currency": "Decred",
"yield": "0.09693",
"timestamp": "2019-09-03T12:00:48.864127",
"total_supply": 10330414,
"circulating_supply": 10330414,
"staked_supply": 5198821,
"staking_rate": "0.503250",
"inflation": "0.051847",
"inflation_total": "0.172822"
}
...
],
"missed": [
...
"2019-08-29",
...
]
}
React w/ Axios
jQuery
Node.js
Swift
import axios from "axios";
const api_key = 'YOUR API KEY';
const currency = 'CURRENCY NAME';
const interval = 1;
const num_entries = 10;
var api = axios.create({
baseURL: "https://mainnet.staked.cloud/api",
timeout: 1000000
});
api.defaults.headers.post["Content-Type"] = "application/json";
api.get(`/yields/currency/${currency}/timeseries?api_key=${api_key}&interval=${interval}&num_entries=${num_entries}&extended=true`).then(response => {
console.log(res);
})
const api_key = 'YOUR API KEY';
const currency = 'CURRENCY NAME';
const interval = 1;
const num_entries = 10;
var request = {
"url": `https://mainnet.staked.cloud/api/yields/currency/${currency}/timeseries?api_key=${api_key}&interval=${interval}&num_entries=${num_entries}&extended=true`,
"method": "GET",
"timeout": 0,
};
$.ajax(request).done(function (response) {
console.log(response);
});
var http = require('http');
const api_key = 'YOUR API KEY';
const currency = 'CURRENCY NAME';
const interval = 1;
const num_entries = 10;
var options = {
'method': 'GET',
'hostname': 'mainnet.staked.cloud',
'path': `/api/yields/currency/${currency}/timeseries?api_key=${api_key}&interval=${interval}&num_entries=${num_entries}&extended=true`
};
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();
import Alamofire
let api_key = 'YOUR API KEY';
let currency = 'CURRENCY NAME';
let interval = 1;
let num_entries = 10;
AF.request("https://mainnet.staked.cloud/api/yields/currency/\(currency)/timeseries?api_key=\(api_key)&interval=\(interval)&num_entries=\(num_entries)&extended=true").response { response in
debugPrint(response)
}