> For the complete documentation index, see [llms.txt](https://lynx-4.gitbook.io/api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://lynx-4.gitbook.io/api/deprecated/line-chart-data.md).

# 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

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

### Response

```json
{
    "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
