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.
Supported on: Ethereum Base Solana BNB Chain Gnosis Optimism Polygon Linea Sonic Unichain Robinhood Chain Arbitrum Avalanche ZKsync
Parameters
chainId
* integer (Enum)pathChain ID, as in EIP-155. The allowed values are the EVM chains this API version supports; pairs are not available on Solana.
replaceNativeWithWrappedInSource
boolean queryIf true, the source side of each pair uses the wrapped native token (WETH) instead of the native one (ETH).
limit
integer queryMaximum number of pairs to return.
query
string queryA token (USDC) or a pair (USDC-ETH), as symbol, name or address, or a chip such as usd.
cursor
string querypage.nextCursor of the previous response.
Request Body
This request doesn’t have any request body.
JavaScript
Copy
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
One page of token pairs, with the tokens they reference.
pairs
* array Pairs as [source token address, destination token address], best match first. Details of each address are in tokens.
items
array items
string tokens
* array Each token that appears in pairs, once.
items
PairTokenResponse object A token that appears in at least one of the returned pairs. The chain is the one in the request path.
symbol
* string Ticker symbol.
name
* string Token name.
address
* string Token contract address, lower-case for EVM chains.
decimals
* integer Number of decimals in on-chain amounts.
logoURI
* string Logo image URL, or an empty string when there is none.
providers
* array Token-list providers that list this token.
items
string eip2612
* boolean Whether the token supports EIP-2612 permit, so an approval can be signed instead of sent.
isFoT
* boolean Whether the token takes a fee on transfer.
tags
* array Tags such as tokens, native, PEG:USD or crosschain.
items
string displayedSymbol
string Symbol to show instead of symbol, when 1inch overrides it to tell tokens apart.
marketCap
number Market capitalization in USD.
tradingRestricted
boolean Present and true when the token cannot be traded from the caller's location.
page
* any Pagination of the result.
allOf[0]
PageInfoResponse object Cursor pagination of a pairs result.
nextCursor
string Pass as cursor to get the next page. Absent on the last page.
hasMore
* boolean Whether another page follows.
JSON
Copy
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
}
}