Public API¶
The Cantex Public API is a set of REST endpoints that require no authentication, no API key and no account. Use it to discover tradable tokens and markets, read exchange fees and policy, pull exchange statistics and request quotes for Cantex Connect swaps.
Base URLs¶
| Network | Base URL |
|---|---|
| Mainnet | https://api.cantex.io/v1/public |
| Testnet | https://api.testnet.cantex.io/v1/public |
All endpoint paths on the following pages are relative to these base URLs.
Endpoints¶
| Endpoint | Method | Description |
|---|---|---|
/tokens/info |
GET | All tokens known to Cantex |
/swap/info |
GET | Tradable tokens and the network fee instrument |
/markets/info |
GET | Market symbols, candle periods and websocket channels |
/exchange/info |
GET | Current fees and exchange policy |
/pools/info |
GET | Available liquidity pools |
/stats |
GET | Volume, TVL and trader statistics |
/connect/quote |
POST | Price quote and memo for a Cantex Connect swap |
Conventions¶
Requests. GET endpoints take no parameters. POST endpoints expect a JSON body with a Content-Type: application/json header. All endpoints answer CORS preflight requests, so they can be called directly from a browser.
Amounts are strings. All token amounts, prices and fees are returned as decimal strings (for example "amount": "2.0000"), and request amounts must also be sent as strings. Parse them with a decimal type — do not use floating point for token amounts.
Instruments are identified by a pair. A token on Canton is identified by its instrument_id together with its instrument_admin (the Canton party that administers the instrument). Both are required wherever an instrument is referenced. Use /tokens/info to look up the pairs for the tokens you care about.
Timestamps are ISO 8601 strings in UTC, e.g. "2026-08-20T12:34:56.789012+00:00".
Errors¶
Successful responses return HTTP 200. Failures return a 4xx status with a JSON body describing the problem.
Validation failures name the offending field:
Unexpected server-side failures return a short error code plus a trace_id you can share with us when reporting an issue:
Caching and rate limits¶
Responses from the GET endpoints are cached server-side — from a few seconds (/markets/info, /exchange/info) up to several minutes (/swap/info) — so polling them faster than that returns the same data. A polling interval of 5–10 seconds is more than enough for market metadata; be considerate with request rates.
Info
For live prices, use the public websocket rather than polling. /markets/info returns the websocket endpoint and the channel names for ticker and candle streams. Full websocket documentation is coming soon.