Staked
Search…
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
1
import axios from "axios";
2
3
const api_key = 'YOUR API KEY';
4
5
var api = axios.create({
6
baseURL: "https://mainnet.staked.cloud/api",
7
timeout: 1000000
8
});
9
10
api.defaults.headers.post["Content-Type"] = "application/json";
11
12
api.get(`/yields?api_key=${api_key}&extended=true&by_key=false`).then(response => {
13
console.log(res);
14
})
Copied!
1
const api_key = 'YOUR API KEY';
2
3
var request = {
4
"url": `https://mainnet.staked.cloud/api/yields?api_key=${api_key}&extended=true&by_key=false`,
5
"method": "GET",
6
"timeout": 0,
7
};
8
9
$.ajax(request).done(function (response) {
10
console.log(response);
11
});
Copied!
1
var http = require('http');
2
3
const api_key = 'YOUR API KEY';
4
5
var options = {
6
'method': 'GET',
7
'hostname': 'mainnet.staked.cloud',
8
'path': `/api/yields?api_key=${api_key}&extended=true&by_key=false`
9
};
10
11
var req = http.request(options, function (res) {
12
var chunks = [];
13
14
res.on("data", function (chunk) {
15
chunks.push(chunk);
16
});
17
18
res.on("end", function (chunk) {
19
var body = Buffer.concat(chunks);
20
console.log(body.toString());
21
});
22
23
res.on("error", function (error) {
24
console.error(error);
25
});
26
});
27
28
req.end();
Copied!
1
import Alamofire
2
3
let api_key = 'YOUR API KEY';
4
5
AF.request("https://mainnet.staked.cloud/api/yields?api_key=\(api_key)&extended=true&by_key=false").response { response in
6
debugPrint(response)
7
}
Copied!
get
https://mainnet.staked.cloud/api
/yields/currency/:currency/timeseries
Get Currency Yield Time Series
React w/ Axios
jQuery
Node.js
Swift
1
import axios from "axios";
2
3
const api_key = 'YOUR API KEY';
4
const currency = 'CURRENCY NAME';
5
const interval = 1;
6
const num_entries = 10;
7
8
var api = axios.create({
9
baseURL: "https://mainnet.staked.cloud/api",
10
timeout: 1000000
11
});
12
13
api.defaults.headers.post["Content-Type"] = "application/json";
14
15
api.get(`/yields/currency/${currency}/timeseries?api_key=${api_key}&interval=${interval}&num_entries=${num_entries}&extended=true`).then(response => {
16
console.log(res);
17
})
Copied!
1
const api_key = 'YOUR API KEY';
2
const currency = 'CURRENCY NAME';
3
const interval = 1;
4
const num_entries = 10;
5
6
var request = {
7
"url": `https://mainnet.staked.cloud/api/yields/currency/${currency}/timeseries?api_key=${api_key}&interval=${interval}&num_entries=${num_entries}&extended=true`,
8
"method": "GET",
9
"timeout": 0,
10
};
11
12
$.ajax(request).done(function (response) {
13
console.log(response);
14
});
Copied!
1
var http = require('http');
2
3
const api_key = 'YOUR API KEY';
4
const currency = 'CURRENCY NAME';
5
const interval = 1;
6
const num_entries = 10;
7
8
var options = {
9
'method': 'GET',
10
'hostname': 'mainnet.staked.cloud',
11
'path': `/api/yields/currency/${currency}/timeseries?api_key=${api_key}&interval=${interval}&num_entries=${num_entries}&extended=true`
12
};
13
14
var req = http.request(options, function (res) {
15
var chunks = [];
16
17
res.on("data", function (chunk) {
18
chunks.push(chunk);
19
});
20
21
res.on("end", function (chunk) {
22
var body = Buffer.concat(chunks);
23
console.log(body.toString());
24
});
25
26
res.on("error", function (error) {
27
console.error(error);
28
});
29
});
30
31
req.end();
Copied!
1
import Alamofire
2
3
let api_key = 'YOUR API KEY';
4
let currency = 'CURRENCY NAME';
5
let interval = 1;
6
let num_entries = 10;
7
8
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
9
debugPrint(response)
10
}
Copied!
Last modified 1yr ago