# Crypto Market Data (prices, market cap, volume) (`bgfc97/crypto-market-data`) Actor

Live crypto prices and market data for any coin or the top N by market cap: price, market cap, rank, 24h volume, 24h/7d change, ATH/ATL. Powered by CoinGecko. No key, no proxy.

- **URL**: https://apify.com/bgfc97/crypto-market-data.md
- **Developed by:** [Bruno](https://apify.com/bgfc97) (community)
- **Categories:** Developer tools, Business
- **Features:** Limited permissions
- **Stats:** 3 total users, 2 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.50 / 1,000 coin fetcheds

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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 Market Data — Prices, Market Cap & Volume

Get **live cryptocurrency market data** for any coin — or the **top N coins by market cap** — in one run. Price, market cap, rank, 24h volume, 24h/7d change, all-time high (ATH) and all-time low (ATL). Powered by CoinGecko. **No API key, no proxy.**

### What you get per coin

- 💲 Current price (in any fiat: usd, brl, eur, gbp…)
- 🏦 Market cap and market-cap rank
- 📊 24h trading volume
- 📈 24h and 7d price change (%)
- 🔺 All-time high (ATH) and 🔻 all-time low (ATL)

### Use cases

- **Portfolio & dashboards** — feed live prices into a sheet, bot, or app.
- **Alerts** — trigger when a coin moves X% or crosses a price.
- **Research & screening** — pull the top 100 coins and rank/filter them.
- **Reporting** — daily market snapshots for a newsletter or Notion page.

### Input

| Field | Type | Description |
|-------|------|-------------|
| `coinIds` | array | Specific coins by CoinGecko id (e.g. `["bitcoin","ethereum","solana"]`). Leave empty to use `topN`. |
| `topN` | integer | Return the top N coins by market cap (e.g. 50). |
| `vsCurrency` | string | Fiat to price against: `usd`, `brl`, `eur`, `gbp`… (default `usd`). |

#### Example input

```json
{ "coinIds": ["bitcoin", "ethereum"], "vsCurrency": "usd" }
```

or the top 25:

```json
{ "topN": 25, "vsCurrency": "brl" }
```

### Output

```json
{
  "id": "bitcoin", "symbol": "btc", "name": "Bitcoin",
  "price": 64250.12, "market_cap": 1267000000000, "market_cap_rank": 1,
  "volume_24h": 28500000000, "change_24h_pct": 1.84, "change_7d_pct": -3.1,
  "ath": 73738, "atl": 67.81, "vs_currency": "usd"
}
```

Export to JSON, CSV, Excel or Google Sheets, or read it via the Apify API.

### FAQ

**Do I need a key?** No. Works out of the box, no proxy needed.

**How fresh is the data?** Live from CoinGecko at run time.

**How am I charged?** Pay per result — you only pay for the coins you pull.

# Actor input Schema

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

CoinGecko coin ids (bitcoin, ethereum, solana...).

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

Alternative: return the top N coins by market cap (ignored if coinIds set).

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

Currency to price in (usd, brl, eur...).

## Actor input object example

```json
{
  "coinIds": [
    "bitcoin",
    "ethereum",
    "solana"
  ],
  "topN": 0,
  "vsCurrency": "usd"
}
```

# 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",
        "solana"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("bgfc97/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 = { "coinIds": [
        "bitcoin",
        "ethereum",
        "solana",
    ] }

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

```

## MCP server setup

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