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

Scrape real-time order book depth (L1/L2/L3), OHLCV candles, recent trades, and live tickers for every Coinbase Exchange trading pair. No API key. Built for arbitrage and trading bots.

- **URL**: https://apify.com/parseforge/coinbase-orderbook-candles-scraper.md
- **Developed by:** [ParseForge](https://apify.com/parseforge) (community)
- **Categories:** Business, Developer tools, Automation
- **Stats:** 3 total users, 2 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/platform/actors/running/actors-in-store#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 Banner](https://raw.githubusercontent.com/ParseForge/apify-assets/main/banner.jpg)

## 📈 Coinbase Order Book, Candles & Trades Scraper

> 🚀 **Pull live Coinbase market depth, OHLCV charts, and tick-level trades in seconds.** Filter by pair, sort by volume, choose your order book level. No API key, no registration, no manual CSV wrangling.

<table><tr>
<td style="border-left:4px solid #0F766E;padding:12px 16px;font-weight:600">Pull structured records from Coinbase Order Book Candles and Trades — clean fields ready as CSV, JSON, JSONL, Excel, or XML for downstream pipelines.</td>
</tr></table>

##### Copy to your AI assistant

Copy this block into ChatGPT, Claude, Cursor, or any LLM to start using this actor.

```
parseforge/coinbase-orderbook-candles-scraper on Apify. Call: ApifyClient("TOKEN").actor("parseforge/coinbase-orderbook-candles-scraper").call(run_input={...}), then client.dataset(run["defaultDatasetId"]).list_items().items for results. Key inputs: productIds (array, default ["BTC-USD", "ETH-USD", "SOL-USD", "XRP-USD", "DOGE-USD"]), maxItems (integer, default 10), quoteCurrencyFilter (string, default ""), statusFilter (string, default "online"), sortBy (string, default "volume24h"), includeTicker (boolean, default true). Full actor spec: fetch build via GET https://api.apify.com/v2/acts/parseforge~coinbase-orderbook-candles-scraper (Bearer TOKEN). Get token: https://console.apify.com/account/integrations
```

Coinbase Exchange is the largest US-regulated crypto venue, and the raw market data behind every pair is the substrate of arbitrage bots, portfolio dashboards, and quantitative research. This scraper exposes that substrate as one unified Apify dataset. Every record holds the live ticker, **bid and ask depth up to 1,000 levels**, OHLCV candles across **six timeframes**, and the **most recent 100 trades**. You point it at any of the **818 trading pairs** the exchange currently lists, and the actor returns a fully populated record in a few seconds. No keys, no rate limits to manage, no scraping etiquette to relearn.

The integration story is simple. Schedule a run every minute and you have a low-latency price feed for your trading bot. Schedule it hourly and you have an OHLCV warehouse you can backfill into BigQuery or Postgres. Run it on demand to power an arbitrage detector that compares Coinbase against Binance, Kraken, or any other venue you already scrape with ParseForge. The output is flat enough for spreadsheets and structured enough for time-series databases. Pair it with a notebook and you have a research lab. Pair it with Zapier and you have a price alert system. Pair it with your own LLM agent and you have a self-driving market scout.

| 🎯 Target audience | 💡 Primary use cases |
|---|---|
| Quantitative traders and arbitrage operators | Detect cross-exchange price gaps in real time |
| Crypto trading bot developers | Stream order book depth into execution engines |
| DeFi and CeFi portfolio trackers | Refresh asset valuations across 800+ pairs |
| Market data engineers and analysts | Backfill OHLCV warehouses and tick-level archives |
| Compliance and treasury teams | Audit fills and price marks against exchange truth |

### 📋 What the Coinbase Order Book, Candles & Trades Scraper does

- 📡 **Live ticker capture.** Best bid, best ask, last trade, 24h open, high, low, volume, and 30-day volume in a single call.
- 🪜 **Order book depth at three levels.** L1 best bid/ask, L2 top-of-book aggregated, or L3 full non-aggregated book.
- 🕯️ **OHLCV candles across six intervals.** 1-minute, 5-minute, 15-minute, 1-hour, 6-hour, or daily buckets.
- 🔁 **Recent trades with side and size.** Up to 100 most recent executions per pair with sub-millisecond timestamps.
- 🎛️ **Smart filters and sort.** Restrict by quote currency, status, or explicit pair list. Sort by 24h volume to grab the top movers.
- 🧾 **One flat record per pair.** Ticker, book, candles, and trades land on the same row, ready for SQL or pandas.

Every record contains the pair identity (base, quote, display name, status), the live ticker block, derived spread and percentage change, the order book sequence and timestamp, the candle array, the recent trades array, and a precise scrape timestamp. The schema is stable across runs, so you can append snapshots safely.

> 💡 **Why it matters:** Coinbase processes billions of dollars in daily volume, and small spread shifts between Coinbase and other venues create arbitrage windows that close in seconds. Owning your own price feed instead of renting one from a paid market data vendor means lower cost, no per-call quotas, and audit-friendly raw data you control.

### 📊 Data fields

Each record includes: `ask`, `baseCurrency`, `bid`, `candleGranularitySeconds`, `displayName`, `high24h`, `lastTradeId`, `lastTradeTime`, `low24h`, `open24h`, `orderBookLevel`, `priceChange24h`, `priceChangePercent24h`, `priceLast`, `productId`, `quoteCurrency`, `scrapedAt`, `spread`, `spreadPercent`, `status`, `url`, `volume24h`, `volume30day`. These field names come straight from the actor's dataset schema, so what you see here is what lands in your dataset.

> ⚠️ **Good to Know:** Coinbase rate-limits public endpoints. The actor handles 429 and 503 responses with exponential backoff, so feel free to fan out across hundreds of pairs. Candle queries return at most 300 buckets per pair per call, which is a Coinbase API constraint, not an actor limitation.

### 🚀 How to use

1. 📝 **Sign up for Apify.** Create a free account at [console.apify.com/sign-up?fpr=vmoqkp](https://console.apify.com/sign-up?fpr=vmoqkp).
2. 🎯 **Pick your pairs.** Add specific product IDs (BTC-USD, ETH-USD, ...) or leave the field empty and let the filters do the work.
3. 🎛️ **Choose your modules.** Toggle ticker, order book, candles, and trades. Pick the book level and candle interval that match your use case.
4. ▶️ **Run.** Click Start and watch the dataset fill.
5. 📤 **Export.** Pull JSON, CSV, or XLSX, or wire the dataset into Make, Zapier, BigQuery, Postgres, or your own webhook.

> ⏱️ **Total time:** Under two minutes from sign-up to first dataset row.

### 🔗 Recommended Actors

- [**🦎 CoinGecko Scraper**](https://apify.com/parseforge/coingecko-scraper) - aggregated crypto prices, market caps, and rankings across exchanges.
- [**🪙 Coinlore Crypto Scraper**](https://apify.com/parseforge/coinlore-crypto-scraper) - alternative cross-exchange price aggregator with broad coin coverage.
- [**📈 Coinbase Exchange Products Scraper**](https://apify.com/parseforge/coinbase-exchange-products-scraper) - lighter sibling: product catalog plus ticker plus 24h stats only.
- [**💹 Yahoo Finance Scraper**](https://apify.com/parseforge/yahoo-finance-scraper) - traditional market data covering equities, ETFs, FX, and crypto tickers.
- [**📊 Alpha Vantage Scraper**](https://apify.com/parseforge/alpha-vantage-scraper) - unified market data pull covering quotes, fundamentals, FX, and crypto.

> 💡 **Pro Tip:** browse the complete [ParseForge collection](https://apify.com/parseforge) for more market data and research actors.

> ⚠️ **Disclaimer:** This actor extracts publicly available market data from Coinbase Exchange for informational purposes only. None of the data returned constitutes financial advice. You are responsible for ensuring your use complies with Coinbase's terms of service, applicable securities regulations, and any tax obligations in your jurisdiction.

### 🆘 Need Help?

If you hit a bug, have questions about setup, or need a scraper we haven't built yet, open our [contact form](https://tally.so/r/BzdKgA) or write to parseforge@protonmail.com. We also take on paid custom data projects.

For faster answers, join our [Discord](https://parseforge.co/discord). It's the best place to get support and suggest new actors.

# 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("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).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": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=parseforge/coinbase-orderbook-candles-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

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