Skip to main content

0x API (v2)

Download OpenAPI specification:Download

These are the API references for 0x API v2. If you are looking for API v1 references, see here.

Swap

Swap API endpoints

getPrice (Permit2)

Get the indicative price for a swap using Permit2 to set allowances

query Parameters
chainId
required
integer > 0
Example: chainId=1

Chain ID. See here for the list of supported chains

buyToken
required
string^0x(?!0{40})[a-fA-F0-9]{40}$
Example: buyToken=0xdac17f958d2ee523a2206206994597c13d831ec7

The contract address of the token to buy

sellToken
required
string^0x(?!0{40})[a-fA-F0-9]{40}$
Example: sellToken=0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48

The contract address of the token to sell

sellAmount
required
string
Example: sellAmount=100000000

The amount of sellToken in sellToken base units to sell

taker
string^0x[a-fA-F0-9]{40}$
Example: taker=0x70a9f34f9b34c64957b9c401a97bfed35b95049e

The address which holds the sellToken balance and has the allowance set for the swap

txOrigin
string^0x[a-fA-F0-9]{40}$

The contract address of the external account that started the transaction. This is only needed if taker is a smart contract.

swapFeeRecipient
string^0x[a-fA-F0-9]{40}$

The wallet address to receive the specified trading fees. You must also specify the swapFeeToken and swapFeeBps in the request to use this feature. Learn more about setting up a trading fee/commission in the FAQs

swapFeeBps
integer [ 0 .. 10000 ]

The amount in Bps of the swapFeeToken to charge and deliver to the swapFeeRecipient. You must also specify the swapFeeRecipient and swapFeeToken in the request to use this feature. For security, this field has a default limit of 1000 Bps. If your application requires a higher value, please reach out to us.

swapFeeToken
string^0x(?!0{40})[a-fA-F0-9]{40}$

The contract address of the token to receive trading fees in. This must be set to the value of either the buyToken or the sellToken. You must also specify the swapFeeRecipient and swapFeeBps in the request to use this feature

tradeSurplusRecipient
string^0x[a-fA-F0-9]{40}$

The address to receive any trade surplus. If specified, this address will receive trade surplus when applicable. Otherwise, the taker will receive the surplus

gasPrice
string

The target gas price (in wei) for the swap transaction. If not provided, the default value is based on the 0x gas price oracle

slippageBps
integer [ 0 .. 10000 ]
Default: 100

The maximum acceptable slippage of the buyToken in Bps. If this parameter is set to 0, no slippage will be tolerated. If not provided, the default slippage tolerance is 100Bps

excludedSources
string

Liquidity sources e.g. Uniswap_V3, SushiSwap, 0x_RFQ to exclude from the provided quote. See https://api.0x.org/sources?chainId= with the desired chain's ID for a full list of sources. Separate multiple sources with a comma

sellEntireBalance
boolean
Default: false

If set to true, the taker's entire sellToken balance will be sold during trade execution. The sellAmount should be the maximum estimated value, as close as possible to the actual taker's balance to ensure the best routing. Selling more than the sellAmount may cause the trade to revert. This feature is designed for cases where the precise sell amount is determined during execution. Learn more here.

header Parameters
0x-api-key
required
string

Visit dashboard.0x.org to get your API Key

0x-version
required
string
Example: v2

API version

Responses

Response samples

Content type
application/json
{
  • "blockNumber": "20114676",
  • "buyAmount": "100032748",
  • "buyToken": "0xdac17f958d2ee523a2206206994597c13d831ec7",
  • "fees": {
    },
  • "gas": "288095",
  • "gasPrice": "7062490000",
  • "issues": {
    },
  • "liquidityAvailable": true,
  • "minBuyAmount": "99032421",
  • "route": {
    },
  • "sellAmount": "100000000",
  • "sellToken": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
  • "tokenMetadata": {
    },
  • "totalNetworkFee": "2034668056550000",
  • "zid": "0x111111111111111111111111"
}

