Links

Orderbook API

Trader.xyz hosts a free, real-time NFT orderbook that hosts buy and sell NFT orders.

Overview

Trader.xyz hosts the official orderbook for 0x v4 NFT orders.
Trader.xyz orderbook is an open orderbook that keeps track of off-NFT chain orders and order statuses in real-time. Anyone can add orders to the orderbook as long as they are valid 0x v4 orders.
Having an open orderbook for NFT orders makes it much easier for integrators to build NFT marketplaces and swapping apps -- bring your own frontend and leverage the trader infrastructure. No lock-in and the open orderbook is completely free to use!

Routes:

Get Orders

get
https://api.trader.xyz/orderbook
/orders
Upon finding an order you like. use the order field as the order object to fill on 0x v4.
const nftOrders = await fetch(
`https://api.trader.xyz/orderbook/orders?chainId=1&nftToken=0x5Af0D9827E0c53E4799BB226655A1de152A425a5&status=open`
).then(res => res.json())
​
// Find the first order
const nftOrder = nftOrders[0]
// Get the actual 0x v4 order that can be filled via the ExchangeProxy
const fillableZeroExOrder = nftOrder.order
​
// Fill order with a) Swap SDK, or b) ethers/exchange proxy directly:
​
// a) Fill via Swap SdK
const swapSdk = new SwapSdkV4(provider, signer);
const tx = await swapSdk.fillSignedOrder(fillableZeroExOrder);
​
// b) Fill via ExchangeProxy (you will need to set up the ExchangeProxy ABI via ethers)
// The function signature looks like this:
const tx = await exchangeProxy.buyERC721(
fillableZeroExOrder,
fillableZeroExOrder.signature,
'0x',
);
​
​

Posting orders

post
https://api.trader.xyz/orderbook
/order