> ## 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.

# Search

> Search tokens, pools and cross-chain assets by name, symbol or address, or list the top pools.

Finds tokens, pools or assets that match a text or address. With an empty `input`, `type=pools` and `type=all` return the current top pools instead, which is useful for a default list before the user types.

## Query parameters

**input** `string`

Search text or address, at most 100 characters. Leading and trailing spaces are trimmed. **Required (non-empty) unless `type` is `pools` or `all`.** See [How `input` is matched](#how-input-is-matched).

**type** `string` (default: tokens)

What to search. One of `tokens`, `pools`, `assets`, `all`. The shape of `data` depends on it (see [Response](#response)).

**chains** `string`

Comma-separated chain IDs to search, for example `1,8453` or `evm:1,evm:8453`. Defaults to all chains. See [Chains and identifiers](https://sonar-cf3aeac7.mintlify.site/concepts/chains-and-identifiers.md). For `type=assets` it only filters each asset's `tokens` list, not the assets themselves.

**limit** `integer` (default: 10)

Maximum number of results. Between `1` and `20`. With `type=all`, the limit applies to `tokens` and `pools` separately.

## How `input` is matched

The input is classified in this order:

| Input | Example | Matches |
| - | - | - |
| **Address**: `0x` plus 40 hex characters, or `0x` plus 64 hex characters (a 32-byte pool ID) | `0x4200000000000000000000000000000000000006` | Exact address. For tokens, also the tokens **deployed by** that address. |
| **Quoted**: starts and ends with a double quote | `"PEPE"` | Exact **symbol** match only, case-insensitive. Names are not searched. |
| **Multi-word**: contains a space | `wrapped ether` | The text appears anywhere in a name or symbol. |
| **Single word with 3 or more consecutive letters or digits** | `weth`, `usd` | A symbol or name that **starts with** the text, or a name containing a word that starts with it (for example `ether` matches "Wrapped Ether"). |
| **Short single word**: fewer than 3 consecutive letters or digits | `ab`, `$X` | A **symbol** that starts with the text. |

* Matching is case-insensitive. `%`, `_` and `\` are treated as literal characters.
* Token searches look at both the token's own name and symbol and the name and symbol of the cross-chain asset it belongs to. Word-inside-name matching uses the asset's name when the token has an asset, and the token's own name otherwise.
* Remember to URL-encode the input, for example `%22PEPE%22` for `"PEPE"` and `wrapped%20ether` for a space.

## Results by type

### `type=tokens`

Returns an array of [`SearchTokenOutput`](#searchtokenoutput).

* **Liquidity floor.** Text searches only return tokens with at least **\$1,000** of liquidity. Address searches have no floor.
* **One result per asset.** Tokens are de-duplicated per chain and asset (or per chain and address, for tokens without an asset), keeping the one with the most liquidity. Searching `usdc` returns one USDC per chain, not every bridged copy.
* **LP tokens are excluded.** Tokens whose address is itself a pool, for example LP share tokens, are left out.
* **Ranking for text searches.** Results are sorted by `tier × 1.5 − log10(max(liquidityUSD, 1))`, then by liquidity and 24h volume (both descending). `tier` is `0` for an exact (case-insensitive) symbol or name match and `1` otherwise. Exact matches get a boost, but a partial match with much more liquidity can still rank above them.
* **Ranking for address searches.** The token at that address comes first, then tokens deployed by that address, each group sorted by liquidity and 24h volume.

### `type=pools`

Returns an array of [`MarketDetailsOutput`](#marketdetailsoutput).

| `input` | Result |
| - | - |
| empty | **Top pools**: pools with at least **\$10,000** of liquidity, sorted by 24h volume (highest first), filtered by `chains`. Cached on the server for about **15 seconds** per `chains` and `limit` combination. |
| address | Pools whose address equals the input. If none match, the token rules apply (next row). |
| text | Runs the token search above, then returns the **top pool of each matched token**, with that token as `baseToken`. For a token address, only that token's top pool is returned, not pools of tokens it deployed. |

For top pools and direct address matches, `baseToken` is the pool's own base token.

### `type=assets`

Returns an array of [`SearchAssetOutput`](#searchassetoutput). `input` is required.

* Text input matches the asset's symbol and name with the rules above. An address returns the assets that have a token at that address.
* Only assets with a price above `0` are returned.
* Sorted by exact symbol or name match first, then market cap and liquidity (both descending).

> [!WARNING]
>
> For assets, `chains` does **not** filter which assets are returned. It only filters each asset's `tokens` list, which can therefore be empty. Drop assets with an empty `tokens` array on the client if you only want assets on the given chains.

### `type=all`

Returns an object `{ tokens: SearchTokenOutput[], pools: MarketDetailsOutput[] }`:

| `input` | `tokens` | `pools` |
| - | - | - |
| empty | `[]` | Top pools, as with `type=pools` and empty input (cached) |
| address | Token search | Pools at that address. If there are none, the top pool of the token at that address (not of tokens it deployed). |
| text | Token search | The top pool of each matched token |

## Response

**status** `string`

Always `"success"`.

**data** `SearchTokenOutput[] | MarketDetailsOutput[] | SearchAssetOutput[] | object`

An array for `tokens`, `pools` and `assets`. An object with `tokens` and `pools` arrays for `all`. Empty arrays when nothing matches.

### `SearchTokenOutput`

**address** `string`

Token address, lowercase.

**chainId** `string`

Chain in `evm:<id>` form.

**name** `string`

Token name.

**symbol** `string`

Token symbol.

**decimals** `number`

Token decimals.

**assetId** `number | null`

Cross-chain asset ID, or `null` when the token has no asset.

**logo** `string | null`

Logo URL, chosen as in [`GET /token`](https://sonar-cf3aeac7.mintlify.site/api-reference/token/get-token).

**priceUSD** `number`

USD price. `0` when unknown.

**totalSupply** `string | null`

Total supply as a raw integer string in base units.

**circulatingSupply** `string | null`

Circulating supply as a raw integer string in base units.

**marketCapUSD** `number`

Market cap in USD. `0` when unknown.

**marketCapDilutedUSD** `number`

Fully diluted market cap in USD. `0` when unknown.

**liquidityUSD** `number`

Token liquidity in USD, as in [`GET /token`](https://sonar-cf3aeac7.mintlify.site/api-reference/token/get-token). `0` when unknown.

**liquidityMaxUSD** `number`

Total liquidity of the token's top pools, both sides. `0` when unknown.

**deployer** `string | null`

Address that deployed the token.

**source** `string | null`

Launchpad ID, or `null`. See [Protocols and launchpads](https://sonar-cf3aeac7.mintlify.site/concepts/protocols-and-launchpads.md).

**sourceMetadata** `object | null`

Launchpad display data.

**properties**

**name** `string`

Launchpad display name.

**logo** `string | null`

Launchpad logo URL.

**description** `string | null`

Token description.

**socials** `object`

Social links: `twitter`, `website`, `telegram`, each a URL string or `null`.

**dexscreenerListed** `boolean`

`true` when the token is listed on DexScreener.

**volume24hUSD** `number`

Token volume over the last 24 hours, in USD.

**priceChange24hPercentage** `number`

Price change over the last 24 hours, in percent (`6.42` means +6.42%).

**topPool** `string | null`

Address of the token's most active pool, or `null`. Pass it to [`GET /market/details`](https://sonar-cf3aeac7.mintlify.site/api-reference/market/get-market-details).

### `SearchAssetOutput`

**id** `number`

Asset ID. Use it with [`GET /asset/ohlcv`](https://sonar-cf3aeac7.mintlify.site/api-reference/asset/get-asset-ohlcv) and [`GET /asset/history`](https://sonar-cf3aeac7.mintlify.site/api-reference/asset/get-asset-history).

**name** `string`

Asset name.

**symbol** `string`

Asset symbol.

**logo** `string | null`

Asset logo URL.

**priceUSD** `number`

Asset USD price.

**marketCapUSD** `number`

Asset market cap in USD. `0` when unknown.

**liquidityUSD** `number`

Asset liquidity in USD. `0` when unknown.

**tokens** `object[]`

The asset's tokens, ordered by chain ID. Filtered by `chains` when you pass it.

**token**

**chainId** `string`

Chain in `evm:<id>` form.

**address** `string`

Token address on that chain, lowercase.

### `MarketDetailsOutput`

Pool results use the same object as [`GET /market/details`](https://sonar-cf3aeac7.mintlify.site/api-reference/market/get-market-details).

> [accordion] MarketDetailsOutput fields
>
> **address** `string`
>
> Pool address (20 bytes) or 32-byte pool id, lowercase.
>
> **chainId** `string`
>
> Chain in `evm:<id>` form, for example `evm:1`.
>
> **blockchain** `string | null`
>
> Chain display name, for example `Ethereum` or `Base`. `null` if the chain has no configuration.
>
> **type** `string`
>
> Pool type id, for example `uniswap-v2`, `uniswap-v3`, `uniswap-v4`, `pancakeswap-infinity-cl`, `clanker-v4` or `fourmeme`. See [Protocols and launchpads](https://sonar-cf3aeac7.mintlify.site/concepts/protocols-and-launchpads.md) and [`GET /protocols`](https://sonar-cf3aeac7.mintlify.site/api-reference/protocols/get-protocols) for the list per chain.
>
> **exchange** `object | null`
>
> Exchange that runs the pool. `null` when it can't be identified.
>
> **properties**
>
> **name** `string`
>
> Exchange display name, for example `Uniswap`.
>
> **logo** `string | null`
>
> Logo URL. `null` when no logo is known.
>
> **factory** `string | null`
>
> Factory contract that created the pool.
>
> **sourceFactory** `string | null`
>
> Originating factory, for example a launchpad factory, when it differs from the DEX factory.
>
> **poolFeePercentage** `number | null`
>
> Swap fee as a **fraction**, not a percentage: `0.003` means a 0.3% fee and `0.0005` means 0.05%. `null` when the fee is unknown.
>
> **deployer** `string | null`
>
> Address that deployed the pool.
>
> **createdAt** `string | null`
>
> Pool creation time, ISO 8601 (UTC).
>
> **bonded** `boolean`
>
> `true` once a launchpad token has completed its bonding curve. `false` for ordinary pools.
>
> **bondingPercentage** `number | null`
>
> Bonding-curve progress on a 0 to 100 scale.
>
> **bondingCurveAddress** `string | null`
>
> Address of the pre-bonding curve pool, for launchpad tokens that graduated to this pool.
>
> **baseToken** `string`
>
> Address of the base token. Prices in this object are prices of the base token.
>
> **quoteToken** `string`
>
> Address of the quote token (the other token in the pool).
>
> **tokenSymbol** `string | null`
>
> Base token symbol.
>
> **tokenName** `string | null`
>
> Base token name.
>
> **priceUSD** `number`
>
> USD price of the base token as implied by this pool. Same value as `base.priceUSD`, or `0` when `base` is `null`.
>
> **priceToken** `number`
>
> Price of one base token in quote-token units. Same value as `base.priceToken`, or `0` when `base` is `null`.
>
> **priceTokenString** `string | null`
>
> Exact pool price of the base token in quote-token units, as a decimal string with **32 fractional digits** (for example `"3512.07000000000000000000000000000000"`). It is computed from the pool's on-chain price and both tokens' decimals. Use it when float precision matters. `null` when it can't be computed, for example when either token's details are unknown.
>
> **liquidityUSD** `number`
>
> Pool liquidity in USD. `0` when the pool has no stats yet.
>
> **marketCapUSD** `number`
>
> Market cap from the pool's stats. `0` when the pool has no stats.
>
> **marketCapDilutedUSD** `number`
>
> Fully diluted market cap from the pool's stats. `0` when the pool has no stats.
>
> **latestTradeDate** `string | null`
>
> Time of the pool's latest trade, ISO 8601 (UTC).
>
> **priceChange\{W}Percentage** `number`
>
> Price change of the pool's base token over window `W`, in percent (`2.5` means +2.5%). `W` is one of `1min`, `5min`, `1h`, `4h`, `6h`, `12h`, `24h`. There is no `15min` price change. `0` when there is no earlier price.
>
> **volume\{W}USD, volumeBuy\{W}USD, volumeSell\{W}USD** `number`
>
> Total, buy and sell volume in USD over window `W`. `W` is one of `1min`, `5min`, `15min`, `1h`, `4h`, `6h`, `12h`, `24h`.
>
> **trades\{W}, buys\{W}, sells\{W}** `number`
>
> Number of trades, buys and sells over window `W`.
>
> **buyers\{W}, sellers\{W}, traders\{W}** `number`
>
> Number of distinct buying, selling and trading wallets over window `W`.
>
> **feesPaid\{W}USD** `number`
>
> Gas fees paid by traders for the pool's trades over window `W`, in USD.
>
> **description** `string | null`
>
> Base token description.
>
> **socials** `object | null`
>
> Base token social links.
>
> **properties**
>
> **twitter** `string | null`
>
> **website** `string | null`
>
> **telegram** `string | null`
>
> **dexscreenerListed** `boolean`
>
> Whether the base token is listed on DEX Screener.
>
> **extraData** `object | null`
>
> Pool-type-specific state, such as `sqrtPriceX96` or `tickSpacing` for concentrated-liquidity pools. Large integers are sent as strings. The keys depend on the pool type and may change, so treat this object as opaque and don't rely on specific keys. `null` when there is nothing to report.
>
> **base** `MarketTokenOutput | null`
>
> Details of the base token. `null` if the token's details are not stored.
>
> **MarketTokenOutput**
>
> **address** `string`
>
> Token address, lowercase.
>
> **chainId** `string`
>
> Chain in `evm:<id>` form.
>
> **name** `string`
>
> **symbol** `string`
>
> **decimals** `number`
>
> **logo** `string | null`
>
> Logo URL.
>
> **assetId** `number | null`
>
> Id of the cross-chain asset this token belongs to. Pass it to [`GET /asset/ohlcv`](https://sonar-cf3aeac7.mintlify.site/api-reference/asset/get-asset-ohlcv) and [`GET /asset/history`](https://sonar-cf3aeac7.mintlify.site/api-reference/asset/get-asset-history).
>
> **deployer** `string | null`
>
> Address that deployed the token.
>
> **source** `string | null`
>
> Launchpad id when the token was launched on a known launchpad, otherwise `null`.
>
> **sourceMetadata** `object | null`
>
> Launchpad display data: `name` (string) and `logo` (string or `null`).
>
> **priceUSD** `number`
>
> USD price. For the base token: `1` if it is a known stablecoin; otherwise the pool price times the quote token's USD price when both are known; otherwise the token's global USD price. For the quote token: its global USD price.
>
> **priceToken** `number`
>
> Price of one unit of this token in units of the other token in the pool. Falls back to the ratio of the two USD prices when the pool price is unavailable, and to `0` when neither is known.
>
> **totalSupply** `string | null`
>
> Total supply as a raw integer string in base units. Divide by `10^decimals` for a display value.
>
> **circulatingSupply** `string | null`
>
> Circulating supply as a raw integer string in base units.
>
> **marketCapUSD** `number`
>
> Token-level market cap. `0` when unknown.
>
> **marketCapDilutedUSD** `number`
>
> Token-level fully diluted market cap. `0` when unknown.
>
> **liquidityUSD** `number`
>
> Token-level liquidity in USD, summed over the token's top pools and counting only the weaker side of each pool. `0` when unknown.
>
> **liquidityMaxUSD** `number`
>
> Like `liquidityUSD`, but counting the full liquidity (both sides) of each of those pools. `0` when unknown.
>
> **approximateReserveToken** `number`
>
> This token's reserve in the pool, adjusted for decimals.
>
> **approximateReserveTokenRaw** `string`
>
> This token's reserve in the pool as a raw integer string in base units.
>
> **approximateReserveUSD** `number`
>
> `approximateReserveToken × priceUSD`.
>
> **quote** `MarketTokenOutput | null`
>
> Details of the quote token, with the same fields as `base`. Here `priceUSD` is the quote token's global USD price and `priceToken` is the price of one quote token in base-token units. `null` if the token's details are not stored.

## Behavior

* **Never 404.** No match gives `200` with an empty array (or empty `tokens` and `pools` for `type=all`).
* **Slow searches return empty results.** Each search query has a time limit of about **3 seconds**. If it runs out, that part of the result is returned empty with `200`, not an error. If a broad search such as a 3-letter prefix comes back empty unexpectedly, retry or narrow it with `chains` or a longer input.
* **Fewer results than `limit`.** Tokens whose details aren't stored are dropped after ranking, and tokens without a top pool produce no pool result, so you can get fewer than `limit` items.
* **Only indexed data.** Search covers tokens and pools ChainQuery has already indexed. It doesn't look addresses up on-chain.

## Errors

| HTTP | `code` | When |
| - | - | - |
| 400 | `INVALID_PARAMETERS` | `input` is empty for `type=tokens` or `type=assets` (`input: input is required unless type is pools or all`), `input` is longer than 100 characters, `type` is not in the list, `limit` is outside 1 to 20, or `chains` is malformed. |
| 500 | `INTERNAL_ERROR` | Unexpected server error. |

```bash cURL theme={null}
curl "https://api.example.com/api/v1/search?input=weth&chains=8453&limit=1"
```

```javascript JavaScript theme={null}
const params = new URLSearchParams({ input: "weth", chains: "1,8453", limit: "10" });
const res = await fetch(`https://api.example.com/api/v1/search?${params}`);
const body = await res.json();
if (body.status !== "success") throw new Error(`${body.code}: ${body.message}`);

for (const t of body.data) {
  console.log(t.chainId, t.symbol, t.address, t.liquidityUSD);
}

// Top pools, for a default list before the user types:
const top = await fetch(
  "https://api.example.com/api/v1/search?type=pools&chains=8453&limit=5",
).then((r) => r.json());
```

```python Python theme={null}
import requests

res = requests.get(
    "https://api.example.com/api/v1/search",
    params={"input": '"USDC"', "type": "assets", "limit": 1},  # quoted = exact symbol
    timeout=10,
)
body = res.json()
if body["status"] != "success":
    raise RuntimeError(f'{body["code"]}: {body["message"]}')

for asset in body["data"]:
    print(asset["id"], asset["symbol"], [t["chainId"] for t in asset["tokens"]])
```

```json 200 tokens theme={null}
{
  "status": "success",
  "data": [
    {
      "address": "0x4200000000000000000000000000000000000006",
      "chainId": "evm:8453",
      "name": "Wrapped Ether",
      "symbol": "WETH",
      "decimals": 18,
      "assetId": 2,
      "logo": "https://assets.coingecko.com/coins/images/2518/large/weth.png",
      "priceUSD": 3412.57,
      "totalSupply": "182345671234567890123456",
      "circulatingSupply": "182345671234567890123456",
      "marketCapUSD": 622264019.3,
      "marketCapDilutedUSD": 622264019.3,
      "liquidityUSD": 21004512.77,
      "liquidityMaxUSD": 48210334.18,
      "deployer": null,
      "source": null,
      "sourceMetadata": null,
      "description": null,
      "socials": { "twitter": null, "website": "https://weth.io", "telegram": null },
      "dexscreenerListed": true,
      "volume24hUSD": 2310987.64,
      "priceChange24hPercentage": 6.42,
      "topPool": "0xd0b53d9277642d899df5c87a3966a349a798f224"
    }
  ]
}
```

```json 200 assets theme={null}
{
  "status": "success",
  "data": [
    {
      "id": 1,
      "name": "USD Coin",
      "symbol": "USDC",
      "logo": "https://assets.coingecko.com/coins/images/6319/large/usdc.png",
      "priceUSD": 1,
      "marketCapUSD": 74000000000,
      "liquidityUSD": 950000000,
      "tokens": [
        { "chainId": "evm:1", "address": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48" },
        { "chainId": "evm:8453", "address": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913" }
      ]
    }
  ]
}
```

```json 200 all (no match) theme={null}
{
  "status": "success",
  "data": {
    "tokens": [],
    "pools": []
  }
}
```

```json 400 theme={null}
{
  "status": "error",
  "statusCode": 400,
  "code": "INVALID_PARAMETERS",
  "message": "input: input is required unless type is pools or all",
  "details": [
    { "field": "input", "message": "input is required unless type is pools or all" }
  ]
}
```


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