For the complete documentation index, see llms.txt. This page is also available as Markdown.

Swaps

Swap quotes, approval checks, and executable calldata. The API prices and builds the transaction; your wallet signs and submits it.

The swap endpoints price a trade and hand back an unsigned transaction your wallet then submits — the API never holds funds or keys. The usual flow is: quote → check approval → fetch calldata → submit from your wallet. Some routes proxy the Uniswap Trading API behind the scenes.

These are POST endpoints because they take a request body describing the trade. They return data (a quote, an approval action, or calldata); they do not execute anything on-chain themselves.

Quote and approval

post
Path parameters
chainstring · min: 1Required
Body
typestring · enumOptionalDefault: EXACT_INPUTPossible values:
amountstringRequiredPattern: ^(0|[1-9][0-9]*)$
tokenInstringRequiredPattern: ^0x[a-fA-F0-9]{40}$
tokenOutstringRequiredPattern: ^0x[a-fA-F0-9]{40}$
takerstringRequiredPattern: ^0x[a-fA-F0-9]{40}$
recipientstringOptionalPattern: ^0x[a-fA-F0-9]{40}$
slippageBpsinteger · max: 10000OptionalDefault: 100
generatePermitAsTransactionbooleanOptionalDefault: false
permitAmountstring · enumOptionalDefault: FULLPossible values:
Responses
200

Default Response

application/json
chainIdinteger · min: -9007199254740991 · max: 9007199254740991Required
requestIdstringRequired
routingstringRequired
quoteIdstring · nullableRequired
typestring · enumRequiredPossible values:
tokenInstringRequiredPattern: ^0x[a-fA-F0-9]{40}$
tokenOutstringRequiredPattern: ^0x[a-fA-F0-9]{40}$
amountstringRequiredPattern: ^(0|[1-9][0-9]*)$
takerstringRequiredPattern: ^0x[a-fA-F0-9]{40}$
recipientstring · nullableOptionalPattern: ^0x[a-fA-F0-9]{40}$
slippageBpsinteger · min: -9007199254740991 · max: 9007199254740991Required
gasFeestring · nullableOptionalPattern: ^(0|[1-9][0-9]*)$
gasFeeUsdstring · nullableOptional
priceImpactnumber · nullableOptional
routeStringstring · nullableOptional
routeSymbolsstring[] · nullableOptional
permitDataany · nullableRequired
permitGasFeestring · nullableOptionalPattern: ^(0|[1-9][0-9]*)$
quoteanyRequired
issuedAtstringRequired
expiresAtstringRequired
post/v1/{chain}/swaps/quote
POST /v1/{chain}/swaps/quote HTTP/1.1
Host: api.nftx.io
Content-Type: application/json
Accept: */*
Content-Length: 183

{
  "type": "EXACT_INPUT",
  "amount": "text",
  "tokenIn": "text",
  "tokenOut": "text",
  "taker": "text",
  "recipient": "text",
  "slippageBps": 100,
  "generatePermitAsTransaction": false,
  "permitAmount": "FULL"
}
{
  "chainId": 1,
  "requestId": "text",
  "routing": "text",
  "quoteId": "text",
  "type": "EXACT_INPUT",
  "tokenIn": "text",
  "tokenOut": "text",
  "amount": "text",
  "taker": "text",
  "recipient": "text",
  "slippageBps": 1,
  "input": {
    "token": "text",
    "amount": "text",
    "maximumAmount": "text",
    "minimumAmount": "text",
    "recipient": "text"
  },
  "output": {
    "token": "text",
    "amount": "text",
    "maximumAmount": "text",
    "minimumAmount": "text",
    "recipient": "text"
  },
  "gasFee": "text",
  "gasFeeUsd": "text",
  "priceImpact": 1,
  "routeString": "text",
  "routeSymbols": [
    "text"
  ],
  "permitTransaction": {
    "to": "text",
    "from": "text",
    "data": "text",
    "value": "text",
    "chainId": 1,
    "gasLimit": "text",
    "maxFeePerGas": "text",
    "maxPriorityFeePerGas": "text",
    "gasPrice": "text"
  },
  "permitData": null,
  "permitGasFee": "text",
  "quote": null,
  "issuedAt": "text",
  "expiresAt": "text"
}
post
Path parameters
chainstring · min: 1Required
Body
walletAddressstringRequiredPattern: ^0x[a-fA-F0-9]{40}$
tokenstringRequiredPattern: ^0x[a-fA-F0-9]{40}$
amountstringRequiredPattern: ^(0|[1-9][0-9]*)$
includeGasInfobooleanOptionalDefault: true
tokenOutstringOptionalPattern: ^0x[a-fA-F0-9]{40}$
tokenOutChainIdinteger · max: 9007199254740991Optional
Responses
200

Default Response

application/json
chainIdinteger · min: -9007199254740991 · max: 9007199254740991Required
requestIdstringRequired
gasFeestring · nullableOptionalPattern: ^(0|[1-9][0-9]*)$
cancelGasFeestring · nullableOptionalPattern: ^(0|[1-9][0-9]*)$
post/v1/{chain}/swaps/check-approval
POST /v1/{chain}/swaps/check-approval HTTP/1.1
Host: api.nftx.io
Content-Type: application/json
Accept: */*
Content-Length: 115

