## GET /openapi/v1/dex/search

DEX tokens whose address, symbol or name match a query, from the published lists.

### Query parameters

| Parameter | Type | Default | Notes |
|:--|:--|:--|:--|
| `q` | string | required | 2 to 64 characters once surrounding whitespace is trimmed, counted as characters, not bytes. An address longer than 64 characters (some Sui addresses) cannot be matched exactly; search its symbol or name |
| `limit` | integer | 10 | At most 20; 0 or below is 10 |

### Response

```json
{
  "code": 0,
  "message": "success",
  "message_key": "SUCCESS",
  "result": {
    "items": [
      {
        "id": "1",
        "chain_slug": "base",
        "address": "0x07b3d902783c3c12b077508c3b5c00113d1291d0",
        "symbol": "XDP",
        "name": "Doppler",
        "logo": "https://s2.coinmarketcap.com/static/img/coins/64x64/40953.png",
        "price": "0.0204910145",
        "liquidity": "4238562.5",
        "percent_change": { "24h": "2.31" },
        "lists": ["trending"]
      }
    ]
  }
}
```

Not paged; `items` is `[]` when nothing matches. Matching ignores case (except an address that
is not `0x` with 40 hexadecimal digits, on a token no list holds any more), and the hits come in
three groups — the address equal to `q`, then a symbol starting with `q`, then a name
containing `q` — each by `liquidity`, highest first, `null` last. A token in several lists is
one hit. When the lists give fewer than `limit` hits, tokens no list holds any more follow,
matched by address and symbol only, never by name, with `lists: []`.

| Field | Type | Notes |
|:--|:--|:--|
| `id`, `chain_slug`, `address`, `symbol`, `name`, `logo` | string | As on `/dex/tokens`; pass `chain_slug` and `address` to `/dex/tokens/info` |
| `price`, `liquidity` | string or `null` | USD |
| `percent_change` | object | The key `24h` only |
| `lists` | array | The lists holding the token, in the order `trending`, `new`, `gainers`; `[]` for a token no list holds now |

### Examples

```bash
# Tokens matching "pepe"
curl -H "X-Api-Key: <your-api-key>" \
  "https://open-api.coinworldcap.com/openapi/v1/dex/search?q=pepe"

# By contract address
curl -H "X-Api-Key: <your-api-key>" \
  "https://open-api.coinworldcap.com/openapi/v1/dex/search?q=0x07b3d902783c3c12b077508c3b5c00113d1291d0&limit=5"
```

| HTTP status | `code` | When |
|:--|:--|:--|
| 400 | 40000 | `q` missing, or shorter than 2 or longer than 64 characters; `limit` above 20 or not an integer |
| 503 | 50300 | No Trending list younger than three hours |

The other errors are in [Errors](#errors).