getQuote (Permit2)

Get the firm quote for a swap using Permit2 to set allowances

query Parameters
chainId
required
integer > 0
Example: chainId=1

Chain ID. See here for the list of supported chains

buyToken
required
string^0x(?!0{40})[a-fA-F0-9]{40}$
Example: buyToken=0xdac17f958d2ee523a2206206994597c13d831ec7

The contract address of the token to buy

sellToken
required
string^0x(?!0{40})[a-fA-F0-9]{40}$
Example: sellToken=0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48

The contract address of the token to sell

sellAmount
required
string
Example: sellAmount=100000000

The amount of sellToken in sellToken base units to sell

taker
required
string^0x[a-fA-F0-9]{40}$
Example: taker=0x70a9f34f9b34c64957b9c401a97bfed35b95049e

The address which holds the sellToken balance and has the allowance set for the swap

txOrigin
string^0x[a-fA-F0-9]{40}$

The contract address of the external account that started the transaction. This is only needed if taker is a smart contract.

swapFeeRecipient
string^0x[a-fA-F0-9]{40}$

The wallet address to receive the specified trading fees. You must also specify the swapFeeToken and swapFeeBps in the request to use this feature. Learn more about setting up a trading fee/commission in the FAQs

swapFeeBps
integer [ 0 .. 10000 ]

The amount in Bps of the swapFeeToken to charge and deliver to the swapFeeRecipient. You must also specify the swapFeeRecipient and swapFeeToken in the request to use this feature. For security, this field has a default limit of 1000 Bps. If your application requires a higher value, please reach out to us.

swapFeeToken
string^0x(?!0{40})[a-fA-F0-9]{40}$

The contract address of the token to receive trading fees in. This must be set to the value of either the buyToken or the sellToken. You must also specify the swapFeeRecipient and swapFeeBps in the request to use this feature

tradeSurplusRecipient
string^0x[a-fA-F0-9]{40}$

The address to receive any trade surplus. If specified, this address will receive trade surplus when applicable. Otherwise, the taker will receive the surplus

gasPrice
string

The target gas price (in wei) for the swap transaction. If not provided, the default value is based on the 0x gas price oracle

slippageBps
integer [ 0 .. 10000 ]
Default: 100

The maximum acceptable slippage of the buyToken in Bps. If this parameter is set to 0, no slippage will be tolerated. If not provided, the default slippage tolerance is 100Bps

excludedSources
string

Liquidity sources e.g. Uniswap_V3, SushiSwap, 0x_RFQ to exclude from the provided quote. See https://api.0x.org/sources?chainId= with the desired chain's ID for a full list of sources. Separate multiple sources with a comma

sellEntireBalance
boolean
Default: false

If set to true, the taker's entire sellToken balance will be sold during trade execution. The sellAmount should be the maximum estimated value, as close as possible to the actual taker's balance to ensure the best routing. Selling more than the sellAmount may cause the trade to revert. This feature is designed for cases where the precise sell amount is determined during execution. Learn more here.

header Parameters
0x-api-key
required
string

Visit dashboard.0x.org to get your API Key

0x-version
required
string
Example: v2

API version

Responses

Response samples

Content type
application/json
{
  • "blockNumber": "20114692",
  • "buyAmount": "100037537",
  • "buyToken": "0xdac17f958d2ee523a2206206994597c13d831ec7",
  • "fees": {
    },
  • "issues": {
    },
  • "liquidityAvailable": true,
  • "minBuyAmount": "99037162",
  • "permit2": {
    },
  • "route": {
    },
  • "sellAmount": "100000000",
  • "sellToken": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
  • "tokenMetadata": {
    },
  • "totalNetworkFee": "1393685870940000",
  • "transaction": {
    },
  • "zid": "0x111111111111111111111111"
}

