Skip to Content
OraclesAPIs - Real Time & HistoricalREST API

Rest API

Rest API enables users to request the latest price update for multiple data pairs or historical prices up to 1 month for a single data pair. We will enable historical data going back up to 6 months in the near future.
History data response will contain OHLC data (Open price, High price, Low price, Close price) for the requested time resolution which will facilitate building candlestick charts.

Important: Please make sure you read and understand Terms of Use  before start using Supra products and services.


Base URL

https://prod-kline-rest.supra.com/history

Endpoint: Get Historical Price Data for Trading Pair

Request URL

GET/history


Headers

HeaderValue
x-api-keyYour Key ( Please request your key here )

Query Parameters

ParameterTypeDescriptionExample
trading_pairStringThe trading pair for which to retrieve historical data. Example: btc_usd, eth_usd, etc.btc_usd
startDateIntegerThe starting timestamp for the data range in Unix milliseconds (UTC). This determines the beginning of the data range.1732014893723
endDateIntegerThe ending timestamp for the data range in Unix milliseconds (UTC). This determines the end of the data range.1732014910000
ResolutionIntegerThe time interval between data points in seconds. Typical intervals could be 15, 30, 60, 3600(1 hour)86400 ( for 24H resolution)

Example Request

GET https://prod-kline-rest.supra.com/history? trading_pair=btc_usd&startDate=1732014893723&endDate=1732014910000&int erval=5

Response

The response contains historical price data for the given trading pair in the specified time range and interval. The response is typically in JSON format.

{ "status": "success", "data": [ { "timestamp": 1732014893723, "open": 20000.5, "high": 20100.0, "low": 19950.0, "close": 20050.0, "volume": 15.2 }, { "timestamp": 1732014898723, "open": 20050.0, "high": 20150.0, "low": 20000.0, "close": 20100.0, "volume": 18.1 }, ... ] }

Endpoint: Get Latest Price Data for Trading Pair

Request URL

GET /latest


Parameters

ParameterTypeDescriptionExample
trading_pairStringThe trading pair for which to retrieve latest price databtc_usdt



Example Request

GET https://prod-kline-rest.supra.com/latest?trading_pair=btc_usdt

Response

{ "currentPage": 1, "totalPages": 1, "totalRecords": 1, "pageSize": 10, "instruments": [ { "time": "1732175999048", "timestamp": "2024-11-21 07:59:59", "currentPrice": "96913.07250000001", "24h_high": "97849.9", "24h_low": "92720", "24h_change": "5.5326790336496980", "tradingPairs": "btc_usdt" } ] }


Status Codes

  • 200 OK: The request was successful, and data is returned.
  • 400 Bad Request: The request was invalid or improperly formatted.
  • 404 Not Found: The requested trading pair or data could not be found.
  • 500 Internal Server Error: A server error occurred while processing the request.
Last updated on