Data Streams Candlestick API

The Candlestick API is designed and implemented to satisfy the TradingView implementation spec, the industry standard for sharing aggregated trading data.

Alignment with the TradingView spec allows for TradingView integration and direct customer access to prices without resorting to consuming and decoding reports for non-transactional use cases, like dashboards, analytics platforms, portfolio trackers, research tools, and more.

Domains

DescriptionTestnet URLMainnet URL
Candlestick API endpointhttps://priceapi.testnet-dataengine.chain.linkhttps://priceapi.dataengine.chain.link

API Endpoints

Authorize and get token

Endpoint

/api/v1/authorize

TypeDescriptionParameter(s)
HTTP POSTAuthorizes a user and returns a JWT access token.
  • login: The user ID.
  • password: The user's API key.
Sample request
curl -X POST \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "login={YOUR_USER_ID}&password={YOUR_API_KEY}" \
  https://priceapi.testnet-dataengine.chain.link/api/v1/authorize
Response
  • Status: 200

    {
      "d": {
        "access_token": "[ACCESS_TOKEN]",
        "expiration": 1747203979
      },
      "s": "ok"
    }
    
    FieldTypeDescription
    sstringThe status of the request.
    dobjectThe data returned by the API call.
    access_tokenstringThe JWT token for subsequent requests.
    expirationnumberThe expiry timestamp (unix) of the token.
Error Responses
Status CodeError MessageDescription
400Parse error - Login: missing required field, Password: missing required fieldA required field was missing.
401Unauthorized - Invalid credentialsThe user password (API key) is incorrect.
404Not found - user not found for id {USER_ID}The user login was not found.
500Error - Failed to generate tokenThe server failed to create a token.

Get list of supported symbols

Endpoint

/api/v1/symbol_info

TypeDescriptionParameter(s)
HTTP GETGets a list of all supported symbols on the environment.
  • group (optional): Filter symbols by group. Currently only supports "crypto".
Sample request
curl -X GET \
  -H "Authorization: Bearer {YOUR_ACCESS_TOKEN}" \
  https://priceapi.testnet-dataengine.chain.link/api/v1/symbol_info
Response
  • Status: 200

    {
      "s": "ok",
      "symbol": ["ETHUSD", "BTCUSD"],
      "currency": ["USD", "USD"],
      "base-currency": ["ETH", "BTC"]
    }
    
    FieldTypeDescription
    sstringThe status of the request.
    symbolarrayArray of supported symbols.
    currencyarrayArray of symbol currencies.
    base-currencyarrayArray of symbol base currencies.
Error Responses
Status CodeError MessageDescription
401Unauthorized - Authorization header is required || Invalid authorization header format || token signature is invalid: signature is invalid || ...The authorization header was missing or invalid.
500Error - Something went wrongAn unexpected server error occurred.

Get candlestick data (column format)

Endpoint

/api/v1/history

TypeDescriptionParameter(s)
HTTP GETGets candlestick data in column format.
  • symbol: The symbol to query.
  • resolution: Resolution of the data (required but not used, use "1m").
  • from: Unix timestamp of the leftmost required bar (inclusive).
  • to: Unix timestamp of the rightmost required bar (inclusive).

Note: The resolution of the data is based on the size of the time window:

Max time window sizeResolution of candles
<= 24 hours1 minute
<= 5 days5 minutes
<= 30 days30 minutes
<= 90 days1 hour
<= 6 months2 hours
> 6 months1 day
Sample request
curl -X GET \
  -H "Authorization: Bearer {YOUR_ACCESS_TOKEN}" \
  "https://priceapi.testnet-dataengine.chain.link/api/v1/history?symbol=ETHUSD&resolution=1m&from=1746072068&to=1746158468"
Response
  • Status: 200

    {
      "s": "ok",
      "t": [1746158460, 1746158400, 1746158340],
      "c": [1.84685e21, 1.848515087189567e21, 1.8490380305e21, 1.8481266e21],
      "o": [1.8483674e21, 1.848602513e21, 1.8481267e21],
      "h": [1.8498753129131415e21, 1.848875387e21, 1.8490380305e21],
      "l": [1.8468008021426886e21, 1.848243519e21, 1.8475677870725296e21],
      "v": []
    }
    
    FieldTypeDescription
    sstringThe status of the request.
    tarrayArray of unix timestamps (the time of each candle).
    carrayArray of numbers (the close (last) value of each candle).
    oarrayArray of numbers (the open (first) value of each candle).
    harrayArray of numbers (the high (max) value of each candle).
    larrayArray of numbers (the low (min) value of each candle).
    varrayArray of numbers (the volume of each candle. Not currently supported).

    Note: If candles cannot be found for the given symbol/time period, a response with empty arrays will be provided. eg: { "s": "ok", "t": [], "c": [], "o": [], "h": [], "l": [], "v": [] }