getPrice (Allowance Holder)

Get the indicative price for a swap using Allowance Holder to set allowances

query Parameters
chainId
required
integer > 0
Example: chainId=1

Chain ID. See here for the list of supported chains

buyToken
required
string^0x(?!0{40})[a-fA-F0-9]{40}$
Example: buyToken=0xdac17f958d2ee523a2206206994597c13d831ec7

The contract address of the token to buy

sellToken
required
string^0x(?!0{40})[a-fA-F0-9]{40}$
Example: sellToken=0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48

The contract address of the token to sell

sellAmount
required
string
Example: sellAmount=100000000

The amount of sellToken in sellToken base units to sell

taker
string^0x[a-fA-F0-9]{40}$
Example: taker=0x70a9f34f9b34c64957b9c401a97bfed35b95049e

The address which holds the sellToken balance and has the allowance set for the swap

txOrigin
string^0x[a-fA-F0-9]{40}$

The contract address of the external account that started the transaction. This is only needed if taker is a smart contract.

swapFeeRecipient
string^0x[a-fA-F0-9]{40}$

The wallet address to receive the specified trading fees. You must also specify the swapFeeToken and swapFeeBps in the request to use this feature. Learn more about setting up a trading fee/commission in the FAQs

swapFeeBps
integer [ 0 .. 10000 ]

The amount in Bps of the swapFeeToken to charge and deliver to the swapFeeRecipient. You must also specify the swapFeeRecipient and swapFeeToken in the request to use this feature. For security, this field has a default limit of 1000 Bps. If your application requires a higher value, please reach out to us.

swapFeeToken
string^0x(?!0{40})[a-fA-F0-9]{40}$

The contract address of the token to receive trading fees in. This must be set to the value of either the buyToken or the sellToken. You must also specify the swapFeeRecipient and swapFeeBps in the request to use this feature

tradeSurplusRecipient
string^0x[a-fA-F0-9]{40}$

The address to receive any trade surplus. If specified, this address will receive trade surplus when applicable. Otherwise, the taker will receive the surplus

gasPrice
string

The target gas price (in wei) for the swap transaction. If not provided, the default value is based on the 0x gas price oracle

slippageBps
integer [ 0 .. 10000 ]
Default: 100

The maximum acceptable slippage of the buyToken in Bps. If this parameter is set to 0, no slippage will be tolerated. If not provided, the default slippage tolerance is 100Bps

excludedSources
string

Liquidity sources e.g. Uniswap_V3, SushiSwap, 0x_RFQ to exclude from the provided quote. See https://api.0x.org/sources?chainId= with the desired chain's ID for a full list of sources. Separate multiple sources with a comma

sellEntireBalance
boolean
Default: false

If set to true, the taker's entire sellToken balance will be sold during trade execution. The sellAmount should be the maximum estimated value, as close as possible to the actual taker's balance to ensure the best routing. Selling more than the sellAmount may cause the trade to revert. This feature is designed for cases where the precise sell amount is determined during execution. Learn more here.

header Parameters
0x-api-key
required
string

Visit dashboard.0x.org to get your API Key

0x-version
required
string
Example: v2

API version

Responses

Response samples

Content type
application/json
{
  • "blockNumber": "20114676",
  • "buyAmount": "100032748",
  • "buyToken": "0xdac17f958d2ee523a2206206994597c13d831ec7",
  • "fees": {
    },
  • "gas": "288095",
  • "gasPrice": "7062490000",
  • "issues": {
    },
  • "liquidityAvailable": true,
  • "minBuyAmount": "99032421",
  • "route": {
    },
  • "sellAmount": "100000000",
  • "sellToken": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
  • "tokenMetadata": {
    },
  • "totalNetworkFee": "2034668056550000",
  • "zid": "0x111111111111111111111111"
}

getQuote (Allowance Holder)

Get the firm quote for a swap using Allowance Holder to set allowances

