> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://coingecko.ferndocs.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://coingecko.ferndocs.com/_mcp/server.

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

#### [Share your feedback](https://docs.google.com/forms/d/e/1FAIpQLSf33wT9liXr7hfx3IPKnHs4zBR61zLv0rart6s27_6HND8Uwg/viewform)

Help us improve — tell us how you use CoinGecko's data delivery methods and what you'd like to see next.

![Diagram showing three data delivery methods: REST API uses HTTP request-response, WebSocket maintains a persistent connection, and Webhook sends event-driven HTTP callbacks](https://mintcdn.com/coingecko/Zo3jRljXWEB9014l/images/docs/data-delivery-method.gif?s=e7b1815b748d09e2386199154860208b)

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

#### 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"
```

#### 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"
```

#### Best for

* 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

#### Available endpoints

* 50+ endpoints on Demo & Basic plans
* 80+ endpoints on Analyst plan & above
* Covers prices, market data, exchanges, NFTs, onchain DEX data, and more

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

---

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

#### Best for

* Live price tickers and trading dashboards
* Real-time trade monitoring
* Streaming OHLCV chart data
* Any app where milliseconds matter

#### Available channels

* `C1` — CoinGecko price updates
* `G1` — Onchain token price updates
* `G2` — Onchain trade updates
* `G3` — Onchain OHLCV data

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

---

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

#### Best for

* 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

#### Supported events

* `cg.coin.info.updated` — triggers when coin info changes across all active coins
* More event types coming soon

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

---

## 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 BETA     |         Webhook NEW         |
| ------------------- | :---------------: | :---------------------: | :-------------------------: |
| **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.

## Which method should you use?

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

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

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

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