> ## Documentation Index
> Fetch the complete documentation index at: https://docs.coingecko.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Pay-Per-Use Crypto Data (x402)

> Access CoinGecko API endpoints with native crypto payments — no API key or account required

> [!WARNING]
>
> Experimental endpoints — features, pricing, and availability may change without notice.\\
>
> For production systems, use the standard [subscription endpoints](https://docs.coingecko.com/reference/endpoint-overview.md).

[x402](https://docs.cdp.coinbase.com/x402/welcome) is an open payment protocol by Coinbase that enables instant stablecoin payments over HTTP.

## Getting Started

**1. Set up an x402 client**

Follow the [x402 Quickstart for Buyers](https://docs.cdp.coinbase.com/x402/quickstart-for-buyers) to configure your wallet.

**2. Call an x402 endpoint**

Insert `/x402/` after `/v3/` in any supported endpoint path.\\

```bash theme={null}
https://pro-api.coingecko.com/api/v3/x402/...
```

The server responds with `402` code and payment requirements.

**3. Sign and pay**

Your wallet signs a USDC authorization.\\

Resend the request with the `PAYMENT-SIGNATURE` header:

```bash wrap theme={null}
curl --request GET \
  --url https://pro-api.coingecko.com/api/v3/onchain/simple/networks/eth/token_price/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2 \
  -H 'PAYMENT-SIGNATURE: {{paymentSignature}}'
```

> The x402 client generates the `PAYMENT-SIGNATURE` header automatically — you don't need to create it manually.

**4. Receive data**

```json theme={null}
"token_prices": {
  "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2": "1678.6456001894"
}
```

> See each [endpoint reference](https://docs.coingecko.com/reference/endpoint-overview.md) for full payload details.

> [!WARNING]
>
> Do **NOT** send `x-cg-pro-api-key` or `x-cg-demo-api-key` — no API key is required for x402 requests.

## Supported Endpoints

| Endpoint | x402 Path |
| - | - |
| [Simple Price](https://docs.coingecko.com/reference/simple-price.md) | `/x402/simple/price` |
| [Simple Token Price](https://docs.coingecko.com/reference/onchain-simple-price.md) | `/x402/onchain/simple/networks/{id}/token_price/{address}` |
| [Search Pools](https://docs.coingecko.com/reference/search-pools.md) | `/x402/onchain/search/pools` |
| [Trending Pools by Network](https://docs.coingecko.com/reference/trending-pools-network.md) | `/x402/onchain/networks/{id}/trending_pools` |
| [Token Data by Address](https://docs.coingecko.com/reference/token-data-contract-address.md) | `/x402/onchain/networks/{network}/tokens/{address}` |

* All parameters from the [Pro API](https://docs.coingecko.com/reference/endpoint-overview.md) are supported — refer to each endpoint's reference page for details.
* For `network_id` values, see the [Networks List](https://docs.coingecko.com/reference/networks-list.md) or this [Google Sheet](https://docs.google.com/spreadsheets/d/1wTTuxXt8n9q7C4NDXqQpI3wpKu1_5bGVmP9Xz0XGSyU/edit?gid=1120233236#gid=1120233236).
* See the [x402 guide](https://www.coingecko.com/learn/x402-pay-per-use-crypto-api) for more usage details.

## Request Examples

> [accordion] Get VIRTUALS and WETH prices on Base
>
> ```bash theme={null}
> GET /api/v3/x402/onchain/simple/networks/base/token_price/0x0b3e328455c4059eeb9e3f84b5543f74e24e7e1b,0x4200000000000000000000000000000000000006
>   ?include_market_cap=true
>   &include_24hr_vol=true
>   &include_24hr_price_change=true
> ```

> [accordion] Search pools on Solana
>
> ```bash theme={null}
> GET /api/v3/x402/onchain/search/pools
>   ?query=pump
>   &network=solana
>   &include=base_token,quote_token,dex
>   &page=1
> ```

> [accordion] Trending pools on Base (last 5 minutes)
>
> ```bash theme={null}
> GET /api/v3/x402/onchain/networks/base/trending_pools
>   ?page=1
>   &duration=5m
>   &include=base_token,quote_token,dex
> ```

> [accordion] Token data for KEETA on Base
>
> ```bash theme={null}
> GET /api/v3/x402/onchain/networks/base/tokens/0xc0634090f2fe6c6d75e61be2b949464abb498973
>   ?include=top_pools
>   &include_composition=true
> ```

> [accordion] BTC, ETH, SOL prices by symbol
>
> ```bash theme={null}
> GET /api/v3/x402/simple/price
>   ?vs_currencies=usd
>   &symbols=btc,eth,sol
>   &include_market_cap=true
>   &include_24hr_vol=true
>   &include_24hr_change=true
>   &precision=full
> ```

## Pricing & Payment

* **\$0.005 USDC per request** for all supported endpoints.
* Payment networks: Base, Solana, Polygon

> [!WARNING]
>
> Pricing is subject to change without notice.\\
>
> Always check the latest pricing from the `402` response when generating your payment header.

> [!NOTE]
>
> **Paying with Privy Wallet**\\
>
> *Privy provides embedded and agent wallets with native x402 support — an all-in-one option for paying CoinGecko API calls.*
>
> * [x402 integration recipe](https://docs.privy.io/recipes/agent-integrations/x402)
> * [Privy Agent Wallet CLI](https://docs.privy.io/recipes/agent-integrations/agent-wallets-cli)

***

> [card] [Share Feedback](https://tally.so/r/2EgG4p)
>
> Questions or feedback about x402 endpoints? Let us know.


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