query Parameters
chainId
required
integer > 0
Example: chainId=1

Chain ID. See here for the list of supported chains

buyToken
required
string^0x(?!0{40})[a-fA-F0-9]{40}$
Example: buyToken=0xdac17f958d2ee523a2206206994597c13d831ec7

The contract address of the token to buy

sellToken
required
string^0x(?!0{40})[a-fA-F0-9]{40}$
Example: sellToken=0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48

The contract address of the token to sell

sellAmount
required
string
Example: sellAmount=100000000

The amount of sellToken in sellToken base units to sell

taker
required
string^0x[a-fA-F0-9]{40}$
Example: taker=0x70a9f34f9b34c64957b9c401a97bfed35b95049e

The address which holds the sellToken balance and has the allowance set for the swap

txOrigin
string^0x[a-fA-F0-9]{40}$

The contract address of the external account that started the transaction. This is only needed if taker is a smart contract.

swapFeeRecipient
string^0x[a-fA-F0-9]{40}$

The wallet address to receive the specified trading fees. You must also specify the swapFeeToken and swapFeeBps in the request to use this feature. Learn more about setting up a trading fee/commission in the FAQs

swapFeeBps
integer [ 0 .. 10000 ]

The amount in Bps of the swapFeeToken to charge and deliver to the swapFeeRecipient. You must also specify the swapFeeRecipient and swapFeeToken in the request to use this feature. For security, this field has a default limit of 1000 Bps. If your application requires a higher value, please reach out to us.

swapFeeToken
string^0x(?!0{40})[a-fA-F0-9]{40}$

The contract address of the token to receive trading fees in. This must be set to the value of either the buyToken or the sellToken. You must also specify the swapFeeRecipient and swapFeeBps in the request to use this feature

tradeSurplusRecipient
string^0x[a-fA-F0-9]{40}$

The address to receive any trade surplus. If specified, this address will receive trade surplus when applicable. Otherwise, the taker will receive the surplus

gasPrice
string

The target gas price (in wei) for the swap transaction. If not provided, the default value is based on the 0x gas price oracle

slippageBps
integer [ 0 .. 10000 ]
Default: 100

The maximum acceptable slippage of the buyToken in Bps. If this parameter is set to 0, no slippage will be tolerated. If not provided, the default slippage tolerance is 100Bps

excludedSources
string

Liquidity sources e.g. Uniswap_V3, SushiSwap, 0x_RFQ to exclude from the provided quote. See https://api.0x.org/sources?chainId= with the desired chain's ID for a full list of sources. Separate multiple sources with a comma

sellEntireBalance
boolean
Default: false

If set to true, the taker's entire sellToken balance will be sold during trade execution. The sellAmount should be the maximum estimated value, as close as possible to the actual taker's balance to ensure the best routing. Selling more than the sellAmount may cause the trade to revert. This feature is designed for cases where the precise sell amount is determined during execution. Learn more here.

header Parameters
0x-api-key
required
string

Visit dashboard.0x.org to get your API Key

0x-version
required
string
Example: v2

API version

Responses

Response samples

Content type
application/json
{
  • "blockNumber": "20114692",
  • "buyAmount": "100037537",
  • "buyToken": "0xdac17f958d2ee523a2206206994597c13d831ec7",
  • "fees": {
    },
  • "issues": {
    },
  • "liquidityAvailable": true,
  • "minBuyAmount": "99037162",
  • "route": {
    },
  • "sellAmount": "100000000",
  • "sellToken": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
  • "tokenMetadata": {
    },
  • "totalNetworkFee": "1393685870940000",
  • "transaction": {
    },
  • "zid": "0x111111111111111111111111"
}

getChains

Get list of supported chains for swap

header Parameters
0x-api-key
required
string

Visit dashboard.0x.org to get your API Key

0x-version
required
string
Example: v2

API version

Responses

Response samples

