# Crypto Price API - CoinGecko OHLC, DEX Pools, NFTs, Treasuries (`nabeelbaghoor/crypto-price-ohlc-dex-pools-api`) Actor

Pull crypto prices, coin markets, OHLC and historical charts, exchange and derivatives tickers, trending coins, NFT floor prices, public treasury holdings and GeckoTerminal DEX pools, tokens, OHLCV and trades from the CoinGecko API into a dataset. Bring your own Demo or Pro API key.

- **URL**: https://apify.com/nabeelbaghoor/crypto-price-ohlc-dex-pools-api.md
- **Developed by:** [Nabeel Hassan](https://apify.com/nabeelbaghoor) (community)
- **Categories:** Developer tools, Business, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.00 / 1,000 price point, candle or trade returneds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Crypto Price API - CoinGecko OHLC, DEX Pools, NFTs, Treasuries

Export live crypto prices, coin markets, OHLC candles, historical charts, exchange tickers, NFT floor prices and onchain DEX pools into an Apify dataset with your own CoinGecko API key.

This actor wraps the CoinGecko REST API, on both the free Demo plan and the paid Pro plans, including its GeckoTerminal onchain endpoints. It turns a list of coin IDs, a network and pool addresses, or a market filter into clean, deduplicated rows you can download as JSON, CSV or Excel, schedule every few minutes, or feed into trading bots, portfolio trackers, dashboards, spreadsheets and AI agents. Bring your own API key.

### What it does

- **Crypto prices**: live price, market cap, 24h volume and 24h change for any coin by CoinGecko ID or symbol, or any token by contract address, in USD, EUR, BTC or 40+ other currencies.
- **Coin markets**: the full coin list ranked by market cap or volume, with price, ATH, ATL, supply and 1h to 1y price change, filtered by coin, symbol or category (layer-1, meme, AI, DeFi).
- **Coin details and snapshots**: metadata, links, categories, contract addresses on every chain and market data, or the 00:00 UTC snapshot of any past date.
- **Historical charts and OHLC**: price, market cap and volume series (5 minute, hourly or daily) and OHLC candles, by days back or by date range.
- **Tickers and exchanges**: every trading pair of a coin or an exchange (CEX and DEX) with converted price, volume, spread, 2% depth and trust score; exchange rankings; perpetual and futures tickers with funding rate and open interest.
- **Market overview**: trending searches, top gainers and losers, recently listed coins, coin categories, global market cap and BTC dominance, global DeFi market.
- **Public treasuries**: public companies and governments holding bitcoin, ethereum, solana and other coins, with holdings and value.
- **NFTs**: collection floor price, market cap, volume, owners and sales, by collection or as a ranked market list.
- **Crypto news**: the latest news and guides published on CoinGecko, by coin and language.
- **Onchain DEX data (GeckoTerminal)**: trending and new pools, top pools by network or token, pool search, the pool screener (megafilter), pools and tokens by address, pool OHLCV candles down to the minute, and the latest DEX trades, across 200+ networks.
- **Pay only for results**: empty answers and unknown IDs are recorded as a free row that says why, never charged.

### Input

| Field | Used by | What it does |
| --- | --- | --- |
| `mode` | all | `simplePrice`, `tokenPrice`, `coinMarkets`, `coinDetails`, `coinHistory`, `coinTickers`, `marketChart`, `ohlc`, `topGainersLosers`, `newCoins`, `trending`, `search`, `categories`, `globalMarket`, `defiMarket`, `exchanges`, `exchangeTickers`, `derivatives`, `publicTreasury`, `nftMarkets`, `nftDetails`, `news`, `trendingPools`, `newPools`, `topPools`, `tokenPools`, `searchPools`, `poolScreener`, `poolDetails`, `tokenData`, `poolOhlcv` or `poolTrades` |
| `coinIds`, `symbols` | coin modes | CoinGecko API IDs such as bitcoin or ethereum; symbols such as btc |
| `vsCurrency` | price modes | usd, eur, btc and so on |
| `category`, `marketOrder`, `priceChangeWindows` | coin markets | Category filter, sort, extra change windows |
| `days`, `from`, `to`, `interval` | charts, OHLC | Days back, or a date range; daily or hourly |
| `date` | coin snapshot | The snapshot date |
| `assetPlatform`, `contractAddresses` | token prices | Chain and token contracts |
| `exchangeIds`, `treasuryEntity`, `nftIds` | tickers, treasuries, NFTs | What to read |
| `searchQuery` | search modes | A name, symbol or address |
| `duration`, `topCoins` | gainers, trending pools | Time window and universe |
| `network`, `poolAddresses`, `tokenAddresses` | onchain modes | GeckoTerminal network (eth, solana, base) and addresses |
| `timeframe`, `aggregate`, `minTradeUsd`, `poolSort` | onchain modes | Candle size, trade filter, pool sort |
| `minLiquidityUsd`, `minVolumeUsd`, `maxPoolAgeHours`, `safetyChecks` | pool screener | Liquidity, volume, age and honeypot filters |
| `newsLanguage`, `newsType` | news | Language, news or guides |
| `maxResults`, `requestsPerMinute` | all | Row ceiling and pacing |
| `apiPlan` | all | Auto, Demo or Pro |
| `apiKey` | all | Your CoinGecko API key (secret). Or set the `DATA_API_KEY` environment secret |

Inputs a mode does not use are left off the request and named in the log, so a filter meant for another mode never silently changes your results.

### How to get an API key

Create a CoinGecko account at coingecko.com/en/api/pricing, then click Add New Key in the Developer Dashboard. The free Demo plan works for most modes. The modes marked "paid plan" (top gainers and losers, new coins, NFT markets, news, the pool screener and OHLC date ranges) need a Basic, Analyst, Lite, Pro or Enterprise plan key. Paste the key (it starts with CG-) into the API key field and leave the API plan on Auto.

### Example output

```json
{
    "mode": "coinMarkets",
    "recordType": "coinMarket",
    "identifier": null,
    "found": true,
    "id": "bitcoin",
    "coinId": "bitcoin",
    "symbol": "btc",
    "name": "Bitcoin",
    "network": null,
    "address": null,
    "date": "2026-10-08T20:46:30.512Z",
    "price": 81748,
    "marketCap": 1642902136141,
    "volume": 38211934077,
    "change24h": -2.31,
    "value": 81748,
    "market_cap_rank": 1,
    "high_24h": 84102,
    "low_24h": 81220,
    "ath": 126080,
    "circulating_supply": 19932512,
    "price_change_percentage_7d_in_currency": -4.12,
    "note": null
}
```

Every field the provider returns is kept. `value` is the headline number of each record type: the price for prices, markets, candles and NFTs, market cap for categories and global snapshots, trust score for exchanges and tickers, open interest for derivatives, holdings for treasuries, liquidity (reserve in USD) for DEX pools and tokens, and buy or sell for DEX trades.

### FAQ

#### What is the CoinGecko API?

The CoinGecko API is the crypto market data API from CoinGecko, covering more than 20,000 coins on 1,500+ exchanges plus GeckoTerminal onchain data for millions of tokens and DEX pools on 200+ networks. This actor calls its REST endpoints such as `/simple/price`, `/coins/markets`, `/coins/{id}`, `/coins/{id}/market_chart`, `/coins/{id}/ohlc`, `/coins/{id}/tickers`, `/exchanges`, `/derivatives`, `/nfts/{id}`, `/search/trending`, `/global`, `/onchain/networks/{network}/pools` and `/onchain/networks/{network}/pools/{address}/ohlcv/{timeframe}`.

#### Do I need my own API key?

Yes. This actor is bring your own key: you need a CoinGecko Demo (free) or paid API key. Your key is stored as an Apify secret, sent only in the `x-cg-demo-api-key` or `x-cg-pro-api-key` header, and kept out of every log line. Without a key the run stops immediately with a clear message and no charge.

#### Does it work with the free Demo plan?

Yes. On Auto the actor checks the key once with `/ping`, first on the Pro API and then on the Demo API, and uses whichever accepts it. 27 of the 32 modes run on the Demo plan. A paid-only mode on a Demo key ends the run cleanly with a message saying so, before any data call.

#### How do I get historical crypto prices or OHLC data?

Choose Price chart for price, market cap and volume over time, or OHLC candles for open, high, low and close. Set the coin IDs and either Days back (1, 7, 30, 365 or max) or a From and To date range. Granularity is automatic (5 minute for 1 day, hourly up to 90 days, daily beyond), or set Interval to daily or hourly. For one exact day use Coin snapshot on a date.

#### How do I get DEX pool and onchain token data?

Use the onchain modes, which read GeckoTerminal through the CoinGecko API. Set the network (eth, solana, base, bsc, arbitrum) and pool or token addresses for pools by address, tokens by address, pool OHLCV candles and pool trades, or leave addresses out for trending pools, new pools, top pools and the pool screener. The Demo plan reads up to 10 pages (200 pools) of each list and the last 300 trades of a pool.

#### Which companies and governments hold bitcoin?

Choose Public treasury holdings, set the coin IDs to bitcoin (or ethereum, solana and others) and pick public companies or governments. Each row is one holder with total holdings, entry value, current value and share of supply.

#### What do I pay?

The actor charges per returned record: 0.005 USD per price point, chart point, candle or DEX trade, 0.008 USD per market record (coin market row, ticker, exchange, category, treasury holder, NFT market row, news article, DEX pool or token), 0.01 USD per historical or global snapshot, and 0.02 USD per full coin or NFT collection profile, with Apify platform usage included. Empty results are free. CoinGecko bills your API plan separately: every successful request uses one credit, and each list page is one request.

#### What happens if my key is wrong or my plan does not cover a request?

A wrong or revoked key (CoinGecko answers "API Key Missing" to any key it does not recognise), a key sent to the wrong plan's host, a request outside your plan, or a used-up monthly credit allowance ends the run cleanly with the provider's own explanation as the status message. The per-minute rate limit (429) is waited out and retried.

### Keyword map

CoinGecko API, crypto price API, cryptocurrency market data, bitcoin price API, crypto OHLC data, historical crypto prices, crypto market cap, coin tickers, exchange volume, crypto derivatives funding rate, trending coins, top gainers and losers, NFT floor price API, bitcoin treasury companies, GeckoTerminal API, DEX pools, onchain token price, DEX OHLCV, DEX trades, crypto news API.

### Terms and data use

You need your own CoinGecko API key, and your use of the data is governed by the CoinGecko API Terms of Service and your plan. The terms ask you to show the attribution "Powered by CoinGecko" wherever you display the data, discourage caching or storing data and ask that any stored data be refreshed at least every 24 hours and deleted if your access ends, and do not allow reselling, sub-licensing or redistributing access to the API itself. Check your plan's permitted use before you build a product on it. Nothing here is investment advice. This actor is an independent tool and is not made or endorsed by CoinGecko.

# Actor input Schema

## `mode` (type: `string`):

Pick one dataset. Coin modes use CoinGecko coin IDs (bitcoin, ethereum); onchain DEX modes use a GeckoTerminal network (eth, solana, base) and pool or token addresses. Modes marked paid plan need a CoinGecko Pro API key; everything else works on the free Demo key.

## `coinIds` (type: `array`):

CoinGecko API IDs such as bitcoin, ethereum, solana or tether, one per line (the search mode finds the ID of any coin). Read by coin prices, coin markets, coin details, snapshots, tickers, charts, OHLC and public treasury, each coin separately; filters exchange tickers and news.

## `symbols` (type: `array`):

Coin prices and coin markets only, used when no coin IDs are set: ticker symbols such as btc, eth or sol. A symbol can match several coins; the provider returns the top ranked one.

## `vsCurrency` (type: `string`):

Currency to price in, such as usd, eur, gbp, jpy, btc or eth. Coin prices and token prices accept several, comma separated (usd,eur).

## `category` (type: `string`):

Coin markets only. A CoinGecko category ID such as layer-1, meme-token, artificial-intelligence or decentralized-finance-defi (the categories mode lists them).

## `marketOrder` (type: `string`):

Coin markets only. How to sort the coin list.

## `priceChangeWindows` (type: `array`):

Coin markets and top gainers and losers. Extra price change percentages to add to each row.

## `days` (type: `string`):

Price chart: any whole number of days, or max. OHLC: 1, 7, 14, 30, 90, 180, 365 or max. Ignored when From and To are set.

## `from` (type: `string`):

Price chart and OHLC: start of a time range, as a date (2025-12-01), a date and time (2025-12-01T14:30) or a unix time in seconds. Set both From and To. OHLC ranges need a paid plan.

## `to` (type: `string`):

Price chart and OHLC: end of the time range. DEX pool OHLCV: read candles before this time.

## `interval` (type: `string`):

Price chart: daily or hourly (5 minute and 1 minute are Enterprise only); auto picks 5 minutes for 1 day, hourly up to 90 days and daily beyond. OHLC: daily or hourly need a paid plan.

## `date` (type: `string`):

Coin snapshot only. The date of the 00:00 UTC snapshot, such as 2025-12-30.

## `assetPlatform` (type: `string`):

Token prices: the chain of the contract addresses, as a CoinGecko asset platform ID such as ethereum, solana, binance-smart-chain or base. NFT markets: optional chain filter.

## `contractAddresses` (type: `array`):

Token prices only. Contract addresses on the asset platform, one per line.

## `exchangeIds` (type: `array`):

Exchange tickers: CoinGecko exchange IDs such as binance, gdax (Coinbase) or kraken, one per line. Coin tickers: optional filter to these exchanges.

## `treasuryEntity` (type: `string`):

Public treasury only. Public companies or governments.

## `nftIds` (type: `array`):

NFT collection details only. CoinGecko NFT IDs such as pudgy-penguins or cryptopunks, one per line.

## `searchQuery` (type: `string`):

Search: a coin, exchange, category or NFT name or symbol. DEX pool search: a pool address, token name, symbol or contract address.

## `duration` (type: `string`):

Top gainers and losers: 1h, 24h, 7d, 14d, 30d, 60d or 1y. Trending DEX pools: 5m, 1h, 6h or 24h.

## `topCoins` (type: `string`):

Top gainers and losers only. Rank the top 300, 500 or 1000 coins by market cap, or all coins.

## `network` (type: `string`):

GeckoTerminal network ID such as eth, solana, base, bsc, arbitrum or polygon_pos. Needed by top pools, pools and tokens by address, OHLCV and trades; optional for trending, new pools, pool search and the screener.

## `poolAddresses` (type: `array`):

DEX pools by address, pool OHLCV and pool trades. Pool contract addresses on the network, one per line.

## `tokenAddresses` (type: `array`):

Onchain tokens by address and top pools of a token. Token contract addresses on the network, one per line.

## `timeframe` (type: `string`):

DEX pool OHLCV only. Second candles need a paid plan.

## `aggregate` (type: `string`):

DEX pool OHLCV only. Units per candle: day 1; hour 1, 4 or 12; minute 1, 5 or 15; second 1, 15 or 30.

## `minTradeUsd` (type: `number`):

DEX pool trades only. Leave out trades smaller than this many US dollars.

## `poolSort` (type: `string`):

Top pools: h24_tx_count_desc or h24_volume_usd_desc. Top pools of a token: h24_volume_usd_liquidity_desc, h24_tx_count_desc or h24_volume_usd_desc. Screener: h6_trending, h24_volume_usd_desc, reserve_in_usd_desc, pool_created_at_desc and the other documented sorts.

## `includeRelated` (type: `boolean`):

Onchain pool and token modes. Adds the base and quote token and DEX details to each pool, and the top pools to each token.

## `minLiquidityUsd` (type: `number`):

DEX pool screener only. Minimum pool reserve in US dollars.

## `minVolumeUsd` (type: `number`):

DEX pool screener only. Minimum 24 hour volume in US dollars.

## `maxPoolAgeHours` (type: `number`):

DEX pool screener only. Only pools created within this many hours.

## `safetyChecks` (type: `array`):

DEX pool screener only. Keep pools that pass these GeckoTerminal checks.

## `newsLanguage` (type: `string`):

Crypto news only.

## `newsType` (type: `string`):

Crypto news only. Guides need one coin ID.

## `maxResults` (type: `integer`):

Row ceiling for the run. Each list page is one API call against your plan.

## `requestsPerMinute` (type: `integer`):

Pacing ceiling. The Demo plan allows about 30 to 100 calls a minute; paid plans allow more.

## `apiPlan` (type: `string`):

Which CoinGecko API the key belongs to. Auto tries the Pro API first and then the Demo API with one /ping each.

## `apiKey` (type: `string`):

Bring your own API key: your CoinGecko Demo or Pro key from the Developer Dashboard (it starts with CG-). Or set the DATA_API_KEY environment secret.

## Actor input object example

```json
{
  "mode": "coinMarkets",
  "coinIds": [
    "bitcoin",
    "ethereum"
  ],
  "vsCurrency": "usd",
  "marketOrder": "market_cap_desc",
  "days": "30",
  "interval": "auto",
  "treasuryEntity": "companies",
  "duration": "24h",
  "topCoins": "1000",
  "timeframe": "day",
  "aggregate": "1",
  "includeRelated": true,
  "newsLanguage": "en",
  "newsType": "all",
  "maxResults": 100,
  "requestsPerMinute": 30,
  "apiPlan": "auto"
}
```

# Actor output Schema

## `records` (type: `string`):

One row per price, market row, candle, ticker, collection, pool, token or trade.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "coinIds": [
        "bitcoin",
        "ethereum"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("nabeelbaghoor/crypto-price-ohlc-dex-pools-api").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "coinIds": [
        "bitcoin",
        "ethereum",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("nabeelbaghoor/crypto-price-ohlc-dex-pools-api").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "coinIds": [
    "bitcoin",
    "ethereum"
  ]
}' |
apify call nabeelbaghoor/crypto-price-ohlc-dex-pools-api --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,nabeelbaghoor/crypto-price-ohlc-dex-pools-api"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/NwzvboOrgBR5qQoNX/builds/lA4Yymjw33kVenDQV/openapi.json