Error Responses
Status CodeError MessageDescription
400Parse error xxx: missing required fieldA required parameter was missing.
401Unauthorized - Authorization header is required || Invalid authorization header format || token signature is invalid: signature is invalid || ...The authorization header was missing or invalid.
404Not found- Could not find feedID for symbolThe provided symbol is not supported.
500Something went wrong. Please try again later.An unexpected server error occurred.

Get candlestick data (row format)

Endpoint

/api/v1/history/rows

TypeDescriptionParameter(s)
HTTP GETGets candlestick data in row format.
  • symbol: The symbol to query.
  • resolution: Resolution of the data (required but not used, use "1m").
  • from: Unix timestamp of the leftmost required bar (inclusive).
  • to: Unix timestamp of the rightmost required bar (inclusive).
Sample request
curl -X GET \
  -H "Authorization: Bearer {YOUR_ACCESS_TOKEN}" \
  "https://priceapi.testnet-dataengine.chain.link/api/v1/history/rows?symbol=ETHUSD&resolution=1m&from=1746072068&to=1746158468"
Response
  • Status: 200

    {
      "s": "ok",
      "candles": [
        [1746158460, 1.8483674e21, 1.8498753129131415e21, 1.8468008021426886e21, 1.84685e21, 0],
        [1746158400, 1.848602513e21, 1.848875387e21, 1.848243519e21, 1.848515087189567e21, 0],
        [1746158340, 1.8481267e21, 1.8490380305e21, 1.8475677870725296e21, 1.8490380305e21, 0]
      ]
    }
    
    FieldTypeDescription
    sstringThe status of the request.
    candlesarrayArray of arrays of numbers. Each array candle contains: [ time, open, high, low, close, volume ].

    Note: If candles cannot be found for the given symbol/time period, a response with an empty candles array is provided. eg: { "s": "ok", "candles": [] }

Error Responses
Status CodeError MessageDescription
400Parse error xxx: missing required fieldA required parameter was missing.
401Unauthorized - Authorization header is required || Invalid authorization header format || token signature is invalid: signature is invalid || ...The authorization header was missing or invalid.
404Not found- Could not find feedID for symbolThe provided symbol is not supported.
500Something went wrong. Please try again later.An unexpected server error occurred.

Get streaming price updates

Endpoint

/api/v1/streaming

TypeDescriptionParameter(s)
HTTP GETGets streaming price updates using HTTP chunked encoding.
  • symbol or feedId: A comma-separated list of symbols or feed IDs to stream.
Sample request
curl -X GET \
  -H "Authorization: Bearer {YOUR_ACCESS_TOKEN}" \
  -H "Connection: keep-alive" \
  "https://priceapi.testnet-dataengine.chain.link/api/v1/streaming?symbol=ETHUSD,BTCUSD"
Response
  • Status: 200 (Streaming)

    A stream of JSON objects.

    Trade Response:

    {
      "f": "t",
      "i": "ETHUSD",
      "fid": "[FEED_ID]",
      "p": 2.68312e21,
      "t": 1748525526,
      "s": 1
    }
    
    FieldTypeDescription
    fstringMessage type. Will always be “t” to indicate a trade response.
    istringIdentifier. The symbol for this response.
    fidstringThe hex-encoded feed ID for this response.
    pfloat64The latest price update for the symbol/feedId.
    tfloat64The time of the price as a unix timestamp.
    sfloat64Size of the trade. This will always be 1.

    Heartbeat (sent every 5 seconds):

    { "heartbeat": 1748525528 }
    
    FieldTypeDescription
    heartbeatfloat64The time of the heartbeat message as a unix timestamp.
Error Responses
Status CodeError MessageDescription
400Parse error xxx: One of symbol or feedId must be providedA required parameter was missing.
401Unauthorized - Authorization header is required || Invalid authorization header format || token signature is invalid: signature is invalid || ...The authorization header was missing or invalid.
404Not found- Could not find feedID for symbolThe provided symbol is not supported.
500Something went wrong. Please try again later.An unexpected server error occurred.

Get the latest Chainlink content straight to your inbox.