Content type
application/json
[
  • {
    },
  • {
    },
  • {
    },
  • {
    },
  • {
    },
  • {
    },
  • {
    },
  • {
    },
  • {
    },
  • {
    },
  • {
    },
  • {
    }
]

Gasless

Gasless API endpoints

getPrice

Get the indicative price for a gasless swap

query Parameters
chainId
required
integer > 0
Example: chainId=1

Chain ID. See here for the list of supported chains

buyToken
required
string^0x(?!0{40})[a-fA-F0-9]{40}$
Example: buyToken=0xdac17f958d2ee523a2206206994597c13d831ec7

The contract address of the token to buy

sellToken
required
string^0x(?!0{40})[a-fA-F0-9]{40}$
Example: sellToken=0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48

The contract address of the token to sell. Native token is not supported

sellAmount
required
string
Example: sellAmount=300000000

The amount of sellToken in sellToken base units to sell

taker
string^0x[a-fA-F0-9]{40}$
Example: taker=0x70a9f34f9b34c64957b9c401a97bfed35b95049e

The address which holds the sellToken balance and has the allowance set for the swap

swapFeeRecipient
string^0x[a-fA-F0-9]{40}$

The wallet address to receive the specified trading fees. You must also specify the swapFeeToken and swapFeeBps in the request to use this feature. Learn more about setting up a trading fee/commission in the FAQs

swapFeeBps
integer [ 0 .. 10000 ]

The amount in Bps of the swapFeeToken to charge and deliver to the swapFeeRecipient. You must also specify the swapFeeRecipient and swapFeeToken in the request to use this feature. For security, this field has a default limit of 1000 Bps. If your application requires a higher value, please reach out to us.

swapFeeToken
string^0x(?!0{40})[a-fA-F0-9]{40}$

The contract address of the token to receive trading fees in. This must be set to the value of either the buyToken or the sellToken. You must also specify the swapFeeRecipient and swapFeeBps in the request to use this feature

tradeSurplusRecipient
string^0x[a-fA-F0-9]{40}$

The address to receive any trade surplus. If specified, this address will receive trade surplus when applicable. Otherwise, the taker will receive the surplus

slippageBps
integer [ 30 .. 10000 ]

The maximum acceptable slippage of the buyToken in Bps. 0x sets the optimal slippage tolerance per trade by default. To mitigate the risk of MEV attacks, we recommend adjusting this value only when trading low-liquidity tokens.

excludedSources
string

Liquidity sources e.g. Uniswap_V3, SushiSwap, 0x_RFQ to exclude from the provided quote. See https://api.0x.org/sources?chainId= with the desired chain's ID for a full list of sources. Separate multiple sources with a comma

header Parameters
0x-api-key
required
string

Visit dashboard.0x.org to get your API Key

0x-version
required
string
Example: v2

API version

Responses

Response samples

Content type
application/json
{
  • "blockNumber": "20114764",
  • "buyAmount": "291527064",
  • "buyToken": "0xdac17f958d2ee523a2206206994597c13d831ec7",
  • "fees": {
    },
  • "issues": {
    },
  • "liquidityAvailable": true,
  • "minBuyAmount": "290652483",
  • "route": {
    },
  • "sellAmount": "300000000",
  • "sellToken": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
  • "target": "0x7c39a136ea20b3483e402ea031c1f3c019bab24b",
  • "tokenMetadata": {
    },
  • "zid": "0x111111111111111111111111"
}

getQuote

Get the firm quote for a gasless swap

query Parameters
chainId
required
integer > 0
Example: chainId=1

Chain ID. See here for the list of supported chains

buyToken
required
string^0x(?!0{40})[a-fA-F0-9]{40}$
Example: buyToken=0xdac17f958d2ee523a2206206994597c13d831ec7

The contract address of the token to buy

sellToken
required
string^0x(?!0{40})[a-fA-F0-9]{40}$
Example: sellToken=0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48

