/oracle Endpoints
Base URL: /oracle
Available Endpoints
/delphi/<token>/history?<start>&<end>&<stepsize>
Endpoint: GET /delphi/<token>/history
Status: Unstable
Description: Get historical oracle prices for a given token.
- token: The 32 byte token ID of the oracle contract. Known oracle contract IDs:
- BCH/USD:
d0d46f5cbd82188acede0d3e49c75700c19cb8331a30101f0bb6a260066ac972 - start: Unix timestamp for start of period
- end: Unix timestamp for end of period (optional, defaults to now)
- stepsize: Seconds per interval (optional)
Important: oracle_price values are in cents. Divide by 100 to convert to USD.
Response Example:
[
{ "time": 1709468902, "price": 64320, "txid": "...", "blockhash": "...", "sequence": 12345 },
{ "time": 1709555302, "price": 65100, "txid": "...", "blockhash": "...", "sequence": 12346 }
]
price values of 64320 cents = $643.20 USD.
Example URI: /delphi/b79bfc8246b5fc4707e7c7dedcb6619ef1ab91f494a790c20b0f4c422ed95b92/history
/delphi/closest?<token_id>&<timestamp>
Endpoint: GET /delphi/closest
Status: Stable
Description: Get the closest oracle price for a given token and timestamp.
- token_id: The 32 byte token ID of the oracle contract. Known oracle contract IDs:
- BCH/USD:
d0d46f5cbd82188acede0d3e49c75700c19cb8331a30101f0bb6a260066ac972 - timestamp: Unix timestamp (optional, defaults to now)
Returns null if no oracle data is found.
Important: oracle_price is returned in cents (not dollars). Divide by 100
to get the price in USD:
price_usd = oracle_price / 100
Response Example:
{
"oracle_timestamp": 1709468902,
"oracle_price": 64320,
"oracle_sequence": 12345,
"token_id": "d0d46f5cbd82188acede0d3e49c75700c19cb8331a30101f0bb6a260066ac972",
"txid": "...",
"blockhash": "..."
}
oracle_price of 64320 cents = $643.20 USD.
Example URI: /delphi/closest