Get orders count by specified filters

GEThttps://api.1inch.com/orderbook/v4.1/{chain}/count
Supported on:
EthereumBaseBNB ChainSonicUnichainArbitrumAvalancheZKsyncGnosisOptimismPolygonLinea

Parameters

chain
* number path
statuses
string query
takerAsset
string query
makerAsset
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}/count';

  const config = {
    headers: {
      Authorization: `Bearer ${API_KEY}`,
    },
    params: {
      statuses: '1,2,3',
      takerAsset: '0x1234567890ABCDEF1234567890ABCDEF12345678',
      makerAsset: '0x1234567890ABCDEF1234567890ABCDEF12345678',
    },
    paramsSerializer: {
      indexes: null,
    },
  };
  const body = {};

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

Returns

400
default
GetLimitOrdersCountV4Response object
count
* number
JSON
1
2
3
4
{
  "count": "124"
}

Did you find what you need?