> ## Documentation Index
> Fetch the complete documentation index at: https://sonar-cf3aeac7.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Introduction

> ChainQuery is a real-time market data API for EVM decentralized exchanges: tokens, pools, candles, trades, wallets and live streams.

ChainQuery indexes swaps from decentralized exchanges and launchpads on EVM chains, prices every trade in USD, and serves the results as market data. Use it to build token pages, price charts, trade feeds, portfolio views, token discovery boards and alerting bots.

The API has four surfaces. They share the same chains, addresses and token model, so you can mix them freely: load history over REST, then keep it current over a WebSocket.

> [card] [REST API](https://sonar-cf3aeac7.mintlify.site/api-reference/overview.md)
>
> Token details, markets (pools), OHLCV candles, price history, cursor-paginated trades, wallet holdings, search and the protocol catalogue.
>
> `https://api.example.com/api/v1`

> [card] [Channel WebSocket](https://sonar-cf3aeac7.mintlify.site/websocket/overview.md)
>
> Subscribe to live trades, token details, market (pool) details and candles for the tokens or pools you follow. Resumable with cursors.
>
> `wss://api.example.com/v1/ws`

> [card] [Pulse discovery](https://sonar-cf3aeac7.mintlify.site/pulse/overview.md)
>
> Ranked token feeds such as new launches, about-to-bond, bonded and trending, plus custom views built from filters and a sort. Available over REST and as a live stream.
>
> `wss://api.example.com/v1/ws/pulse`

> [card] [Multi-events stream](https://sonar-cf3aeac7.mintlify.site/streams/overview.md)
>
> One subscription for every trade across one or more chains, narrowed with a filter language (pools, tokens, wallets, side, USD size).
>
> `wss://api.example.com/streams/v1/ws`

## Which surface should I use?

| You want to | Use |
| - | - |
| Show a token page, pool page or chart on load | [REST](https://sonar-cf3aeac7.mintlify.site/api-reference/overview.md): `GET /token`, `GET /token/markets`, `GET /token/ohlcv` |
| Page through historical trades | [REST](https://sonar-cf3aeac7.mintlify.site/api-reference/trades/get-trades.md): `GET /trades` with a cursor |
| Keep a token page, pool page or chart live | [Channel WebSocket](https://sonar-cf3aeac7.mintlify.site/websocket/overview.md): `fast-trade`, `token-details`, `market-details`, `ohlcv` |
| Show a "new pairs" or "trending" board | [Pulse](https://sonar-cf3aeac7.mintlify.site/pulse/overview.md): REST views for a one-off list, the Pulse stream for a live board |
| Watch every trade on a chain, or every trade by a set of wallets | [Multi-events stream](https://sonar-cf3aeac7.mintlify.site/streams/overview.md) |

## Supported chains at a glance

| Chain | Chain id | Native token |
| - | - | - |
| Ethereum | `1` (`evm:1`) | ETH |
| Base | `8453` (`evm:8453`) | ETH |
| BNB Smart Chain | `56` (`evm:56`) | BNB |
| Robinhood | `4663` (`evm:4663`) | ETH |

REST accepts a chain as `8453` or `evm:8453`. The WebSocket surfaces only accept `evm:8453`. See [Chains and identifiers](https://sonar-cf3aeac7.mintlify.site/concepts/chains-and-identifiers.md) for the exact rules on each surface.

## Before you start

> [!NOTE]
>
> **There is no authentication.** The API does not currently read any API key, token or header, so you can call it directly. This may change in the future.

> [card] [Quickstart](https://sonar-cf3aeac7.mintlify.site/quickstart.md)
>
> Make your first REST calls and open a live trade subscription in a few minutes.

> [card] [Responses and errors](https://sonar-cf3aeac7.mintlify.site/concepts/responses-and-errors.md)
>
> The success and error envelopes, and every error code.

> [card] [Data formats](https://sonar-cf3aeac7.mintlify.site/concepts/data-formats.md)
>
> Numbers vs strings, percent units, timestamps and booleans.

> [card] [How data flows](https://sonar-cf3aeac7.mintlify.site/concepts/how-data-flows.md)
>
> How swaps become prices, stats, candles and stream events.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.