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

# On-Demand Crypto Price & Market Data (x402)

> x402-enabled, instant, pay-per-use crypto price & market data endpoints. Access with native crypto payment, no key or account required.

<Warning>
  These are experimental endpoints. Their features, pricing, and availability are subject to change without prior notice. For production systems, we strongly advise using the stable, standard subscription [endpoints](/reference/endpoint-overview).

  If you have any questions or feedback, please share with us [here](https://forms.gle/J2gF7sZ3PSucj8F58).
</Warning>

## x402 Overview

x402 is a new open payment protocol developed by Coinbase that enables instant, automatic stablecoin payments directly over HTTP. Learn more about x402 [here](https://docs.cdp.coinbase.com/x402/welcome).

## How It Works

<Steps>
  <Step title="Make Request">
    Make a request to the x402-enabled endpoint. The server returns payment requirements with a 402 response.
  </Step>

  <Step title="Sign">
    Your wallet signs a USDC authorization for the requested amount.
  </Step>

  <Step title="Pay & Get Data">
    Send the signed payment header and receive the data you requested.
  </Step>
</Steps>

<Note>
  **Authentication**

  To access CoinGecko API with x402, you can follow the simple steps below:

  * Set up an x402 client by following the official [<u>x402 Quickstart for Buyers</u>](https://docs.cdp.coinbase.com/x402/quickstart-for-buyers)
  * **Use the x402 Path:** Call any supported endpoint by inserting `/x402/` immediately after the version segment (`/v3/`) in the URL path.
</Note>

<Warning>
  **Reminder**

  * Do not send `x-cg-pro-api-key` or `x-cg-demo-api-key`, as an API key is not required.
  * Root URL for the endpoints: All x402 requests must use the base path: \
    `pro-api.coingecko.com/api/v3/x402/...`
</Warning>

## Supported Endpoints

| **Endpoints**                                                                      | **Description & Endpoint Path**                                                                                                                                                                                                                                                                                                                                                                                            |
| ---------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Onchain**: [Simple Token Price](/reference/onchain-simple-price)                 | To get token price & market data based on the provided token contract addresses on a network.<br /><br />`/x402/onchain/simple/networks/{id}/token_price/{address}`                                                                                                                                                                                                                                                        |
| **Onchain**: [Search Pools](/reference/search-pools)                               | To search pools and tokens, by contract address, name or token symbol.<br /><br />`/x402/onchain/search/pools`                                                                                                                                                                                                                                                                                                             |
| **Onchain**: [Trending Pools by Network](/reference/trending-pools-network)        | To query the latest trending pools & tokens based on a provided network.<br /><br />`/x402/onchain/networks/{id}/trending_pools`                                                                                                                                                                                                                                                                                           |
| **Onchain**: [Token Data by Token Address](/reference/token-data-contract-address) | To query the latest price, liquidity, and market data of a token, based on the provided token contract address on a network<br /><br />`/x402/onchain/networks/{network}/tokens/{address}`                                                                                                                                                                                                                                 |
| **CoinGecko**: [**Simple Price**](/reference/simple-price)                         | To get token price & market data of coins listed on [CoinGecko.com](https://www.coingecko.com), via symbol or unique coin IDs.<br /><br />`/x402/simple/price`<br /><br />Get full list of coin IDs via [CSV](https://raw.githubusercontent.com/sachiew/coingecko-id-map/refs/heads/main/coin_ids.csv), or [GSheet](https://docs.google.com/spreadsheets/d/1wTTuxXt8n9q7C4NDXqQpI3wpKu1_5bGVmP9Xz0XGSyU/edit?gid=0#gid=0). |

* All parameters from the CoinGecko Pro API endpoints are supported. For the complete list of available parameters, features, limits, and payload data, please refer to the [**Pro API References**](https://docs.coingecko.com/reference/endpoint-overview) of respective endpoints.
* For Onchain endpoint requests that require `network_id`, you may check for the full list of network IDs via [CSV](https://raw.githubusercontent.com/sachiew/coingecko-id-map/refs/heads/main/onchain_network_ids.csv) or [GSheet](https://docs.google.com/spreadsheets/d/1wTTuxXt8n9q7C4NDXqQpI3wpKu1_5bGVmP9Xz0XGSyU/edit?gid=1120233236#gid=1120233236). We cover more than 250 networks, the widest coverage in the industry!
* If you wish to learn more details about how to use CoinGecko API x402 endpoints, please visit [this guide](https://www.coingecko.com/learn/x402-pay-per-use-crypto-api).

**Request URL Examples:**

* **Example 1**: Get VIRTUALS and WETH tokens data on Base network:

  ```javascript theme={null}
  GET /api/v3/x402/onchain/simple/networks/base/token_price/0x0b3e328455c4059eeb9e3f84b5543f74e24e7e1b,0x4200000000000000000000000000000000000006
    ?include_market_cap=true
    &mcap_fdv_fallback=true
    &include_24hr_vol=true
    &include_24hr_price_change=true
    &include_total_reserve_in_usd=true
  ```
* **Example 2**: Search tokens and pools data on Solana network, with name, symbol, or contract address:

  ```javascript theme={null}
  GET /api/v3/x402/onchain/search/pools
    ?query=pump
    &network=solana
    &include=base_token,quote_token,dex
    &page=1
  ```
* **Example 3**: Get the top trending tokens and pools data on Base network, in the last 5 minutes:

  ```javascript theme={null}
  GET /api/v3/x402/onchain/networks/base/trending_pools
    ?page=1
    &duration=5m
    &include_gt_community_data=true
    &include=base_token,quote_token,dex
  ```
* **Example 4**: Get KEETA price, liquidity, market data and more on Base network:

  ```javascript theme={null}
  GET /api/v3/x402/onchain/networks/base/tokens/0xc0634090f2fe6c6d75e61be2b949464abb498973
    ?include=top_pools
    &include_composition=true
  ```
* **Example 5**: Get USD price & market data of Bitcoin, Ethereum and Solana, by symbols:

  ```javascript theme={null}
  GET /api/v3/x402/simple/price
    ?vs_currencies=usd
    &symbols=btc,eth,sol
    &include_tokens=top
    &include_market_cap=true
    &include_24hr_vol=true
    &include_24hr_change=true
    &include_last_updated_at=true
    &precision=full
  ```

## Pricing & Payment Method

**Current price: \$0.01 USDC per API request, for all endpoints stated above.**

<Warning>
  **Pricing Notice**: The current pricing of \$0.01 USDC per request is subject to change at any time without prior notice. Please check the latest pricing when generating your payment header.
</Warning>

Each search request is charged on a pay-per-use basis using cryptocurrency through the payment header system.

**Network supported:**

* Base
* Solana

<Note>
  #### Paying with Privy Wallet

  Privy provides embedded and agent wallets that natively support x402, making them an all-in-one option for paying for 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>

## Request Example

```shellscript theme={null}
curl --request GET \
  --url 'https://pro-api.coingecko.com/api/v3/x402/onchain/networks/eth/tokens/0xdac17f958d2ee523a2206206994597c13d831ec7?include_composition=true' \
  -H 'PAYMENT-SIGNATURE: {{paymentSignature}}' \
```

## Response Example

Please refer to the respective endpoint documentation for full parameter and payload support.

```json expandable theme={null}
{
  "data": {
    "id": "eth_0xdac17f958d2ee523a2206206994597c13d831ec7",
    "type": "token",
    "attributes": {
      "address": "0xdac17f958d2ee523a2206206994597c13d831ec7",
      "name": "Tether USD",
      "symbol": "USDT",
      "decimals": 6,
      "image_url": "https://coin-images.coingecko.com/coins/images/325/large/Tether.png?1696501661",
      "coingecko_coin_id": "tether",
      "total_supply": "91775654692250534.0",
      "normalized_total_supply": "91775654692.2505",
      "price_usd": "0.999188255",
      "fdv_usd": "91700939859.6687",
      "total_reserve_in_usd": "405089394.14192413773442554227",
      "volume_usd": {
        "h24": "1142454033.37436"
      },
      "market_cap_usd": "171798403974.784"
    },
    "relationships": {
      "top_pools": {
        "data": [
          {
            "id": "eth_0x667701e51b4d1ca244f17c78f7ab8744b4c99f9b",
            "type": "pool"
          },
          {
            "id": "eth_0xf063bd202e45d6b2843102cb4ece339026645d4a",
            "type": "pool"
          },
          {
            "id": "eth_0x8aa4e11cbdf30eedc92100f4c8a31ff748e201d44712cc8c90d189edaa8e4e47",
            "type": "pool"
          }
        ]
      }
    }
  },
  "included": [
    {
      "id": "eth_0x667701e51b4d1ca244f17c78f7ab8744b4c99f9b",
      "type": "pool",
      "attributes": {
        "base_token_price_usd": "0.999949947925521",
        "base_token_price_native_currency": "0.000223341206041575",
        "base_token_balance": "74198606.301554",
        "base_token_liquidity_usd": "74194892.50738515",
        "quote_token_price_usd": "0.99918825500163",
        "quote_token_price_native_currency": "0.000223171080110164",
        "quote_token_balance": "29771050.29628",
        "quote_token_liquidity_usd": "29746883.795105774",
        "base_token_price_quote_token": "1.0007623117",
        "quote_token_price_base_token": "0.9992382689",
        "address": "0x667701e51b4d1ca244f17c78f7ab8744b4c99f9b",
        "name": "USDC / USDT",
        "pool_created_at": "2025-09-18T08:28:30Z",
        "token_price_usd": "0.99918825500163",
        "fdv_usd": "91700939859.6687",
        "market_cap_usd": "171798403975.064",
        "price_change_percentage": {
          "m5": "-0.02",
          "m15": "-0.65",
          "m30": "-0.01",
          "h1": "0",
          "h6": "-0.18",
          "h24": "-0.5"
        },
        "transactions": {
          "m5": {
            "buys": 0,
            "sells": 2,
            "buyers": 0,
            "sellers": 2
          },
          "m15": {
            "buys": 4,
            "sells": 7,
            "buyers": 3,
            "sellers": 5
          },
          "m30": {
            "buys": 12,
            "sells": 19,
            "buyers": 7,
            "sellers": 9
          },
          "h1": {
            "buys": 39,
            "sells": 48,
            "buyers": 16,
            "sellers": 15
          },
          "h6": {
            "buys": 180,
            "sells": 271,
            "buyers": 31,
            "sellers": 35
          },
          "h24": {
            "buys": 870,
            "sells": 1109,
            "buyers": 55,
            "sellers": 59
          }
        },
        "volume_usd": {
          "m5": "988.7572917698",
          "m15": "1857835.95996426",
          "m30": "3190909.49729904",
          "h1": "9434171.29930675",
          "h6": "84784863.3965608",
          "h24": "388004708.962186"
        },
        "reserve_in_usd": "103939687.035"
      },
      "relationships": {
        "base_token": {
          "data": {
            "id": "eth_0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
            "type": "token"
          }
        },
        "quote_token": {
          "data": {
            "id": "eth_0xdac17f958d2ee523a2206206994597c13d831ec7",
            "type": "token"
          }
        },
        "dex": {
          "data": {
            "id": "fluid-ethereum",
            "type": "dex"
          }
        }
      }
    }
  ]
}
```
