Get unique active token pairs with cursor pagination

Retrieves unique active token pairs with cursor-based pagination. Pairs are sorted by makerAsset, takerAsset.

GEThttps://api.1inch.com/orderbook/v4.1/{chain}/unique-active-pairs
Supported on:
EthereumBaseBNB ChainLineaSonicUnichainArbitrumAvalancheZKsyncGnosisOptimismPolygon

Parameters

chain
* number path
limit
integer 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
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
GetActiveUniquePairsV4_1PaginatedResponse object
meta
* any
allOf[0]
CursorMeta object
hasMore
* boolean
nextCursor
string
count
number
items
* array
items
UniquePairs object
makerAsset
* string
takerAsset
* string
JSON
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"
    }
  ]
}

Did you find what you need?