Get token price
Canonical spot price of an ERC-20 token in USD, sourced from hourly price feeds.
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
token-selector*string
Selector formatted as <chain_id>:. Example: 8453:0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913.
Format
<chain_id>:<address>Response Body
application/json
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 tokenSelector = "<chain_id>:<address>";const url = new URL(`${baseUrl}/v0/tokens/${tokenSelector}/price`);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": {
"chain_id": 1,
"address": "string",
"price": 0,
"timestamp": "string",
"provider": "string"
}
}{
"data": {
"chain_id": 1,
"address": "string",
"price": 0,
"timestamp": "string",
"provider": "string"
}
}Empty