# Crypto Market Data — Live Prices & OHLCV Candles (`alleserojje/crypto-market-data`) Actor

Live crypto prices and candlestick (OHLCV) history from the Binance public API — top coins by volume or any symbol list. One structured dataset row per symbol, with optional kline history for backtesting. No API key. Built for trading, quant and research agents. Pay only per symbol.

- **URL**: https://apify.com/alleserojje/crypto-market-data.md
- **Developed by:** [Pedro Resende](https://apify.com/alleserojje) (community)
- **Categories:** Automation, AI, Agents
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 symbol 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?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Crypto Market Data — Live Prices & Market Cap

Live crypto prices, market cap, volume and 24h stats from the **CoinGecko public
API — no API key required.** One clean, structured dataset row per coin, with an
optional 7-day price sparkline.

Built for **trading bots, quant researchers, portfolio trackers, and AI agents**
that need reliable crypto market data without wiring up a data provider.

### Features

- 🏆 **Top coins by market cap** — or volume, CoinGecko rank, or any explicit coin list.
- 📈 **Rich 24h stats** — price, market cap, rank, volume, high/low, supply, ATH/ATL.
- 🕯️ **Price change windows** — 1h / 24h / 7d (and 14d / 30d / 1y on request).
- ✨ **7d sparkline** — optional price history array per coin.
- 💰 **Pay-per-event** — charged once per coin returned.

### Input

| Field | Type | Description |
|-------|------|-------------|
| `vsCurrency` | string | Quote currency (default `usd`). |
| `ids` | string\[] | Specific CoinGecko coin ids. Empty = top-N. |
| `topN` | integer | Coins in auto mode (1–250, default 20). |
| `order` | string | `market_cap_desc` | `volume_desc` | `gecko_desc` | `id_asc` … |
| `priceChangePercentages` | string | Comma windows, e.g. `1h,24h,7d`. |
| `includeSparkline` | boolean | Attach 7-day price history. |
| `proxy` | object | Optional Apify proxy. |

### Output example

```json
{
  "id": "bitcoin",
  "symbol": "btc",
  "name": "Bitcoin",
  "current_price": 79762,
  "market_cap": 1601813551255,
  "market_cap_rank": 1,
  "total_volume": 38311063650,
  "high_24h": 82108,
  "low_24h": 78706,
  "price_change_percentage_24h": -2.1872,
  "price_change_percentage_7d": 3.41,
  "circulating_supply": 20079703.0,
  "max_supply": 21000000.0,
  "ath": 126080,
  "last_updated": "2026-09-04T20:49:20.000Z",
  "sparkline_7d": [77528.0, 77398.3, "..."],
  "vs_currency": "usd",
  "scrapedAt": "2026-09-04T20:55:00.000Z"
}
```

### Run via API

```bash
curl -X POST "https://api.apify.com/v2/acts/ALLESEROJJE~crypto-market-data/runs?token=YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "vsCurrency": "usd",
    "topN": 100,
    "priceChangePercentages": "1h,24h,7d,30d",
    "includeSparkline": true
  }'
```

### Pricing

**$0.002 per coin** returned (pay-per-event). Sparkline history is included at
no extra charge.

# Actor input Schema

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

Currency to quote prices and market cap in (e.g. usd, eur, gbp, brl).

## `ids` (type: `array`):

Specific CoinGecko coin ids to fetch (e.g. bitcoin, ethereum, solana). Leave empty to auto-pick top coins.

## `topN` (type: `integer`):

Coins to return when 'ids' is empty (1–250, default 20).

## `order` (type: `string`):

Ranking when auto-picking coins.

## `priceChangePercentages` (type: `string`):

Comma-separated windows to include (1h, 24h, 7d, 14d, 30d, 1y).

## `includeSparkline` (type: `boolean`):

Attach a 7-day price history array to each coin.

## `proxy` (type: `object`):

Optional — datacenter proxy available for large jobs.

## Actor input object example

```json
{
  "vsCurrency": "usd",
  "ids": [
    "bitcoin",
    "ethereum",
    "solana"
  ],
  "topN": 20,
  "order": "market_cap_desc",
  "priceChangePercentages": "1h,24h,7d",
  "includeSparkline": false,
  "proxy": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

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

No description

# 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 = {
    "vsCurrency": "usd",
    "ids": []
};

// Run the Actor and wait for it to finish
const run = await client.actor("alleserojje/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 = {
    "vsCurrency": "usd",
    "ids": [],
}

# Run the Actor and wait for it to finish
run = client.actor("alleserojje/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 '{
  "vsCurrency": "usd",
  "ids": []
}' |
apify call alleserojje/crypto-market-data --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,alleserojje/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/p91hO58LQkwAEFkmP/builds/16FI9jBHqMQYiEnlH/openapi.json
