Returns historical token prices at USD by time range

GEThttps://api.1inch.com/token-details/v1.0/charts/range/{chain}/{tokenAddress}
Supported on:
EthereumBaseSolanaBNB ChainAvalancheZKsyncGnosisOptimismPolygonLineaSonicUnichainArbitrum

Parameters

tokenAddress
* string path
from
* number query
to
* number query
from_time
number query
provider
string (Enum)query
chain
* number path

Request Body

This request doesn’t have any request body.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
const axios = require('axios');

async function httpCall() {
  const url =
    'https://api.1inch.com/token-details/v1.0/charts/range/{chain}/{tokenAddress}';

  const config = {
    headers: {
      Authorization: `Bearer ${API_KEY}`,
    },
    params: {
      from: 1622200267,
      to: 1622203867,
      from_time: 1658841720,
    },
    paramsSerializer: {
      indexes: null,
    },
  };
  const body = {};

  try {
    const response = await axios.get(url, body, config);
    console.log(response.data);
  } catch (error) {
    console.error(error);
  }
}

Returns

200
500
ChartDataResponse object
d
* array
items
ChartPointResponse object
t
* number
v
* number
p
* string
JSON
1
2
3
4
5
6
7
8
9
10
{
  "d": [
    {
      "t": 0,
      "v": 0
    }
  ],
  "p": "string"
}

Did you find what you need?