Find token pairs on one chain

Returns token pairs for a swap form on one EVM chain. query is a token (USDC) or a pair (USDC-ETH), matched on symbol, name or address. A chip such as usd or defi returns the pairs of that chip, as GET /{chainId}/chipssearch/pairs does. Results come in pages: pass page.nextCursor from one response as cursor to get the next.

GEThttps://api.1inch.com/token/v1.5/{chainId}/pairs
Supported on:
EthereumBaseSolanaBNB ChainGnosisOptimismPolygonLineaSonicUnichainRobinhood ChainArbitrumAvalancheZKsync

Parameters

chainId
* integer (Enum)path
replaceNativeWithWrappedInSource
boolean query
limit
integer query
query
string query
cursor
string query

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
const axios = require('axios');

async function httpCall() {
  const url = 'https://api.1inch.com/token/v1.5/1/pairs';

  const config = {
    headers: {
      Authorization: `Bearer ${API_KEY}`,
    },
    params: {
      query: 'USDC-ETH',
      cursor: 'eyJzY29yZSI6MTIyMTk4MDQwMDAsInRva2VuQSI6IjgwNzc5MSJ9',
    },
    paramsSerializer: {
      indexes: null,
    },
  };

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

Returns

SearchPairsResponse object
pairs
* array
items
array
items
string
tokens
* array
items
PairTokenResponse object
symbol
* string
name
* string
address
* string
decimals
* integer
logoURI
* string
providers
* array
items
string
eip2612
* boolean
isFoT
* boolean
tags
* array
items
string
displayedSymbol
string
marketCap
number
tradingRestricted
boolean
page
* any
allOf[0]
PageInfoResponse object
nextCursor
string
hasMore
* boolean
JSON
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
31
32
33
{
  "pairs": [
    [
      "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
      "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
    ],
    [
      "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
      "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"
    ]
  ],
  "tokens": [
    {
      "symbol": "USDT",
      "name": "Tether USD",
      "address": "0xdac17f958d2ee523a2206206994597c13d831ec7",
      "decimals": 6,
      "logoURI": "https://tokens-data.1inch.io/images/1/0xdac17f958d2ee523a2206206994597c13d831ec7.png",
      "providers": ["1inch", "CoinGecko"],
      "eip2612": false,
      "isFoT": false,
      "tags": ["tokens", "PEG:USD"],
      "displayedSymbol": "USDT0",
      "marketCap": 83351941553,
      "tradingRestricted": true
    }
  ],
  "page": {
    "nextCursor": "eyJzY29yZSI6MTIyMTk4MDQwMDAsInRva2VuQSI6IjgwNzc5MSJ9",
    "hasMore": true
  }
}

Did you find what you need?