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

# Data Delivery Methods

> Choose the right data delivery method for your use case — REST API, WebSocket, or Webhooks.

CoinGecko API offers three ways to access crypto market data, each designed for different use cases. Pick the one that fits how your application consumes data — or combine them for maximum flexibility.

<Frame>
  <img src="https://mintcdn.com/coingecko/Zo3jRljXWEB9014l/images/docs/data-delivery-method.gif?s=e7b1815b748d09e2386199154860208b" alt="Diagram showing three data delivery methods: REST API uses HTTP request-response, WebSocket maintains a persistent connection, and Webhook sends event-driven HTTP callbacks" width="960" height="641" data-path="images/docs/data-delivery-method.gif" />
</Frame>

## REST API — You ask, we answer

The classic request-response model. Your application sends an HTTP request, and the API returns the data you need.

**How it works:** Send a GET request to an endpoint → receive a JSON response.

<Tabs>
  <Tab title="Pro API">
    ```bash theme={null}
    curl -X GET "https://pro-api.coingecko.com/api/v3/simple/price?ids=bitcoin&vs_currencies=usd" \
      -H "x-cg-pro-api-key: YOUR_API_KEY"
    ```
  </Tab>

  <Tab title="Demo API">
    ```bash theme={null}
    curl -X GET "https://api.coingecko.com/api/v3/simple/price?ids=bitcoin&vs_currencies=usd" \
      -H "x-cg-demo-api-key: YOUR_API_KEY"
    ```
  </Tab>
</Tabs>

<CardGroup cols={2}>
  <Card title="Best for" icon="bullseye-arrow">
    * Fetching data on demand (prices, coin info, historical data)
    * Periodic polling on a schedule (e.g. every 60 seconds)
    * Backfilling or one-time data pulls
    * Prototyping and quick integrations
  </Card>

  <Card title="Available endpoints" icon="grid-2">
    * 50+ endpoints on Demo & Basic plans
    * 80+ endpoints on Analyst plan & above
    * Covers prices, market data, exchanges, NFTs, onchain DEX data, and more
  </Card>
</CardGroup>

<Info>
  REST API is available on **all plans**, including the free Demo plan. [View endpoints →](/reference/endpoint-overview)
</Info>

***

## WebSocket — Stay connected, stream live

A persistent, two-way connection that pushes data to your application in real time. No repeated requests needed — once you subscribe, updates flow to you automatically.

**How it works:** Open a WebSocket connection → subscribe to channels → receive continuous updates.

<CardGroup cols={2}>
  <Card title="Best for" icon="bullseye-arrow">
    * Live price tickers and trading dashboards
    * Real-time trade monitoring
    * Streaming OHLCV chart data
    * Any app where milliseconds matter
  </Card>

  <Card title="Available channels" icon="tower-broadcast">
    * `C1` — CoinGecko price updates
    * `G1` — Onchain token price updates
    * `G2` — Onchain trade updates
    * `G3` — Onchain OHLCV data
  </Card>
</CardGroup>

<Info>
  WebSocket is available on **Analyst plan & above**. [View WebSocket docs →](/websocket)
</Info>

***

## Webhooks — We notify you when things change

Event-driven HTTP callbacks that push notifications to your server whenever specific data changes occur on CoinGecko — no polling required.

**How it works:** Register a webhook URL → CoinGecko sends a POST request to your server when an event fires.

<CardGroup cols={2}>
  <Card title="Best for" icon="bullseye-arrow">
    * Keeping your database in sync with CoinGecko
    * Reacting to coin metadata changes (rebrands, new chains, alerts)
    * Compliance and risk monitoring
    * Replacing cron jobs with event-driven updates
  </Card>

  <Card title="Supported events" icon="bell">
    * `cg.coin.info.updated` — triggers when coin info changes across all active coins
    * More event types coming soon
  </Card>
</CardGroup>

<Info>
  Webhooks are available on **Analyst plan & above**. [View Webhook docs →](/webhooks)
</Info>

***

## Quick comparison

|                   | REST API                            | WebSocket               | Webhook                     |
| ----------------- | ----------------------------------- | ----------------------- | --------------------------- |
| **Communication** | Request → Response                  | Persistent connection   | Event-driven callback       |
| **Data flow**     | You pull data                       | Data pushed to you      | Data pushed to you          |
| **Latency**       | Per-request                         | Ultra-low (real-time)   | Near real-time              |
| **Use case**      | On-demand queries, periodic polling | Live streaming, trading | Reacting to data changes    |
| **Credit charge** | 1 credit per call                   | 0.1 credit per response | 10 credits per notification |

## Plan access and pricing

|                     |      REST API     | WebSocket <sup>BETA</sup> |    Webhook <sup>NEW</sup>   |
| ------------------- | :---------------: | :-----------------------: | :-------------------------: |
| **Free Demo**       | ✅ (50+ endpoints) |             —             |              —              |
| **Basic**           | ✅ (50+ endpoints) |             —             |              —              |
| **Analyst & above** | ✅ (80+ endpoints) |             ✅             |              ✅              |
| **Enterprise**      | ✅ (80+ endpoints) |             ✅             |              ✅              |
| **Credit charge**   | 1 credit per call |  0.1 credit per response  | 10 credits per notification |

<Tip>
  Not sure which plan to choose? Check out the [pricing page](https://www.coingecko.com/en/api/pricing) for a full breakdown.
</Tip>

## Which method should you use?

<AccordionGroup>
  <Accordion title="I want to build a portfolio tracker">
    Use **REST API** to fetch current prices and historical data on a schedule. If you need live price updates on a dashboard, add **WebSocket** for real-time streaming.
  </Accordion>

  <Accordion title="I'm building a trading bot">
    Use **WebSocket** for real-time price feeds and trade data. Supplement with **REST API** for reference data like coin metadata, market cap rankings, or historical OHLC.
  </Accordion>

  <Accordion title="I need to keep my database in sync with CoinGecko">
    Use **Webhooks** to receive push notifications when coin data changes, so you don't need to poll the API constantly. Use **REST API** to backfill or fetch full records on demand.
  </Accordion>

  <Accordion title="I'm just getting started / prototyping">
    Start with **REST API** — it's available on all plans (including the free Demo plan) and covers the widest range of data. You can add WebSocket or Webhooks later as your needs grow.
  </Accordion>
</AccordionGroup>
