API
The app's server function reads Ethereum mainnet and returns the raw numbers behind the dashboard as one JSON document. It is free and needs a SkillSafe app token for this app. Prices, risk notes and APYs are derived in the page from these values; the rules are under “How it works” in the app.
1. Get a token
Exchange your SkillSafe API key for an app token (valid 30 days). Guest tokens are refused.
curl -s -X POST https://api.skillsafe.ai/v1/app-api/authorize \
-H "Authorization: Bearer YOUR_SKILLSAFE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"slug":"defi-yield-radar"}'
# -> {"ok":true,"data":{"token":"aut_...","expires_at":"..."}}
import requests
r = requests.post("https://api.skillsafe.ai/v1/app-api/authorize",
headers={"Authorization": "Bearer YOUR_SKILLSAFE_API_KEY"},
json={"slug": "defi-yield-radar"})
token = r.json()["data"]["token"]
const r = await fetch("https://api.skillsafe.ai/v1/app-api/authorize", {
method: "POST",
headers: { Authorization: "Bearer YOUR_SKILLSAFE_API_KEY", "Content-Type": "application/json" },
body: JSON.stringify({ slug: "defi-yield-radar" }),
});
const token = (await r.json()).data.token;
2. Fetch a snapshot
GET https://defi-yield-radar.skillsafe.ai/api/snapshot — takes about 1 to 5 seconds.
blocks:now,d1,d7,d30, each{number, ts}(Unix seconds). Every series below has the same four keys; a value isnullwhen that block could not be read.tokens[]:{sym, addr, dec, supply}, Ethereum total supply in whole tokens.quotes[]:{sym, kind, venue, into, out}.out["10000"]andout["1000000"]are the tokens ofinto(USDC or USDT) a sale of that manysymreturns.kindiscurve,curveUoruni; the $1M quote is read at the latest block only.lending[]:{protocol, sym, market, kind, supplyApr, borrowApr, supplied, borrowed}. Rates are APR fractions; the page compounds them per second (APY = eAPR − 1).vaults[]:{sym, name, asset, addr, pps, totalAssets}.ppsis assets per share; realized APY = (ppsnow / ppsthen)year / elapsed − 1.errors[]: strings for any block or node that failed;sourcenames the nodes;fetched_atis ISO time.
curl -s https://defi-yield-radar.skillsafe.ai/api/snapshot \ -H "Authorization: Bearer YOUR_APP_TOKEN"
snap = requests.get("https://defi-yield-radar.skillsafe.ai/api/snapshot",
headers={"Authorization": "Bearer " + token}).json()
usdt = next(t for t in snap["tokens"] if t["sym"] == "USDT")
print(usdt["supply"]["now"] / usdt["supply"]["d7"] - 1) # 7-day supply change
const snap = await (await fetch("https://defi-yield-radar.skillsafe.ai/api/snapshot",
{ headers: { Authorization: "Bearer " + token } })).json();
const aave = snap.lending.filter((m) => m.protocol === "Aave v3");
console.log(aave.map((m) => [m.sym, Math.exp(m.supplyApr.now) - 1]));
An example response is bundled with the app: example-snapshot.json.
Errors
| Status | Meaning |
|---|---|
| 401 | No token, a guest token, or an expired token |
| 405 | Only GET is accepted |
| 502 | rpc_unreachable or rpc_failed: no public Ethereum node answered |
Errors come back as {"error":{"code","message"}}. Read-only: the function never signs or sends a transaction and stores nothing. Not financial advice.