0x · Schema

0x Swap Quote

A firm quote returned by /swap/allowance-holder/quote and /swap/permit2/quote. Includes the calldata required to submit the swap on-chain.

CryptocurrencyDeFiDEX AggregatorSwapGaslessCross-ChainPermit2LiquidityTrade AnalyticsWeb3SettlementSmart Contracts

Properties

Name Type Description
liquidityAvailable boolean Whether liquidity is available for the requested pair.
chainId integer Chain ID the quote was generated for.
buyToken string Contract address of the buy token.
sellToken string Contract address of the sell token.
buyAmount string Amount of buyToken returned, in base units.
sellAmount string Amount of sellToken charged, in base units.
minBuyAmount string Minimum buyToken amount after slippage tolerance.
blockNumber string Block at which liquidity was sampled.
allowanceTarget stringnull Contract the taker must approve to spend sellToken. Null for native asset and wrap/unwrap.
transaction object Pre-built calldata for submission to the network.
route object Routing detail: which liquidity sources were used and at what fill percentage.
fees object Detailed fee breakdown (integrator fee, zero-ex fee, gas fee).
issues object Allowance, balance, or signature issues blocking submission.
permit2 objectnull Permit2 EIP-712 typed data the taker must sign (Permit2 flow only).
totalNetworkFee stringnull Total network fee in native token base units.
gas stringnull
gasPrice stringnull
expiration integer Unix timestamp when this quote expires.
View JSON Schema on GitHub

JSON Schema

0x-swap-quote-schema.json Raw ↑
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/0x/main/json-schema/0x-swap-quote-schema.json",
  "title": "0x Swap Quote",
  "description": "A firm quote returned by /swap/allowance-holder/quote and /swap/permit2/quote. Includes the calldata required to submit the swap on-chain.",
  "x-schema-source": "openapi",
  "x-source-url": "openapi/0x-api.yaml#/components/schemas",
  "type": "object",
  "properties": {
    "liquidityAvailable": {
      "type": "boolean",
      "description": "Whether liquidity is available for the requested pair."
    },
    "chainId": {
      "type": "integer",
      "description": "Chain ID the quote was generated for."
    },
    "buyToken": {
      "type": "string",
      "pattern": "^0x[a-fA-F0-9]{40}$",
      "description": "Contract address of the buy token."
    },
    "sellToken": {
      "type": "string",
      "pattern": "^0x[a-fA-F0-9]{40}$",
      "description": "Contract address of the sell token."
    },
    "buyAmount": {
      "type": "string",
      "pattern": "^[0-9]+$",
      "description": "Amount of buyToken returned, in base units."
    },
    "sellAmount": {
      "type": "string",
      "pattern": "^[0-9]+$",
      "description": "Amount of sellToken charged, in base units."
    },
    "minBuyAmount": {
      "type": "string",
      "pattern": "^[0-9]+$",
      "description": "Minimum buyToken amount after slippage tolerance."
    },
    "blockNumber": {
      "type": "string",
      "pattern": "^[0-9]+$",
      "description": "Block at which liquidity was sampled."
    },
    "allowanceTarget": {
      "type": [
        "string",
        "null"
      ],
      "pattern": "^0x[a-fA-F0-9]{40}$",
      "description": "Contract the taker must approve to spend sellToken. Null for native asset and wrap/unwrap."
    },
    "transaction": {
      "type": "object",
      "description": "Pre-built calldata for submission to the network.",
      "properties": {
        "to": {
          "type": "string",
          "pattern": "^0x[a-fA-F0-9]{40}$"
        },
        "data": {
          "type": "string",
          "pattern": "^0x[a-fA-F0-9]+$"
        },
        "gas": {
          "type": "string",
          "pattern": "^[0-9]+$"
        },
        "gasPrice": {
          "type": "string",
          "pattern": "^[0-9]+$"
        },
        "value": {
          "type": "string",
          "pattern": "^[0-9]+$"
        }
      },
      "required": [
        "to",
        "data",
        "gas",
        "value"
      ]
    },
    "route": {
      "type": "object",
      "description": "Routing detail: which liquidity sources were used and at what fill percentage.",
      "properties": {
        "fills": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "source": {
                "type": "string"
              },
              "from": {
                "type": "string",
                "pattern": "^0x[a-fA-F0-9]{40}$"
              },
              "to": {
                "type": "string",
                "pattern": "^0x[a-fA-F0-9]{40}$"
              },
              "proportionBps": {
                "type": "integer"
              }
            }
          }
        },
        "tokens": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "address": {
                "type": "string",
                "pattern": "^0x[a-fA-F0-9]{40}$"
              },
              "symbol": {
                "type": "string"
              }
            }
          }
        }
      }
    },
    "fees": {
      "type": "object",
      "description": "Detailed fee breakdown (integrator fee, zero-ex fee, gas fee).",
      "properties": {
        "integratorFee": {
          "type": [
            "object",
            "null"
          ]
        },
        "zeroExFee": {
          "type": [
            "object",
            "null"
          ]
        },
        "gasFee": {
          "type": [
            "object",
            "null"
          ]
        }
      }
    },
    "issues": {
      "type": "object",
      "description": "Allowance, balance, or signature issues blocking submission.",
      "properties": {
        "allowance": {
          "type": [
            "object",
            "null"
          ]
        },
        "balance": {
          "type": [
            "object",
            "null"
          ]
        },
        "simulationIncomplete": {
          "type": "boolean"
        },
        "invalidSourcesPassed": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "permit2": {
      "type": [
        "object",
        "null"
      ],
      "description": "Permit2 EIP-712 typed data the taker must sign (Permit2 flow only).",
      "properties": {
        "type": {
          "const": "Permit2"
        },
        "hash": {
          "type": "string"
        },
        "eip712": {
          "type": "object"
        }
      }
    },
    "totalNetworkFee": {
      "type": [
        "string",
        "null"
      ],
      "pattern": "^[0-9]+$",
      "description": "Total network fee in native token base units."
    },
    "gas": {
      "type": [
        "string",
        "null"
      ],
      "pattern": "^[0-9]+$"
    },
    "gasPrice": {
      "type": [
        "string",
        "null"
      ],
      "pattern": "^[0-9]+$"
    },
    "expiration": {
      "type": "integer",
      "description": "Unix timestamp when this quote expires."
    }
  },
  "required": [
    "liquidityAvailable"
  ]
}

Work with this as data

Every JSON Schema here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for schemas

4 MCP tools reach this
  • find_json_schemasBrowse and filter every JSON Schema in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This JSON Schema
curl "https://apis.io/api/v1/json-schemas/0x-swap-quote"
All schemas
curl "https://apis.io/api/v1/json-schemas?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.