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

Name
Type
Description

api_key

string

Your API key

date

string

Get data from a specific date, default is current day. Format: YYYY-MM-DD

extended

boolean

Get more staking data in the response such as inflation, staking rate, etc

by_key

string

Filters for assets associated with api_key

currencies

array

List of currencies to return, default is all

// 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);
})

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

Name
Type
Description

currency

string

Currency name. Ex: "Decred"

Query Parameters

Name
Type
Description

api_key

string

Your API key

interval

integer

Interval, in days

num_entries

string

Number of entries

date

string

Timeseries start date, default is current day. Format: YYYY-MM-DD

extended

boolean

Get more staking data in the response such as inflation, staking rate, etc

// 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);
})

Last updated