# Coinbase Order Book, Candles & Trades Scraper (`parseforge/coinbase-orderbook-candles-scraper`) Actor

Scrapes Coinbase Exchange market data for any trading pair. Returns order book depth, OHLCV candles, recent trades, and live tickers as flat rows. No API key required.

- **URL**: https://apify.com/parseforge/coinbase-orderbook-candles-scraper.md
- **Developed by:** [ParseForge](https://apify.com/parseforge) (community)
- **Categories:** Business, Developer tools, Automation
- **Stats:** 1 total users, 0 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $22.49 / 1,000 result items

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

[![ParseForge](https://raw.githubusercontent.com/ParseForge/apify-assets/main/banner.jpg)](https://apify.com/parseforge?fpr=vmoqkp)

### Coinbase Order Book, Candles & Trades Scraper

**Scrape Coinbase order books, OHLCV candles, recent trades, and live tickers for any trading pair.** Get market depth, price history, and executed trades in one flat dataset. No API key or login required. Export to CSV, JSON, Excel, or XML.

Coinbase's official API needs authentication, rate limits, and separate endpoints for each data type. This reads the public market data feeds directly, so you can pull order book depth, candles, trades, and tickers for hundreds of pairs in one run. Each row is a flat record with the pair, timestamp, and the data you enabled.

| Who uses it | What they scrape Coinbase Exchange for |
|---|---|
| Quantitative traders | Backtest strategies on historical candles and order book depth |
| Market analysts | Track liquidity and price trends across many pairs |
| Crypto researchers | Study order flow and trade execution patterns |
| Portfolio managers | Monitor live prices and 24h volume for rebalancing |

### What it does

This Actor collects Coinbase Exchange market data for the trading pairs you choose, and returns each pair's ticker, order book snapshot, candles, and recent trades as flat rows.

- 📊 **Live ticker:** last price, bid, ask, best-of-book size, and 24h stats including open, high, low, volume, and 30-day volume.
- 📚 **Order book depth:** L1 best bid/ask, L2 top 50 aggregated, or L3 full non-aggregated book, with configurable depth.
- 🕯️ **OHLCV candles:** open, high, low, close, and volume for intervals from 1 minute to 1 day, with optional date range.
- 🔁 **Recent trades:** the most recent executed trades per pair, with price, size, side, and timestamp.
- 🌐 **All pairs or a subset:** scrape every Coinbase pair, filter by quote currency or status, or pick specific product IDs.

Results export to CSV, JSON, Excel, or XML, or straight from the API.

### What you can do with Coinbase Exchange data

**📈 Backtest trading strategies.**

A quant trader pulls 1-hour candles and L2 order book snapshots for BTC-USD and ETH-USD over a month to test a mean-reversion model.

**🔍 Monitor market liquidity.**

A market analyst scrapes order book depth for the top 50 pairs by volume each morning to spot thinning books before volatility.

**🧪 Study order flow.**

A crypto researcher collects recent trades and L3 order books for a new token to analyze execution patterns and spoofing.

**📊 Track portfolio prices.**

A portfolio manager runs the Actor hourly on 20 pairs to update a dashboard with live tickers and 24h volume.

### Why choose this scraper

|  | What you get |
|---|---|
| **One run, four data types** | Ticker, order book, candles, and trades in a single dataset |
| **No API key or login** | Reads public market data directly, no authentication |
| **Configurable depth and range** | Choose L1, L2, or L3 order book, candle interval, and date range |
| **Flat, export-ready rows** | Each record is a flat object, ready for CSV, JSON, Excel, or XML |

### How it compares

No other Store actor targets Coinbase Exchange the same way, so the honest comparison is with the alternatives teams actually weigh.

| | Coinbase Order Book, Candles & Trades Scraper | Build it in-house | By hand |
|---|---|---|---|
| Setup | Run it now, zero config | Days of engineering | None, but hours per pull |
| When Coinbase Exchange changes | Maintained for you | You fix it | You re-learn the page |
| Proxies, retries, anti-bot | Built in | Your problem | Browser only |
| Output | Fixed JSON schema, CSV/Excel export | Whatever you build | Copy-paste |
| Cost | Pay per result | Engineering time | Analyst hours |

### Configure the run

Drive the Actor from trading pairs, quote currency, and status filters, and toggle each data module on or off so only the data you need reaches your dataset. The Input tab lists every parameter.

A first run with the defaults:

```json
{
  "productIds": [
    "BTC-USD",
    "ETH-USD",
    "SOL-USD",
    "XRP-USD",
    "DOGE-USD"
  ],
  "maxItems": 10
}
```

A larger pull:

```json
{
  "productIds": [
    "BTC-USD",
    "ETH-USD",
    "SOL-USD",
    "XRP-USD",
    "DOGE-USD"
  ],
  "maxItems": 200
}
```

### Pricing

Pay-per-result: **$0.02999 per result** collected. You pay only for the results written to your dataset.

| Results collected | Approximate cost |
|---|---|
| 100 results | $3.00 |
| 1,000 results | $29.99 |
| 10,000 results | $299.90 |

New Apify accounts start with $5 in free credit.

### Free users

Free-plan runs return up to 10 results as a preview. [Upgrade your Apify plan](https://console.apify.com/sign-up?fpr=vmoqkp) to collect up to 1,000,000 results per run.

### Run it

1. [Create a free Apify account with $5 in credit](https://console.apify.com/sign-up?fpr=vmoqkp).
2. Open the [Coinbase Order Book, Candles & Trades Scraper](https://apify.com/parseforge/coinbase-orderbook-candles-scraper?fpr=vmoqkp).
3. Set your inputs and any filters, then click **Start**.
4. Export the results as CSV, Excel, JSON, or XML from the **Dataset** tab.

Run it programmatically through the [Apify API](https://docs.apify.com/api/v2) (`run-sync-get-dataset-items`) or the [ApifyClient](https://docs.apify.com/api/client/js) for JavaScript and Python.

### Use with AI agents (MCP)

Give an AI agent live access to Coinbase Exchange through the Model Context Protocol. Add the Actor to Claude, Cursor, or any MCP client:

```bash
claude mcp add --transport http apify "https://mcp.apify.com/?tools=parseforge/coinbase-orderbook-candles-scraper"
```

Then prompt it in plain language to run the scraper and read back the results.

### Troubleshooting

**Why am I getting no results?**

Check your filters. If Status is set to Online but the pair is delisted, or if Quote Currency Filter excludes your pairs, no data will be returned. Also verify the Trading Pairs IDs are valid Coinbase product IDs.

**Why are my candles limited to 300 per request?**

Coinbase's API caps each candle request at 300 candles. The Actor paginates automatically, but if you set a very wide date range with a small granularity, it may take longer. Reduce the range or increase the interval.

**Why is the order book depth less than I set?**

Coinbase may return fewer levels than requested if the book is thin. Set Order book depth to 0 to keep all levels returned by Coinbase, or choose L3 for the full book.

**Why does the run take a long time?**

Scraping many pairs with L3 order books and full candle history is heavy. Disable data modules you don't need, reduce the number of pairs, or lower the order book depth.

**Why do I get an error about invalid product ID?**

Make sure the product ID is in the exact format BASE-QUOTE, like BTC-USD. The input field has a dropdown with all valid IDs, so use that to avoid typos.

### FAQ

| Question | Answer |
|---|---|
| Do I need a Coinbase API key? | No. This Actor reads Coinbase's public market data endpoints, so no authentication or API key is required. |
| Which trading pairs can I scrape? | You can scrape any Coinbase Exchange product ID, like BTC-USD or ETH-EUR. Leave the Trading Pairs field empty to scrape all available pairs, optionally filtered by quote currency or status. |
| What is the difference between L1, L2, and L3 order book? | L1 returns only the best bid and ask. L2 returns the top 50 aggregated price levels. L3 returns the full non-aggregated order book with individual orders. |
| How many candles can I get per run? | You can set Maximum candles up to 1,000,000. Coinbase caps each request at 300 candles, so the Actor paginates automatically to reach your limit. |
| Can I set a date range for candles? | Yes. Use Candle range start and Candle range end in ISO 8601 format, like 2026-05-01T00:00:00Z. Leave them blank for the most recent ~300 candles. |
| How many recent trades can I get per pair? | Up to 100 per pair, which is Coinbase's API page limit. Set Recent trades count to any value from 1 to 100. |
| Can I scrape all pairs at once? | Yes. Leave Trading Pairs empty and the Actor will scrape all available pairs, subject to your plan's data limits. Use Quote Currency Filter to narrow the list. |
| What does the live ticker include? | The ticker includes last trade price, bid, ask, best-of-book size, and 24h stats: open, high, low, volume, and 30-day volume. |
| Can I disable data modules I don't need? | Yes. Toggle Include live ticker, Include order book, Include OHLCV candles, and Include recent trades independently to speed up runs and reduce data usage. |
| What export formats are supported? | You can export the dataset as CSV, JSON, Excel, or XML from the Apify platform. |

### Related actors

Browse the full [ParseForge collection](https://apify.com/parseforge?fpr=vmoqkp) for more scrapers.

🆘 **Need help?** Email parseforge@protonmail.com with your run ID, your input, and what you expected.

⚠️ **Disclaimer.** This Actor is unofficial and is not affiliated with, endorsed by, or sponsored by Coinbase, Inc. It collects only publicly available data. You are responsible for using the collected data in compliance with the source's terms of service and applicable data-protection laws, including GDPR, CCPA, and PIPL. Do not use it to collect personal data unlawfully.

# Actor input Schema

## `productIds` (type: `array`):

Coinbase Exchange product IDs (e.g., BTC-USD, ETH-EUR). Leave empty to scrape all available pairs (free user cap still applies).

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

How many candles to collect per run.

## `quoteCurrencyFilter` (type: `string`):

Only include pairs quoted in this currency. Ignored when Trading Pairs is set.

## `statusFilter` (type: `string`):

Filter by product status.

## `sortBy` (type: `string`):

Order the dataset before applying Max Items. Volume sort fetches stats for ranking.

## `includeTicker` (type: `boolean`):

Last trade price, bid, ask, and best-of-book size + 24h stats (open, high, low, volume, 30-day volume).

## `includeOrderBook` (type: `boolean`):

Level 2 or 3 market depth snapshot at the moment of scraping.

## `orderBookLevel` (type: `string`):

L1 = best bid/ask, L2 = top 50 aggregated, L3 = full non-aggregated order book.

## `orderBookMaxLevels` (type: `integer`):

Maximum number of bid/ask rows kept per side. Trim from the inside out. 0 = keep all returned by Coinbase.

## `includeCandles` (type: `boolean`):

Historical price chart data (open, high, low, close, volume).

## `candleGranularity` (type: `string`):

Granularity of each candle (1-minute through 1-day).

## `candleStart` (type: `string`):

Optional ISO 8601 start time (e.g., 2026-05-01T00:00:00Z). Leave blank for most recent ~300 candles.

## `candleEnd` (type: `string`):

Optional ISO 8601 end time. Coinbase caps the range at 300 candles per request.

## `includeTrades` (type: `boolean`):

Most recent executed trades on the pair (price, size, side, timestamp).

## `tradesLimit` (type: `integer`):

Number of most recent trades to capture per pair (max 100 per Coinbase API page).

## Actor input object example

```json
{
  "productIds": [
    "BTC-USD",
    "ETH-USD",
    "SOL-USD",
    "XRP-USD",
    "DOGE-USD"
  ],
  "maxItems": 10,
  "quoteCurrencyFilter": "",
  "statusFilter": "online",
  "sortBy": "volume24h",
  "includeTicker": true,
  "includeOrderBook": true,
  "orderBookLevel": "2",
  "orderBookMaxLevels": 25,
  "includeCandles": true,
  "candleGranularity": "3600",
  "includeTrades": true,
  "tradesLimit": 50
}
```

# Actor output Schema

## `overview` (type: `string`):

Ticker + 24h stats columns only.

## `fullData` (type: `string`):

Complete dataset with ticker, order book, candles, and trades.

# 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 = {
    "productIds": [
        "BTC-USD",
        "ETH-USD",
        "SOL-USD",
        "XRP-USD",
        "DOGE-USD"
    ],
    "maxItems": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("parseforge/coinbase-orderbook-candles-scraper").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 = {
    "productIds": [
        "BTC-USD",
        "ETH-USD",
        "SOL-USD",
        "XRP-USD",
        "DOGE-USD",
    ],
    "maxItems": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("parseforge/coinbase-orderbook-candles-scraper").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 '{
  "productIds": [
    "BTC-USD",
    "ETH-USD",
    "SOL-USD",
    "XRP-USD",
    "DOGE-USD"
  ],
  "maxItems": 10
}' |
apify call parseforge/coinbase-orderbook-candles-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,parseforge/coinbase-orderbook-candles-scraper"
        }
    }
}

```

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/WZxNBxLHqrkBdMuxk/builds/nXBm1UFbKj6uPzFp7/openapi.json
