Yields API
Pull current and historical yield data for all assets supported by our infrastructure.
Get Yields
GET
https://mainnet.staked.cloud/api/yields
Get yield information for assets.
Query Parameters
// 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"
}
...
]
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);
});
var 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 Currency Yield Time Series
GET
https://mainnet.staked.cloud/api/yields/currency/:currency/timeseries
Get yield information for assets as a time series.
Path Parameters
Query Parameters
// 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",
...
]
}
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)
}
Last updated