Get all orders fill/cancel events with cursor pagination

Retrieves all fill/cancel events with cursor-based pagination. Events are sorted by createDateTime DESC, id DESC.

GEThttps://api.1inch.com/orderbook/v4.1/{chain}/events
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
const axios = require('axios');

async function httpCall() {
  const url = 'https://api.1inch.com/orderbook/v4.1/{chain}/events';

  const config = {
    headers: {
      Authorization: `Bearer ${API_KEY}`,
    },
    params: {
      cursor:
        'eyJjcmVhdGVEYXRlVGltZSI6IjIwMjUtMDEtMThUMTQ6MjM6MzAuODIyWiIsImlkIjo0MjM0NTY3ODkwfQ',
    },
    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
GetEventsV4_1PaginatedResponse object
meta
* any
allOf[0]
CursorMeta object
hasMore
* boolean
nextCursor
string
count
number
items
* array
items
GetEventsV4Response object
id
* number
network
* number
logId
* string
version
* number
action
* string
orderHash
* string
taker
* string
remainingMakerAmount
* string
transactionHash
* string
blockNumber
* number
createDateTime
* string
JSON
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
{
  "meta": {
    "hasMore": true,
    "nextCursor": "eyJhY3Rpdml0eURhdGUiOiIyMDIzLTEwLTE5VDE0OjAzOjI3LjUwMFoiLCJvcmRlckhhc2giOiIweDBkOTIwNzllMzgyOGYxZGQ2ZTQ4MTI2OWUwZDkxMmU2MGQwNGE1OGEwM2EyYzFmMDUyOWVkMTIwY2U2YmEwYmMifQ==",
    "count": 150
  },
  "items": [
    {
      "id": 0,
      "network": 0,
      "logId": "string",
      "version": 0,
      "action": "string",
      "orderHash": "string",
      "taker": "string",
      "remainingMakerAmount": "string",
      "transactionHash": "string",
      "blockNumber": 0,
      "createDateTime": "string"
    }
  ]
}

Did you find what you need?