Search
⌘K
Orderbook API
API version: All versions
Introduction
Quickstart
Methods
Include a limit order to the 1inch limit orders database POST
Get order by the specified order hash GET
Get orders count by specified filters GET
Get fill/cancel events related to the specified order GET
Get limit orders history by address (Cursor Pagination) GET
Get all limit orders with cursor pagination GET
Get orders by address with cursor pagination GET
Get all orders fill/cancel events with cursor pagination GET
Get all active orders which have permit for the specified wallet address and token GET
Get calculated making amount on trading pair by provided amount GET
Get unique active token pairs with cursor pagination GET
Get market price for a token pair GET
Migration
Migration V3 - V4
SDK
Introduction
Querying the Orderbook
Advanced usage
Docs·APIs·Orderbook API·SDK·Querying the Orderbook

Querying the Orderbook

The Limit Order SDK provides a built-in Api class for querying orders from the 1inch Orderbook. You can retrieve orders by hash, by maker address, or browse all active orders with pagination support.

Prerequisites

You need:

  • A 1inch API key (get one at 1inch Business)
  • The @1inch/limit-order-sdk package installed

No wallet or private key is required for read-only queries.

Setting up the API client

JavaScript
1
2
3
4
5
6
7
import { Api, FetchProviderConnector, CursorPager } from "@1inch/limit-order-sdk";

const api = new Api({
  networkId: 1, // Ethereum mainnet
  authKey: "your-api-key",
  httpConnector: new FetchProviderConnector()
});

Query by order hash

If you have an order hash from a previous submission, you can retrieve its full details:

JavaScript
1
2
3
4
5
const order = await api.getOrderByHash(orderHash);
console.log("Maker Asset:", order.data.makerAsset);
console.log("Taker Asset:", order.data.takerAsset);
console.log("Making Amount:", order.data.makingAmount);
console.log("Taking Amount:", order.data.takingAmount);

Query by maker address

To retrieve all orders created by a specific wallet address, use getOrdersByMaker with pagination:

JavaScript
1
2
3
4
5
6
7
8
9
const response = await api.getOrdersByMaker(makerAddress, {
  pager: new CursorPager({ limit: 10 }),
  statuses: [1] // 1 = active orders only
});

for (const order of response.items) {
  console.log("Maker Asset:", order.data.makerAsset);
  console.log("Taking Amount:", order.data.takingAmount);
}

Status codes

Status Meaning
1 Active
2 Filled
3 Expired
4 Cancelled

Query all active orders

To browse the full orderbook, use getAllOrders with pagination:

JavaScript
1
2
3
4
5
6
const response = await api.getAllOrders({
  pager: new CursorPager({ limit: 5 }),
  statuses: [1]
});

console.log(`Found ${response.items.length} active orders`);

Full working example

Did you find what you need?