# CoinGecko, DexScreener & Binance Scraper – Crypto Prices, OHLCV (`openharvest/crypto-market-data`) Actor

CoinGecko, DexScreener, GeckoTerminal and Binance in one Actor: crypto prices, market caps, DEX pairs, trending and new pools, Binance tickers and OHLCV candles in one flat, unified format. Public APIs, no API keys, pay per result.

- **URL**: https://apify.com/openharvest/crypto-market-data.md
- **Developed by:** [Enes Bulanık](https://apify.com/openharvest) (community)
- **Categories:** Developer tools, Automation, Business
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.50 / 1,000 records

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

## CoinGecko, DexScreener & Binance Scraper – Crypto Prices, OHLCV

CoinGecko, DexScreener, GeckoTerminal and Binance in one Actor: crypto prices, market caps, DEX pairs, trending and new pools, Binance tickers and OHLCV candles in one flat, unified format. Public APIs, no API keys, pay per result.

**Price: $0.50 per 1,000 records** and **$2 per 1,000 OHLCV series**. Empty results and failed inputs are always free.

> **Disclaimer:** this Actor provides market data only. It is **not financial, investment or trading advice**, and it does not trade or connect to any wallet or exchange account. Prices from public APIs can be delayed or wrong, so check them before you act on them.

### What does Crypto Market Data do?

It calls the **official public APIs** of four major crypto data sources and turns them into one schema. Every record has a `type` (`coin`, `pair`, `ticker`, `ohlcv` or `error`), a `mode` and a `source`.

| Mode | Source | What you get |
|---|---|---|
| `topCoins` *(default)* | CoinGecko `coins/markets` | Coins ranked by market cap, optionally within a category (`meme-token`, `layer-1`, `artificial-intelligence`...). Price, market cap, FDV, 24h volume, 1h/24h/7d/30d change, supply, ATH/ATL |
| `trendingCoins` | CoinGecko `search/trending` | The coins people search for most right now, with price, market cap and 24h change |
| `coinDetails` | CoinGecko `coins/{id}` | Everything in `topCoins` plus description, categories, homepage, whitepaper, X/Twitter, GitHub, explorers, contract addresses per chain, genesis date and sentiment |
| `searchPairs` | DexScreener search, GeckoTerminal as fallback | DEX pairs matching a name, symbol, pair (`SOL/USDC`) or address, sorted by liquidity |
| `tokenPairs` | DexScreener token pairs, GeckoTerminal as fallback | Every DEX pool that trades the token contract addresses you enter |
| `trendingPools` | GeckoTerminal `trending_pools` | Trending DEX pools on all chains or on one chain, over 5m / 1h / 6h / 24h |
| `newPools` | GeckoTerminal `new_pools` | **Newly created pools (new token launches)** on all chains or on one chain, with optional liquidity and volume filters against spam |
| `exchangeTickers` | Binance `ticker/24hr` | 24h tickers for your symbols, or the most-traded pairs in a quote asset (USDT, USDC, BTC, EUR, TRY...) |
| `ohlcv` | Binance `klines`, CoinGecko `ohlc`, GeckoTerminal pool `ohlcv` | One candle series per target: CEX pair, coin or DEX pool. Intervals from 1m to 1d, up to 1,000 candles |

All DEX pairs share the same fields whether they come from DexScreener or GeckoTerminal: `chain`, `dex`, `pairAddress`, `pairName`, `baseTokenAddress/Name/Symbol`, `quoteToken*`, `priceUsd`, `priceNative`, price change over 5m/1h/6h/24h, volume over 1h/6h/24h, `buys24h`, `sells24h`, `txns24h`, `liquidityUsd`, `fdvUsd`, `marketCapUsd`, `pairCreatedAt`, `url`, plus websites and socials when DexScreener has them.

### Why use it?

- **One Actor instead of four.** Other Store actors cover a single source. This one combines CoinGecko, DexScreener, GeckoTerminal and Binance with the same field names.
- **Built to stay up.** It paces every source below its documented public rate limit, backs off on HTTP 429, and falls back from DexScreener to GeckoTerminal when DexScreener is down or returns nothing. Binance data comes from `data-api.binance.vision`, which is not geo-blocked for US servers.
- **Cheap.** $0.0005 per record. Calling it with `{}` returns the top 20 coins for **$0.01** in a few seconds.
- **Good for AI agents.** The input is small and typed, the output is flat, and every record says which source it came from.

### Use cases

- **Portfolio and price dashboards:** pull prices for your coins into Google Sheets, Airtable or a database on a schedule.
- **New-token and memecoin monitoring:** watch `newPools` on Solana or Base with a minimum-liquidity filter and alert on new launches.
- **DEX research:** compare liquidity and volume of every pool that trades a token across chains and DEXs.
- **Backtesting and charts:** download OHLCV candles for CEX pairs and on-chain pools in one format.
- **AI agents and RAG:** give an LLM live market data ("what's trending on Solana in the last hour?").
- **Newsletters and content:** daily top movers, trending coins and new listings.

### How to use it

1. Click **Try for free** or **Start**.
2. Choose a **Mode** and fill in the field for that mode: coins, search query, token addresses, chain or OHLCV targets.
3. Click **Start**, then download JSON, CSV or Excel, or connect the dataset to Make, Zapier, n8n, Google Sheets, webhooks or the API.

### Input

| Field | Used by | Description |
|---|---|---|
| `mode` | all | `topCoins` (default), `trendingCoins`, `coinDetails`, `searchPairs`, `tokenPairs`, `trendingPools`, `newPools`, `exchangeTickers`, `ohlcv` |
| `maxItems` | all except ohlcv | Max records (per token in `tokenPairs`). Default `20` |
| `vsCurrency` | CoinGecko modes | `usd` (default), `eur`, `gbp`, `jpy`, `try`, `btc`, ... |
| `category` | topCoins | CoinGecko category id, e.g. `meme-token`, `layer-1` |
| `coinIds` | coinDetails | Ids (`bitcoin`), symbols (`ETH`), names or coingecko.com URLs |
| `searchQuery` | searchPairs | e.g. `PEPE`, `SOL/USDC`, an address |
| `tokenAddresses` | tokenPairs | Token contract or mint addresses |
| `chain` | DEX modes | `ethereum`, `solana`, `bsc`, `base`, `arbitrum`, `polygon`, ... (`eth`, `sol`, `bnb` also work) |
| `trendingDuration` | trendingPools | `5m`, `1h`, `6h`, `24h` (default) |
| `minLiquidityUsd`, `minVolume24hUsd` | DEX modes | Skip pairs below these values |
| `symbols` / `quoteAsset` | exchangeTickers | e.g. `["BTCUSDT","ETH/USDT"]`, or empty + `USDT` for the top pairs |
| `ohlcvTargets` | ohlcv | `binance:BTCUSDT`, `coingecko:bitcoin`, `eth:0xPOOL`, `solana:POOL`, or a GeckoTerminal / DexScreener pool URL |
| `ohlcvInterval` / `ohlcvLimit` | ohlcv | `1m`, `5m`, `15m`, `1h` (default), `4h`, `12h`, `1d` / candles per series (default 100, max 1,000) |
| `dexSource` | searchPairs, tokenPairs | `auto` (default), `dexscreener`, `geckoterminal` |
| `coingeckoApiKey` | CoinGecko modes | Optional free CoinGecko Demo key for large runs |

Example: new Solana pools with at least $10k liquidity

```json
{
    "mode": "newPools",
    "chain": "solana",
    "minLiquidityUsd": 10000,
    "maxItems": 50
}
```

Example: hourly candles for a CEX pair, a coin and a DEX pool

```json
{
    "mode": "ohlcv",
    "ohlcvTargets": ["binance:BTCUSDT", "coingecko:ethereum", "eth:0xa43fe16908251ee70ef74718545e4fe6c5ccec9f"],
    "ohlcvInterval": "1h",
    "ohlcvLimit": 168
}
```

### Output

Real output from test runs (shortened).

**Coin** (`topCoins`)

```json
{
    "type": "coin", "mode": "topCoins", "source": "coingecko",
    "coinId": "bitcoin", "symbol": "BTC", "name": "Bitcoin", "rank": 1, "currency": "USD",
    "price": 83389, "marketCap": 1675697422855, "fullyDilutedValuation": 1675697422855, "volume24h": 39215136107,
    "high24h": 85643, "low24h": 82823, "priceChangePercent1h": 0.0113, "priceChangePercent24h": -2.5473,
    "priceChangePercent7d": -0.2187, "priceChangePercent30d": 5.0776,
    "circulatingSupply": 20094918, "totalSupply": 20094946, "maxSupply": 21000000,
    "ath": 126080, "athChangePercent": -33.8601, "athDate": "2025-10-06T10:57:42.000Z",
    "imageUrl": "https://coin-images.coingecko.com/coins/images/1/large/bitcoin.png?1696501400",
    "url": "https://www.coingecko.com/en/coins/bitcoin", "lastUpdated": "2026-10-07T20:59:40.000Z"
}
```

`coinDetails` adds `description`, `categories`, `genesisDate`, `hashingAlgorithm`, `homepage`, `whitepaper`, `twitter`, `subreddit`, `github`, `explorers`, `contractAddresses` (e.g. `{"ethereum": "0x…", "solana": "…"}`), `sentimentUpPercent` and `watchlistUsers`.

**DEX pair** (`tokenPairs`, from DexScreener)

```json
{
    "type": "pair", "mode": "tokenPairs", "source": "dexscreener",
    "chain": "ethereum", "dex": "uniswap", "pairAddress": "0xA43fe16908251ee70EF74718545e4FE6C5cCEc9f", "pairName": "PEPE / WETH",
    "url": "https://dexscreener.com/ethereum/0xa43fe16908251ee70ef74718545e4fe6c5ccec9f", "labels": ["v2"],
    "baseTokenAddress": "0x6982508145454Ce325dDbE47a25d4ec3d2311933", "baseTokenName": "Pepe", "baseTokenSymbol": "PEPE",
    "quoteTokenSymbol": "WETH", "priceUsd": 0.000004073, "priceNative": 1.582e-9,
    "priceChangePercent1h": 0.71, "priceChangePercent24h": -4.44, "volume24h": 701631.93,
    "buys24h": 172, "sells24h": 188, "txns24h": 360, "liquidityUsd": 30172429.65,
    "fdvUsd": 1685523468, "marketCapUsd": 1685523468, "pairCreatedAt": "2023-04-14T17:21:11.000Z",
    "websites": ["https://www.pepe.vip/"], "socials": [{ "platform": "twitter", "url": "https://twitter.com/pepecoineth" }],
    "input": "0x6982508145454Ce325dDbE47a25d4ec3d2311933"
}
```

**New pool** (`newPools`, from GeckoTerminal)

```json
{
    "type": "pair", "mode": "newPools", "source": "geckoterminal",
    "chain": "base", "dex": "uniswap-v4-base", "pairName": "DOTF / WETH 0.3%",
    "pairAddress": "0x25efe43a0747ed7eb427040469df6f5a81df19ce7f4dce3f19f3b87c46089728",
    "url": "https://www.geckoterminal.com/base/pools/0x25efe43a0747ed7eb427040469df6f5a81df19ce7f4dce3f19f3b87c46089728",
    "baseTokenAddress": "0x0bd2e5f68aa6b0feb6cd4afbde6f012a571844cc", "baseTokenName": "Digital Oil Trust Fund", "baseTokenSymbol": "DOTF",
    "quoteTokenSymbol": "WETH", "priceUsd": 0.0403848583635833, "volume24h": 2301.62, "txns24h": 2,
    "liquidityUsd": 67232.1062, "fdvUsd": 403848583.6, "pairCreatedAt": "2026-10-07T21:02:31.000Z"
}
```

**Ticker** (`exchangeTickers`)

```json
{
    "type": "ticker", "mode": "exchangeTickers", "source": "binance",
    "symbol": "BTCUSDT", "baseAsset": "BTC", "quoteAsset": "USDT", "lastPrice": 83371.03,
    "priceChange24h": -2166.98, "priceChangePercent24h": -2.533, "high24h": 85657.01, "low24h": 82787.25,
    "bidPrice": 83371.02, "askPrice": 83371.03, "volume24hBase": 20602.41556, "volume24hQuote": 1728209447.18,
    "trades24h": 4827748, "url": "https://www.binance.com/en/trade/BTC_USDT"
}
```

**OHLCV series** (`ohlcv`): one record per target, with candles oldest first

```json
{
    "type": "ohlcv", "mode": "ohlcv", "source": "binance", "target": "binance:BTCUSDT",
    "symbol": "BTCUSDT", "baseAsset": "BTC", "quoteAsset": "USDT", "interval": "1h", "currency": "USDT",
    "candlesCount": 24, "firstTime": "2026-10-06T22:00:00.000Z", "lastTime": "2026-10-07T21:00:00.000Z",
    "open": 85609.99, "close": 83368, "high": 85657.01, "low": 82787.25, "changePercent": -2.6188,
    "candles": [
        { "time": "2026-10-06T22:00:00.000Z", "open": 85609.99, "high": 85657.01, "low": 85469.65, "close": 85534.53, "volume": 274.20635, "quoteVolume": 23465253.16, "trades": 38035 }
    ]
}
```

**Error (free)**

```json
{ "type": "error", "source": "binance", "input": "FOOBARUSDT", "errorCode": "NOT_FOUND", "error": "Binance has no trading pair \"FOOBARUSDT\"." }
```

Possible `errorCode` values: `NO_RESULTS`, `NOT_FOUND`, `INVALID_INPUT`, `RATE_LIMITED`, `SOURCE_FAILED`.

**Field notes**

- Percent fields are percentages (`-2.5` = −2.5%). Prices are plain numbers, never strings.
- `chain` uses DexScreener-style ids (`ethereum`, `solana`, `bsc`, `base`, `polygon`) for both DEX sources.
- CoinGecko's free OHLC endpoint picks the candle size itself (30m for 1 day, 4h for up to 30 days, 4d beyond) and has no volume. The record shows the actual `interval` and a `note`. Use `binance:` or a DEX pool target for exact intervals with volume.
- The `ohlcv` view shows one row per series. Export JSON to get the full `candles` arrays.

The dataset has ready-made views: **Overview (coins)**, **DEX pairs & pools**, **Exchange tickers**, **OHLCV series** and **Errors & status**.

### Pricing

Pay per event: you only pay for data you receive. Platform usage is included.

| Event | Price | When it is charged |
|---|---|---|
| `record` | **$0.0005** ($0.50 / 1,000) | Each coin, DEX pair/pool or ticker saved |
| `ohlcv-series` | **$0.002** per series | Each OHLCV series (up to 1,000 candles) saved |
| Errors / empty results | **Free** | Unknown coins, invalid symbols, sources that are down |

| Job | Cost |
|---|---|
| Default run (top 20 coins) | **$0.01** |
| 100 new Solana pools, every hour for a day | 24 × $0.05 = **$1.20** |
| 1 week of hourly candles (168) for 10 pairs | 10 × $0.002 = **$0.02** |
| Top 1,000 coins | **$0.50** |

Set **Max cost per run** in the run options and the Actor stops cleanly at your budget.

### Use with AI agents (MCP)

This Actor works as a tool for AI agents through the [Apify MCP server](https://mcp.apify.com). Add it with `https://mcp.apify.com?tools=openharvest/crypto-market-data`, or let the agent find it with `search-actors` ("crypto prices dex new tokens").

Example `call-actor` input an agent can use to answer "What are the hottest pools on Solana in the last hour?":

```json
{
    "mode": "trendingPools",
    "chain": "solana",
    "trendingDuration": "1h",
    "minLiquidityUsd": 20000,
    "maxItems": 10
}
```

The agent reads `pairName`, `priceUsd`, `priceChangePercent1h`, `volume24h`, `liquidityUsd` and `url`. A run like this finishes in about 2 seconds and costs $0.005.

### FAQ

**Do I need API keys?**
No. All four sources have free public endpoints. A free CoinGecko Demo key is optional and only helps with very large `coinDetails` runs.

**How fresh is the data?**
It is as fresh as each API: Binance is real-time, DexScreener and GeckoTerminal update within seconds to a minute, and CoinGecko's free API is cached for about 1 to 5 minutes.

**What are the rate limits?**
The Actor paces itself under each provider's public limits: CoinGecko about 1 call every 2.5 s, GeckoTerminal 30 calls/min, DexScreener 300 calls/min and Binance far below its 6,000 weight/min. On HTTP 429 it waits and retries with exponential backoff. Large `coinDetails` runs (one call per coin) are the slowest. Use `topCoins` when you only need market data.

**Why did a DEX pair come from GeckoTerminal although I chose auto?**
DexScreener sometimes returns empty results or errors. In `auto` mode the Actor then asks GeckoTerminal, so you still get data in the same schema. Check the `source` field.

**Which chains are supported?**
Every chain DexScreener and GeckoTerminal support: Ethereum, Solana, BNB Chain, Base, Arbitrum, Polygon, Avalanche, Optimism, TON, Sui, Tron, Blast, Sonic, Hyperliquid and over 100 more.

**Can it place trades or read my wallet?**
No. It only reads public market data and never needs any account or wallet.

**Is it financial advice?**
No. This is raw market data for research and analytics. Newly created pools in particular can be scams or honeypots. Always do your own research.

### Is it legal to use this data?

The Actor only reads **public market data** that CoinGecko, DexScreener, GeckoTerminal and Binance publish through their own public APIs. It collects no personal data. Each provider has its own terms of use. CoinGecko and GeckoTerminal, for example, ask for attribution ("Data provided by CoinGecko") when you display their data publicly, and some terms restrict commercial redistribution. Make sure your use complies with them. **Not financial advice.**

### Related actors

- Polymarket, Kalshi & Manifold Scraper – Prediction Markets, Odds & Price History
- Google Trends Scraper *(coming soon)*
- Hacker News Scraper *(coming soon)*
- Telegram Channel Scraper – Public Posts, Views & Media

### Support & feedback

Found a bug or a missing field? Open an issue in the **Issues** tab and we usually reply within a day.

# Actor input Schema

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

What to fetch. <b>topCoins</b>: coins ranked by market cap (CoinGecko). <b>trendingCoins</b>: CoinGecko trending searches. <b>coinDetails</b>: full profile + market data for specific coins. <b>searchPairs</b>: DEX pairs matching a keyword (DexScreener, GeckoTerminal fallback). <b>tokenPairs</b>: all DEX pairs of token contract addresses. <b>trendingPools</b> / <b>newPools</b>: trending or newly created DEX pools (GeckoTerminal), optionally per chain. <b>exchangeTickers</b>: Binance 24h tickers. <b>ohlcv</b>: candle series (Binance, CoinGecko or any DEX pool).

## `maxItems` (type: `integer`):

Maximum number of records to save (per token address in tokenPairs mode). You pay per record, so this also caps your cost. Not used in ohlcv mode (one series per target).

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

Currency for CoinGecko prices and market caps: <code>usd</code>, <code>eur</code>, <code>gbp</code>, <code>jpy</code>, <code>try</code>, <code>btc</code>, <code>eth</code>... Used by topCoins, coinDetails and CoinGecko OHLCV. DEX data is always in USD.

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

Optional CoinGecko category id to rank coins within, e.g. <code>layer-1</code>, <code>meme-token</code>, <code>decentralized-finance-defi</code>, <code>artificial-intelligence</code>, <code>solana-ecosystem</code>. The id is the last part of a coingecko.com/en/categories/... URL.

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

CoinGecko coin ids (<code>bitcoin</code>), symbols (<code>BTC</code>), names or coingecko.com coin URLs. Symbols are resolved with CoinGecko search (the best-ranked match wins).

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

Token name, symbol, pair (<code>SOL/USDC</code>) or address to search DEX pairs for.

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

Token contract / mint addresses. Returns every DEX pair (pool) that trades the token, sorted by liquidity. Set <b>Chain</b> to speed up lookups and avoid ambiguity.

## `chain` (type: `string`):

Optional chain filter for DEX modes: <code>ethereum</code>, <code>solana</code>, <code>bsc</code>, <code>base</code>, <code>arbitrum</code>, <code>polygon</code>, <code>avalanche</code>, <code>optimism</code>, <code>ton</code>, <code>sui</code>... Short forms (<code>eth</code>, <code>sol</code>, <code>bnb</code>) work too. Empty = all chains.

## `trendingDuration` (type: `string`):

Time window GeckoTerminal uses to rank trending pools.

## `minLiquidityUsd` (type: `integer`):

DEX modes only: skip pairs/pools with less liquidity than this. Useful to filter out spam tokens in newPools.

## `minVolume24hUsd` (type: `integer`):

DEX modes only: skip pairs/pools with lower 24h trading volume.

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

Binance spot symbols such as <code>BTCUSDT</code>, <code>ETH/USDT</code>, <code>SOL-USDC</code>. Leave empty to get the most traded pairs in the quote asset below.

## `quoteAsset` (type: `string`):

When no symbols are given, list the top pairs quoted in this asset by 24h quote volume, e.g. <code>USDT</code>, <code>USDC</code>, <code>FDUSD</code>, <code>BTC</code>, <code>EUR</code>, <code>TRY</code>.

## `ohlcvTargets` (type: `array`):

One candle series per target. Formats: <code>binance:BTCUSDT</code> (exact intervals + volume), <code>coingecko:bitcoin</code> (aggregated price, interval chosen by CoinGecko), <code>\<chain>:\<poolAddress></code> such as <code>eth:0xa43fe16908251ee70ef74718545e4fe6c5ccec9f</code>, or a GeckoTerminal / DexScreener pool URL.

## `ohlcvInterval` (type: `string`):

Candle size. Binance and DEX pools support all intervals; CoinGecko picks 30m / 4h / 4d automatically from the time window.

## `ohlcvLimit` (type: `integer`):

Number of most recent candles per series (max 1000).

## `dexSource` (type: `string`):

<b>auto</b> (recommended): DexScreener first, GeckoTerminal when DexScreener fails or has no result. Or force one source. Trending/new pools always use GeckoTerminal.

## `coingeckoApiKey` (type: `string`):

Optional free CoinGecko Demo API key for higher, more stable rate limits on large coinDetails runs. Not needed for normal use.

## Actor input object example

```json
{
  "mode": "searchPairs",
  "maxItems": 50,
  "vsCurrency": "eur",
  "category": "meme-token",
  "coinIds": [
    "bitcoin",
    "ETH",
    "https://www.coingecko.com/en/coins/solana"
  ],
  "searchQuery": "PEPE",
  "tokenAddresses": [
    "0x6982508145454Ce325dDbE47a25d4ec3d2311933",
    "JUPyiwrYJFskUPiHa7hkeR8VUtAeFoSYbKedZNsDvCN"
  ],
  "chain": "solana",
  "trendingDuration": "1h",
  "minLiquidityUsd": 10000,
  "minVolume24hUsd": 50000,
  "symbols": [
    "BTCUSDT",
    "ETHUSDT",
    "SOLUSDT"
  ],
  "quoteAsset": "USDC",
  "ohlcvTargets": [
    "binance:BTCUSDT",
    "solana:Czfq3xZZDmsdGdUyrNLtRhGc47cXcZtLG4crryfu44zE"
  ],
  "ohlcvInterval": "1d",
  "ohlcvLimit": 500,
  "dexSource": "auto"
}
```

# Actor output Schema

## `results` (type: `string`):

All scraped items in the default dataset (JSON, CSV, Excel and more via the dataset export).

## `files` (type: `string`):

Records saved in the default key-value store, e.g. the run summary.

# 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 = {
    "mode": "topCoins",
    "maxItems": 20,
    "coinIds": [
        "bitcoin",
        "ethereum",
        "solana"
    ],
    "searchQuery": "PEPE",
    "tokenAddresses": [
        "0x6982508145454Ce325dDbE47a25d4ec3d2311933"
    ],
    "ohlcvTargets": [
        "binance:BTCUSDT",
        "coingecko:ethereum",
        "eth:0xa43fe16908251ee70ef74718545e4fe6c5ccec9f"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("openharvest/crypto-market-data").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 = {
    "mode": "topCoins",
    "maxItems": 20,
    "coinIds": [
        "bitcoin",
        "ethereum",
        "solana",
    ],
    "searchQuery": "PEPE",
    "tokenAddresses": ["0x6982508145454Ce325dDbE47a25d4ec3d2311933"],
    "ohlcvTargets": [
        "binance:BTCUSDT",
        "coingecko:ethereum",
        "eth:0xa43fe16908251ee70ef74718545e4fe6c5ccec9f",
    ],
}

# Run the Actor and wait for it to finish
run = client.actor("openharvest/crypto-market-data").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 '{
  "mode": "topCoins",
  "maxItems": 20,
  "coinIds": [
    "bitcoin",
    "ethereum",
    "solana"
  ],
  "searchQuery": "PEPE",
  "tokenAddresses": [
    "0x6982508145454Ce325dDbE47a25d4ec3d2311933"
  ],
  "ohlcvTargets": [
    "binance:BTCUSDT",
    "coingecko:ethereum",
    "eth:0xa43fe16908251ee70ef74718545e4fe6c5ccec9f"
  ]
}' |
apify call openharvest/crypto-market-data --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,openharvest/crypto-market-data"
        }
    }
}
```

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/074EKQv3a8MV4rrkH/builds/Sz26A0yu0oOgDYJi5/openapi.json