The contract address of the token to sell. Native token is not supported

sellAmount
required
string
Example: sellAmount=300000000

The amount of sellToken in sellToken base units to sell

taker
required
string^0x[a-fA-F0-9]{40}$
Example: taker=0x70a9f34f9b34c64957b9c401a97bfed35b95049e

The address which holds the sellToken balance and has the allowance set for the swap

swapFeeRecipient
string^0x[a-fA-F0-9]{40}$

The wallet address to receive the specified trading fees. You must also specify the swapFeeToken and swapFeeBps in the request to use this feature. Learn more about setting up a trading fee/commission in the FAQs

swapFeeBps
integer [ 0 .. 10000 ]

The amount in Bps of the swapFeeToken to charge and deliver to the swapFeeRecipient. You must also specify the swapFeeRecipient and swapFeeToken in the request to use this feature. For security, this field has a default limit of 1000 Bps. If your application requires a higher value, please reach out to us.

swapFeeToken
string^0x(?!0{40})[a-fA-F0-9]{40}$

The contract address of the token to receive trading fees in. This must be set to the value of either the buyToken or the sellToken. You must also specify the swapFeeRecipient and swapFeeBps in the request to use this feature

tradeSurplusRecipient
string^0x[a-fA-F0-9]{40}$

The address to receive any trade surplus. If specified, this address will receive trade surplus when applicable. Otherwise, the taker will receive the surplus

slippageBps
integer [ 30 .. 10000 ]

The maximum acceptable slippage of the buyToken in Bps. 0x sets the optimal slippage tolerance per trade by default. To mitigate the risk of MEV attacks, we recommend adjusting this value only when trading low-liquidity tokens.

excludedSources
string

Liquidity sources e.g. Uniswap_V3, SushiSwap, 0x_RFQ to exclude from the provided quote. See https://api.0x.org/sources?chainId= with the desired chain's ID for a full list of sources. Separate multiple sources with a comma

header Parameters
0x-api-key
required
string

Visit dashboard.0x.org to get your API Key

0x-version
required
string
Example: v2

API version

Responses

Response samples

Content type
application/json
{
  • "approval": {
    },
  • "blockNumber": "20114747",
  • "buyAmount": "292995086",
  • "buyToken": "0xdac17f958d2ee523a2206206994597c13d831ec7",
  • "fees": {
    },
  • "issues": {
    },
  • "liquidityAvailable": true,
  • "minBuyAmount": "292116101",
  • "route": {
    },
  • "sellAmount": "300000000",
  • "sellToken": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
  • "target": "0x7c39a136ea20b3483e402ea031c1f3c019bab24b",
  • "tokenMetadata": {
    },
  • "trade": {
    },
  • "zid": "0x111111111111111111111111"
}

submit

Submit a gasless swap

header Parameters
0x-api-key
required
string

Visit dashboard.0x.org to get your API Key

0x-version
required
string
Example: v2

API version

Request Body schema: application/json
required
chainId
required
integer > 0

Chain ID. See here for the list of supported chains

object or null

The gasless approval object from the quote endpoint including its signature

required
object

The trade object from the quote endpoint including its signature

Responses

Request samples

Content type
application/json
{
  • "approval": {
    },
  • "chainId": 8453,
  • "trade": {
    }
}

Response samples

Content type
application/json
{
  • "tradeHash": "0xcb3285b35c024fca76037bea9ea4cb68645fed3bdd84030956577de2f1592aa9",
  • "type": "settler_metatransaction",
  • "zid": "0x111111111111111111111111"
}

getStatus

Get the status of a gasless swap

path Parameters
tradeHash
required
string
Example: 0x6c89e4ac46b246ab72cba02a9fb4f3525b9f8a11ea74262d5dd8ff0e024daf60

The hash for the trade according to EIP-712

query Parameters
chainId
required
integer > 0
Example: chainId=8453

