Get oracle state
Latest indexed state of an oracle: quote, onchain update timestamp, and indexed block.
Enterprise API access
For enterprise access, use https://private.api.morpho.org as the base URL and send your API key in the x-api-key header. Request an API key.
Path Parameters
oracle-selector*string
Selector formatted as <chain_id>:<oracle_address>. Example: 1:0x2a01EB9496094dA03c4E364Def50f5aD1280AD72.
Format
<chain_id>:<oracle_address>Response Body
application/json
const baseUrl = process.env.CORE_REST_BASE_URL ?? "https://api.morpho.org";const apiKey = process.env.MORPHO_API_KEY ?? "<MORPHO_API_KEY>";const oracleSelector = "<chain_id>:<oracle_address>";const url = new URL(`${baseUrl}/v0/oracles/${oracleSelector}/state`);const response = await fetch(url, { headers: { accept: "application/json", "x-api-key": apiKey, },});if (!response.ok) throw new Error(await response.text());const body = await response.json();{
"data": {
"last_updated_at": "1717000100",
"oracle_address": "0x2a01EB9496094dA03c4E364Def50f5aD1280AD72",
"chain_id": 1,
"last_indexed_block": "19700042",
"price": "1150750000000000000000000000000000000"
}
}