> ## 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.<br />
  For production systems, use the standard [subscription endpoints](/reference/endpoint-overview).
</Warning>

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

## Getting Started

<Steps>
  <Step title="Set up an x402 client">
    Follow the [x402 Quickstart for Buyers](https://docs.cdp.coinbase.com/x402/quickstart-for-buyers) to configure your wallet.
  </Step>

  <Step title="Call an x402 endpoint">
    Insert `/x402/` after `/v3/` in any supported endpoint path.<br />

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

    The server responds with `402` code and payment requirements.
  </Step>

  <Step title="Sign and pay">
    Your wallet signs a USDC authorization.<br />
    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.
  </Step>

  <Step title="Receive data">
    ```json theme={null}
    "token_prices": {
      "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2": "1678.6456001894"
    }
    ```

    > See each [endpoint reference](/reference/endpoint-overview) for full payload details.
  </Step>
</Steps>

<Warning>
  Do **NOT** send `x-cg-pro-api-key` or `x-cg-demo-api-key` — no API key is required for x402 requests.
</Warning>

## Supported Endpoints

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

* All parameters from the [Pro API](/reference/endpoint-overview) are supported — refer to each endpoint's reference page for details.
* For `network_id` values, see the [Networks List](/reference/networks-list) 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

<AccordionGroup>
  <Accordion title="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>

  <Accordion title="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>

  <Accordion title="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>

  <Accordion title="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>

  <Accordion title="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
    ```
  </Accordion>
</AccordionGroup>

## Pricing & Payment

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

<Warning>
  Pricing is subject to change without notice.<br />
  Always check the latest pricing from the `402` response when generating your payment header.
</Warning>

<Note>
  **Paying with Privy Wallet**<br />
  *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)
</Note>

***

<Card title="Share Feedback" icon="comment" href="https://forms.gle/J2gF7sZ3PSucj8F58">
  Questions or feedback about x402 endpoints? Let us know.
</Card>
