Need help with your APIs? I offer API discovery, governance & evangelism services. Explore services →
API Evangelist API Evangelist
Discovery
Learnings
Guidance
Toolbox
Alignment
API Evangelist LLC

0x Swap API

Swap API endpoints

0x Swap API is one of 5 APIs that 0x publishes on the APIs.io network, described by a machine-readable OpenAPI specification.

Tagged areas include Swap. The published artifact set on APIs.io includes an OpenAPI specification, API documentation, and code examples.

This API exposes 5 operations across 5 paths, and defines 12 schemas. It is described by OpenAPI 3.0.3, at version v2.

Requests are made against a single base URL, https://api.0x.org.

5 operations 5 paths 12 schemas 5 GET

Metadata

The identity and technical contract details declared by the specification.

Specification
OpenAPI 3.0.3
API Version
v2
Base URL
https://api.0x.org
Authentication
API Key
Resource Areas
1

Authentication & Security 1

0x Swap API declares 1 security scheme for authenticating requests. An API key is passed in the header as 0x-api-key (ApiKeyAuth).

Paths & Operations 5

Across 5 paths, the API surfaces 5 operations — 5 GET. Each is listed below with its method, path, parameters, and response codes.

Swap 5

Swap API endpoints

GET
/swap/allowance-holder/price
Get Price (Allowance Holder)
swap::allowanceHolder::getPrice 21 params → 200400403422500
GET
/swap/allowance-holder/quote
Get Quote (Allowance Holder)
swap::allowanceHolder::getQuote 21 params → 200400403422500
GET
/swap/permit2/price
Get Price (Permit2)
swap::permit2::getPrice 21 params → 200400403422500
GET
/swap/permit2/quote
Get Quote (Permit2)
swap::permit2::getQuote 21 params → 200400403422500
GET
/swap/chains
Get Supported Chains
swap::chains 2 params → 200500

Schemas 12

The contract defines 12 schemas that model the data the API accepts and returns. The most detailed are SELL_TOKEN_NOT_AUTHORIZED_FOR_TRADE (3 properties), RECIPIENT_NOT_SUPPORTED (3 properties), TAKER_NOT_AUTHORIZED_FOR_TRADE (3 properties), USER_NOT_AUTHORIZED (3 properties). Each schema is shown below with its type and property counts.

SELL_TOKEN_NOT_AUTHORIZED_FOR_TRADE
object
3 properties 3 required
UNCATEGORIZED
object
3 properties 3 required
BUY_TOKEN_NOT_AUTHORIZED_FOR_TRADE
object
3 properties 3 required
RECIPIENT_NOT_AUTHORIZED_FOR_TRADE
object
3 properties 3 required
XSTOCKS_NOT_AUTHORIZED
object
3 properties 3 required
SWAP_VALIDATION_FAILED
object
3 properties 3 required
TOKEN_NOT_SUPPORTED
object
3 properties 3 required
INPUT_INVALID
object
3 properties 3 required
USER_NOT_AUTHORIZED
object
3 properties 3 required
TAKER_NOT_AUTHORIZED_FOR_TRADE
object
3 properties 3 required
RECIPIENT_NOT_SUPPORTED
object
3 properties 3 required
INTERNAL_SERVER_ERROR
object
3 properties 3 required

Specification

The full machine-readable OpenAPI contract behind this narrative.

Source

0x-swap-api-openapi.yml Raw ↑

Other APIs 0x publishes across the network.

0x Cross-Chain API
0x Gasless API
0x Sources API
0x Trade Analytics API