REST API
Reads CommodityOracle on BOT Testnet via eth_call. No API key. Hosted REST currently serves the live app oracle; on-chain reads use the network selected in the header.
Base: https://botchain-commodity-oracle.vercel.app
Latest price is one value per asset. Use /history for shared PriceUpdated series (default 2h).
Endpoints
| Method | Path | Notes |
|---|---|---|
GET | /api/prices | Fresh within window (default 7200) |
GET | /api/prices/:asset | Ticker, feed_id, or assetId |
GET | /api/prices/:asset/history | On-chain logs; window=0 = full lookback |
GET | /api/feeds | Catalog (+ ?fresh=1 = prices filter) |
GET | /api/digital-assets | Digital asset catalog / prices |
Examples
curl https://botchain-commodity-oracle.vercel.app/api/prices
curl "https://botchain-commodity-oracle.vercel.app/api/prices?family=ENERGY&q=wti"
curl https://botchain-commodity-oracle.vercel.app/api/prices/WTI-USD
curl "https://botchain-commodity-oracle.vercel.app/api/prices/WTI-USD/history?window=7200"
Query params (/api/prices)
| Param | Default | Description |
|---|---|---|
window / maxAge | 7200 | Max age (seconds), cap 24h |
family | — | ENERGY, METALS, FX, TREASURY, CRYPTO, INDICES, EQUITIES |
q | — | Search title / feed_id / assetId |
Status codes (/:asset)
| Status | Meaning |
|---|---|
200 | Fresh within window |
404 | Unknown asset |
409 | Missing or older than window |
Prices: amount is 18-decimal string; value is human USD. Keep feeds fresh via the update pipeline.