{
  "walletAddress": "text",
  "token": "text",
  "amount": "text",
  "includeGasInfo": true,
  "tokenOut": "text",
  "tokenOutChainId": 1
}
{
  "chainId": 1,
  "requestId": "text",
  "approval": {
    "to": "text",
    "from": "text",
    "data": "text",
    "value": "text",
    "chainId": 1,
    "gasLimit": "text",
    "maxFeePerGas": "text",
    "maxPriorityFeePerGas": "text",
    "gasPrice": "text"
  },
  "cancel": {
    "to": "text",
    "from": "text",
    "data": "text",
    "value": "text",
    "chainId": 1,
    "gasLimit": "text",
    "maxFeePerGas": "text",
    "maxPriorityFeePerGas": "text",
    "gasPrice": "text"
  },
  "gasFee": "text",
  "cancelGasFee": "text"
}

Calldata and plans

post
Path parameters
chainstring · min: 1Required
Body
quoteanyRequired
permitDataany · nullableOptional
signaturestringOptionalPattern: ^0x[0-9a-fA-F]*$
refreshGasPricebooleanOptionalDefault: true
simulateTransactionbooleanOptionalDefault: true
deadlineinteger · max: 9007199254740991Optional
Responses
200

Default Response

application/json
chainIdinteger · min: -9007199254740991 · max: 9007199254740991Required
requestIdstringRequired
gasFeestring · nullableOptionalPattern: ^(0|[1-9][0-9]*)$
post/v1/{chain}/swaps/calldata
POST /v1/{chain}/swaps/calldata HTTP/1.1
Host: api.nftx.io
Content-Type: application/json
Accept: */*
Content-Length: 321

{
  "quote": null,
  "permitData": null,
  "signature": "text",
  "expected": {
    "requestId": "text",
    "routing": "text",
    "quoteId": "text",
    "type": "EXACT_INPUT",
    "amount": "text",
    "tokenIn": "text",
    "tokenOut": "text",
    "taker": "text",
    "recipient": "text",
    "slippageBps": 1,
    "expiresAt": "text"
  },
  "refreshGasPrice": true,
  "simulateTransaction": true,
  "deadline": 1
}
{
  "chainId": 1,
  "requestId": "text",
  "swap": {
    "to": "text",
    "from": "text",
    "data": "text",
    "value": "text",
    "chainId": 1,
    "gasLimit": "text",
    "maxFeePerGas": "text",
    "maxPriorityFeePerGas": "text",
    "gasPrice": "text"
  },
  "gasFee": "text"
}
post
Path parameters
chainstring · min: 1Required
Body
collectionstringRequiredPattern: ^0x[a-fA-F0-9]{40}$
tokenIdsstring[] · min: 1 · max: 50Optional
quantityinteger · min: 1 · max: 50OptionalDefault: 1
takerstringOptionalPattern: ^0x[a-fA-F0-9]{40}$
slippageBpsinteger · max: 10000OptionalDefault: 100
Responses
400

Default Response

application/json
post/v1/{chain}/swaps/buy-from-pool/plan
POST /v1/{chain}/swaps/buy-from-pool/plan HTTP/1.1
Host: api.nftx.io
Content-Type: application/json
Accept: */*
Content-Length: 87

{
  "collection": "text",
  "tokenIds": [
    "text"
  ],
  "quantity": 1,
  "taker": "text",
  "slippageBps": 100
}
{
  "error": {
    "code": "text",
    "message": "text",
    "details": null,
    "requestId": "text"
  }
}
post
Path parameters
chainstring · min: 1Required
Body
fromCollectionstringRequiredPattern: ^0x[a-fA-F0-9]{40}$
toCollectionstringRequiredPattern: ^0x[a-fA-F0-9]{40}$
tokenIdsstring[] · min: 1 · max: 50Required
takerstringOptionalPattern: ^0x[a-fA-F0-9]{40}$
slippageBpsinteger · max: 10000OptionalDefault: 100
Responses
400

Default Response

application/json
post/v1/{chain}/swaps/cross-collection/plan
POST /v1/{chain}/swaps/cross-collection/plan HTTP/1.1
Host: api.nftx.io
Content-Type: application/json
Accept: */*
Content-Length: 100

{
  "fromCollection": "text",
  "toCollection": "text",
  "tokenIds": [
    "text"
  ],
  "taker": "text",
  "slippageBps": 100
}
{
  "error": {
    "code": "text",
    "message": "text",
    "details": null,
    "requestId": "text"
  }
}

Last updated

Was this helpful?