📈Line Chart Data

Endpoint

GET /v1/tokens/line-chart?tokenId=<TOKEN_ID>&days=<DAYS>

Description

This endpoint returns data for a given token that can be used to create a line chart. The tokenId parameter is required and should be a string in the format <TOKEN_CONTRACT_ADDRESS>:<NETWORK_ID>. The TOKEN_CONTRACT_ADDRESS is the address of the token contract on the specified network, and the NETWORK_ID is the ID of the network the token is on. See supported networks for more info. The days parameter is required and must be an integer between 1 and 90, inclusive. This parameter specifies the number of days of data to include in the response.

Query String Parameters

  • tokenId (required): A string in the format <TOKEN_CONTRACT_ADDRESS>:<NETWORK_ID> that identifies the token to look up.

  • days (required): An integer between 1 and 90, inclusive, that specifies the number of days of data to include in the response.

Headers

  • x-api-key (required): A valid API key.

Example

curl -X GET 'https://api.lynxcrypto.app/v1/tokens/line-chart?tokenId=0x52ec25e58a9e144ff002625bb2aa58cc6da24cb2:56&days=3'
-H 'x-api-key: <YOUR_API_KEY>'

Response

{
    "labels": [
        "2023-01-07T06:00:00.000Z",
        "2023-01-07T07:00:00.000Z",
        "2023-01-07T08:00:00.000Z",
    ],
    "data": [
        0.001478592167298373,
        0.0014739300398326578,
        0.0014675970123415693,
    ]
}

Notes

Our system listens for trades from decentralized exchanges. The responses for this query are the average price for a token for each hour in the selected date range. If there were no trades within the date range the query will return a 404 Not Found error.

Response Codes

  • 200: Success. Returns the USD price for the given token.

  • 400: Bad Request. The tokenId or days query string parameter is not provided or days is greater than 90 or less than 1.

  • 403: Forbidden. The x-api-key header is not provided or is invalid.

  • 404: Not Found. No price updates found within the given time range

Last updated