Staked
  • Introduction
  • Staking
    • Yields API
    • Delegations
    • Node Provisioning API
    • Reporting API
  • ETH2
    • Voluntary Exits
    • BLS Withdrawal Changes
  • Resources
    • Public Repos
Powered by GitBook
On this page
  • Get Yields
  • Get Currency Yield Time Series

Was this helpful?

  1. Staking

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.

Request Headers

Name
Type
Description

Api-Key

string

Your API key (preferred method of passing api key is now in headers rather than query params)

Query Parameters

Name
Type
Description

api_key

string

[Deprecated since March '25 (preferred method of passing api key is now in headers rather than query params)]

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';

const api = axios.create({
  baseURL: "https://mainnet.staked.cloud/api",
  timeout: 1000000,
  headers: {
    "Content-Type": "application/json",
    "Api-Key": api_key
  }
});

api.get(`/yields?extended=true&by_key=false`)
  .then(response => {
    console.log(response.data);
  })
  .catch(error => {
    console.error("Error fetching yields:", error);
  });

const api_key = "YOUR API KEY";

let request = {
  url: "https://mainnet.staked.cloud/api/yields?extended=true&by_key=false",
  method: "GET",
  timeout: 0,
  headers: {
    "Content-Type": "application/json",
    "Api-Key": api_key
  }
};

$.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?extended=true&by_key=false`,
  headers: {
    'Content-Type': 'application/json',
    '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();
import Alamofire

let api_key = "YOUR API KEY"

let headers: HTTPHeaders = [
    "Content-Type": "application/json",
    "Api-Key": api_key
]

AF.request("https://mainnet.staked.cloud/api/yields?extended=true&by_key=false", headers: headers).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

Name
Type
Description

currency

string

Currency name. Ex: "Decred"

Request Headers

Name
Type
Description

Api-Key

string

Your API key

Query Parameters

Name
Type
Description

api_key

string

[Deprecated since March '25]

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,
  headers: {
    "Content-Type": "application/json",
    "Api-Key": api_key
  }
});

api.get(`/yields/currency/${currency}/timeseries?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?interval=${interval}&num_entries=${num_entries}&extended=true`,
  method: "GET",
  timeout: 0,
  headers: {
    "Content-Type": "application/json",
    "Api-Key": api_key
  }
};

$.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?interval=${interval}&num_entries=${num_entries}&extended=true`,
  'headers': {
    'Content-Type': 'application/json',
    '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();
import Alamofire

let api_key = 'YOUR API KEY';
let currency = 'CURRENCY NAME';
let interval = 1;
let num_entries = 10;

let headers: HTTPHeaders = [
    "Content-Type": "application/json",
    "Api-Key": api_key
]

AF.request("https://mainnet.staked.cloud/api/yields/currency/\(currency)/timeseries?interval=\(interval)&num_entries=\(num_entries)&extended=true", headers: headers).response { response in
    debugPrint(response)
}

Last updated 1 month ago

Was this helpful?