here for the list of supported chains

header Parameters
0x-api-key
required
string

Visit dashboard.0x.org to get your API Key

0x-version
required
string
Example: v2

API version

Responses

Response samples

Content type
application/json
{
  • "status": "confirmed",
  • "transactions": [
    ],
  • "zid": "0x111111111111111111111111"
}

getGaslessApprovalTokens

Get token addresses that support gasless approvals

query Parameters
chainId
required
integer > 0
Example: chainId=8453

Chain ID. See here for the list of supported chains

header Parameters
0x-api-key
required
string

Visit dashboard.0x.org to get your API Key

0x-version
required
string
Example: v2

API version

Responses

Response samples

Content type
application/json
{
  • "tokens": [
    ],
  • "zid": "0x111111111111111111111111"
}

getChains

Get list of supported chains for gasless

header Parameters
0x-api-key
required
string

Visit dashboard.0x.org to get your API Key

0x-version
required
string
Example: v2

API version

Responses

Response samples

Content type
application/json
[
  • {
    },
  • {
    },
  • {
    },
  • {
    },
  • {
    },
  • {
    },
  • {
    },
  • {
    },
  • {
    },
  • {
    },
  • {
    }
]

Sources

Sources API endpoints

getSources

Get the list of supported sources

query Parameters
chainId
required
integer > 0
Example: chainId=1

Chain ID. See here for the list of supported chains

header Parameters
0x-api-key
required
string

Visit dashboard.0x.org to get your API Key

0x-version
required
string
Example: v2

API version

Responses

Response samples

Content type
application/json
{
  • "sources": [
    ],
  • "zid": "0x111111111111111111111111"
}

Trade Analytics

Trade Analytics API endpoints

getSwapTrades

Get the list of completed swap trades. Returns a maximum of 200 trades per request.

query Parameters
cursor
string
Example: cursor=eyJ0aW1lc3RhbXAiOjE3MjkwMzIyMTAsInppZCI6IjB4N2FjM2NlMzExNjA2NzU5MGY5M2U3MWVmIn0=

The cursor to start fetching trades from

startTimestamp
integer > 0
Example: startTimestamp=1729032210

Unix timestamp in seconds, specifying the starting point of the time range filter. Only trades completed on or after this timestamp will be included in the response.

endTimestamp
integer > 0
Example: endTimestamp=1729032211

Unix timestamp in seconds, specifying the end point of the time range filter. Only trades completed on or before this timestamp will be included in the response.

header Parameters
0x-api-key
required
string

Visit dashboard.0x.org to get your API Key

0x-version
required
string
Example: v2

API version

Responses

Response samples

Content type
application/json
{
  • "nextCursor": null,
  • "trades": [
    ],
  • "zid": "0xaaaaaae1b3bf43f082d5012d"
}

getGaslessTrades

Get the list of completed gasless trades. Returns a maximum of 200 trades per request.

query Parameters
cursor
string
Example: cursor=eyJ0aW1lc3RhbXAiOjE3MjkwMzIyMTAsInppZCI6IjB4N2FjM2NlMzExNjA2NzU5MGY5M2U3MWVmIn0=

The cursor to start fetching trades from

startTimestamp
integer > 0
Example: startTimestamp=1729032210

Unix timestamp in seconds, specifying the starting point of the time range filter. Only trades completed on or after this timestamp will be included in the response.

endTimestamp
integer > 0
Example: endTimestamp=1729032211

Unix timestamp in seconds, specifying the end point of the time range filter. Only trades completed on or before this timestamp will be included in the response.

header Parameters
0x-api-key
required
string

Visit dashboard.0x.org to get your API Key

0x-version
required
string
Example: v2

API version

Responses

Response samples

Content type
application/json
{
  • "nextCursor": null,
  • "trades": [
    ],
  • "zid": "0xaaaaaae1b3bf43f082d5012d"
}