Staked
Search…
⌃K

Yields API

Pull current and historical yield data for all assets supported by our infrastructure.
get
https://mainnet.staked.cloud/api
/yields
Get Yields
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);
});
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
https://mainnet.staked.cloud/api
/yields/currency/:currency/timeseries
Get Currency Yield Time Series
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)
}