Get unique active token pairs with cursor pagination
Retrieves unique active token pairs with cursor-based pagination. Pairs are sorted by makerAsset, takerAsset.
Supported on: Ethereum Base BNB Chain Linea Sonic Unichain Arbitrum Avalanche ZKsync Gnosis Optimism Polygon
Parameters
chain
* number path limit
integer queryNumber of limit orders to receive (default: 100, max: 500)
cursor
string querybase64 representation of the cursor
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
27
28
const axios = require('axios');
async function httpCall() {
const url =
'https://api.1inch.com/orderbook/v4.1/{chain}/unique-active-pairs';
const config = {
headers: {
Authorization: `Bearer ${API_KEY}`,
},
params: {
cursor:
'eyJtYWtlckFzc2V0IjoiMHg4OWRlYjZjODkxOGE0MjQ1N2JkNmRkYmNhYWY5NzkyMTZjNGQ3NzRjIiwidGFrZXJBc3NldCI6IjB4ZGFjMTdmOTU4ZDJlZTUyM2EyMjA2MjA2OTk0NTk3YzEzZDgzMWVjNyJ9',
},
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
400
meta
* any Cursor pagination metadata
allOf[0]
CursorMeta object hasMore
* boolean Whether there are more items available
nextCursor
string Next cursor for pagination
count
number Total count of items (if available)
items
* array Array of unique active asset pairs
items
UniquePairs object makerAsset
* string The address of the maker asset (token address)
takerAsset
* string The address of the taker asset (token address)
JSON
Copy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
{
"meta": {
"hasMore": true,
"nextCursor": "eyJhY3Rpdml0eURhdGUiOiIyMDIzLTEwLTE5VDE0OjAzOjI3LjUwMFoiLCJvcmRlckhhc2giOiIweDBkOTIwNzllMzgyOGYxZGQ2ZTQ4MTI2OWUwZDkxMmU2MGQwNGE1OGEwM2EyYzFmMDUyOWVkMTIwY2U2YmEwYmMifQ==",
"count": 150
},
"items": [
{
"makerAsset": "0x89deb6c8918a42457bd6ddbcaaf979216c4d774c",
"takerAsset": "0xdac17f958d2ee523a2206206994597c13d831ec7"
},
{
"makerAsset": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"takerAsset": "0x2f109021afe75b949429fe30523ee7c0d5b27207"
}
]
}