Provides historical OHLCV (Open, High, Low, Close, Volume) data for Spot market trading pairs, enabling analysis of price movements and trading volumes over time across supported exchanges.

get/spot/ohlcv/{instrument}

Request

  • Base URL
    https://api.amberdata.com/markets
  • URL
    https://api.amberdata.com/markets/spot/ohlcv/{instrument}
  • Auth
    API key in header x-api-key

Path parameters

instrumentstring required

The market pair for which to retrieve open-high-low-close.

Query parameters

exchangestring required

The exchange(s) for which to retrieve OHLCV. Example: exchange=bitfinex,bitstamp

startDatestring date-time

[Optional] Payload only includes data after this date (inclusive). [Formats] seconds | milliseconds | iso8601 [Examples] 1578531600 | 1578531600000 | 2020-09-01T01:00:00

endDatestring date-time

[Optional] Payload only includes data before this date (exclusive). [Formats] seconds | milliseconds | iso8601 [Examples] 1578531600 | 1578531600000 | 2020-09-01T01:00:00

timeIntervalstring

[Optional] Time interval. [Defaults] minutes | hours | days*

timeFormatstring

[Optional] Time format of the timestamps in the return payload. [Defaults] milliseconds | ms* | iso | iso8601 | hr | human_readable

sortDirectionstring

[Optional] Specifies the direction in which the data is sorted (by timestamp). [Defaults] asc (ascending order). [Usage Conditions] This parameter can only be used if the startDate and endDate timeframe is within the most recent 24 hours, or if the startDate and endDate parameters are not used at all. [Examples] ascending | descending | asc | desc

Headers

Accept-Encodingstring required
api-versionstring

Response

200

statusinteger
titlestring
descriptionstring

Example response

{
  "status": 200,
  "title": "OK",
  "description": "Successful request",
  "payload": {
    "metadata": {
      "next": "https://api.amberdata.com/markets/spot/ohlcv/btc_usd?cursor=N4IgpgHgxgFghgOwOZhALhEgJnCIA0IUArgE4DOA9qegsQDb2HkAucpLAInC6mgIwA2AJwB2ABwAWQZIAM8%2BYTAIs3Xun6iATJoCss0dq37CLAJYBbMAEkEvUgDc49dKARwr6EDgCe5AiDkAI70AHIefN5wPgHBYREACvRkzl44ZvQxhFhgAGZwDCzoAMxCWlpyCrKEFrjogsUVkuJV1SD0lJQA1gBGcFBdCWCkZpRY6FqyAL6EZghQyTkAqgjkxAAO69S8WACi0PDIYP5o%2BfTkYKaWYABi1LVFGBYZ9GYXUJQq-oS59zxeACsqAgAvQ4KwAOKkSgbVyYHB4NCgcxWVgedYaEQSaSVBRXVFsCzrcIISjvT5YE5tOY5RHTKZTIA",
      "api-version": "2023-09-30"
    },
    "data": [
      {
        "instrument": "btc_usd",
        "exchange": "gdax",
        "exchangeTimestamp": 1690156800000,
        "open": 30081.61,
        "high": 30099.99,
        "low": 28850,
        "close": 29176.98,
        "volume": 14484.27543962
      }
    ]
  }
}

Changes