Returns token price change by interval for a list of tokens

POSThttps://api.1inch.com/token-details/v1.0/prices/change/{chain}
Supported on:
EthereumBaseSolanaBNB ChainGnosisOptimismPolygonLineaSonicUnichainArbitrumAvalancheZKsync

Parameters

chain
* number path

Request Body

GetTokenListPriceRequestDto object
tokenAddresses
* array
items
string
interval
* string (Enum)
5m
10m
15m
30m
50m
1h
2h
3h
4h
6h
12h
24h
2d
3d
7d
14d
15d
30d
60d
90d
365d
max
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
30
const axios = require('axios');

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

  const config = {
    headers: {
      Authorization: `Bearer ${API_KEY}`,
    },
    params: {},
    paramsSerializer: {
      indexes: null,
    },
  };
  const body = {
    tokenAddresses: [
      '0x111111111117dC0aa78b770fA6A738034120C302',
      '0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984',
    ],
    interval: '24h',
  };

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

Returns

200
400
404
500
array
items
TokenListPriceChangeResponseDto object
tokenAddress
* string
inUSD
* number
inPercent
* number
JSON
1
2
3
4
5
6
7
8
[
  {
    "tokenAddress": "0x111111111117dc0aa78b770fa6a738034120c302",
    "inUSD": 0.05,
    "inPercent": 2.5
  }
]

Did you find what you need?