> For the complete documentation index, see [llms.txt](https://docs.zert.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.zert.com/integration-example/discovery-and-quote.md).

# Discovery: chains, tokens, and pairs

Use the discovery endpoints to fetch supported chains, tokens, and tradeable pairs before building quote requests.

## Step 0: Health check (optional)

Verify the gateway is up with `GET /health` (no auth required). See [Health Check](https://docs.zert.com/health-check.md).

## Step 1: List chains

Get all enabled chains to build chain selectors or validate `fromChain` / `toChain`.

```bash
curl -X GET 'https://api.gateway.zert.com/api/v1/chains' \
  -H 'Authorization: Bearer YOUR_API_KEY'
```

Response:

```json
{
  "data": {
    "chains": [
      { "id": "eth-mainnet", "name": "Ethereum Mainnet" },
      { "id": "polygon-mainnet", "name": "Polygon" }
    ]
  },
  "meta": { "requestId": "...", "timestamp": "..." }
}
```

Use `id` values as chain identifiers in quote and status calls.

## Step 2: List tokens (optional)

Filter tokens by chain or search by symbol/name. Use results to build token selectors and validate token availability.

```bash
# All tokens on Ethereum, limit 20
curl -X GET 'https://api.gateway.zert.com/api/v1/tokens?chainRef=eth-mainnet&limit=20' \
  -H 'Authorization: Bearer YOUR_API_KEY'

# Search by symbol
curl -X GET 'https://api.gateway.zert.com/api/v1/tokens?q=USDC&limit=50' \
  -H 'Authorization: Bearer YOUR_API_KEY'
```

Response includes `data.tokens` with fields like `chain`, `symbol`, `name`, `address`, `decimals`, and an optional `nextCursor`.

## Step 3: List pairs (optional)

Get tradeable pairs for a chain or token to validate or suggest quote inputs.

```bash
# Pairs on Ethereum with USDC as input
curl -X GET 'https://api.gateway.zert.com/api/v1/pairs?chainRef=eth-mainnet&tokenIn=USDC&limit=50' \
  -H 'Authorization: Bearer YOUR_API_KEY'
```

Response includes `data.pairs` with `fromChain`, `toChain`, `tokenIn`, `tokenOut`, and an optional `nextCursor`.

## Step 4: Request a quote

Use discovered chain identifiers and token identifiers in `POST /quote`:

```bash
curl -X POST 'https://api.gateway.zert.com/api/v1/quote' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -d '{
    "fromChain": "solana",
    "toChain": "avax",
    "tokenIn": "SOL",
    "tokenOut": "WETH",
    "network": "mainnet",
    "amount": "100.00"
  }'
```

## Summary

| Step | Endpoint      | Purpose                                  |
| ---- | ------------- | ---------------------------------------- |
| 0    | `GET /health` | Optional health check (no auth)          |
| 1    | `GET /chains` | Get supported chain identifiers          |
| 2    | `GET /tokens` | Get tokens by chain or search            |
| 3    | `GET /pairs`  | Get tradeable pairs for validation or UX |
| 4    | `POST /quote` | Get route summaries for a swap idea      |

See [Health Check](https://docs.zert.com/health-check.md), [List Chains](https://docs.zert.com/api-reference/discovery/list-chains.md), [List Tokens](https://docs.zert.com/api-reference/discovery/list-tokens.md), [List Pairs](https://docs.zert.com/api-reference/discovery/list-pairs.md), and [Request Quote](https://docs.zert.com/api-reference/swap/request-quote.md) for full parameters and responses.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.zert.com/integration-example/discovery-and-quote.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
