# Coinbase Exchange Market Data Scraper (`zerobreak/coinbase-exchange-market-data-scraper-202610120341`) Actor

Coinbase Exchange Market Data Scraper is a Python tool designed to extract real-time spot prices, historical candlestick OHLCV data, order book depth, and trade history from Coinbase Exchange. It exports structured cryptocurrency market datasets into clean CSV or JSON formats.

- **URL**: https://apify.com/zerobreak/coinbase-exchange-market-data-scraper-202610120341.md
- **Developed by:** [ZeroBreak](https://apify.com/zerobreak) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.99 / 1,000 results

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?

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

### Coinbase Exchange Market Data Scraper — Crypto Candles and Tickers

### Overview

Coinbase Exchange Market Data Scraper collects public cryptocurrency market data, including live tickers, 24-hour statistics, historical candle data, and the product catalog.

Choose a collection mode, specify the trading products you want, and save the results to an Apify dataset for export as JSON, CSV, or Excel.

### Features

- Retrieve the latest ticker data for selected trading pairs.
- Collect 24-hour price and trading-volume statistics.
- Extract OHLCV candle data at supported time intervals.
- Retrieve the product catalog, including trading status and currency information.
- Filter results by product ID.
- Configure candle granularity and optional date boundaries.
- Remove duplicate records within a collection run.
- Export structured market data for analysis and reporting.

### Use Cases

- **Ticker monitoring:** Capture the latest BTC-USD bid, ask, price, and trade information.
- **Market analysis:** Compare 24-hour opening, high, low, and last prices alongside trading volume.
- **Candlestick analysis:** Collect OHLCV data for BTC-USD, ETH-USD, and other supported trading pairs.
- **Product catalog research:** Review available trading products and their status.
- **Scheduled snapshots:** Collect recurring market snapshots and compare price or volume changes.
- **Spreadsheet reporting:** Export market data to CSV or Excel for financial analysis.

### Input Parameters

| Parameter | Type | Default | Description |
|---|---|---|---|
| `productIds` | Array | `["BTC-USD"]` | Trading product IDs to collect, such as `BTC-USD` or `ETH-USD`. In `products` mode, an empty list retrieves the catalog. |
| `mode` | String | `ticker` | Collection mode: `ticker`, `stats`, `candles`, or `products`. |
| `granularity` | Integer | `3600` | Candle interval in seconds: `60`, `300`, `900`, `3600`, `21600`, or `86400`. |
| `start` | String | Empty | Optional start time for candle data in ISO 8601 format. |
| `end` | String | Empty | Optional end time for candle data in ISO 8601 format. |
| `maxItems` | Integer | `100` | Maximum number of successful records to save. Minimum: 1. Maximum: 1,000. |

### Example Input

Retrieve the latest BTC-USD ticker.

```json id="cbx101"
{
  "productIds": ["BTC-USD"],
  "mode": "ticker",
  "granularity": 3600,
  "start": "",
  "end": "",
  "maxItems": 100
}
```

#### Other collection modes

Change `mode` to `stats` to collect 24-hour statistics, `candles` to retrieve OHLCV data, or `products` to retrieve the product catalog.

For candle collection, specify `granularity` and optionally provide `start` and `end` timestamps.

### What Data Does This Actor Extract?

The output fields depend on the selected collection mode. Each record includes a `mode` field identifying the type of data collected.

#### Example Output

The following example illustrates a ticker record.

```json id="cbx102"
{
  "product_id": "BTC-USD",
  "ask": "83282.09",
  "bid": "83282.08",
  "volume": "2038.27809313",
  "trade_id": 1104799154,
  "price": "83282.08",
  "size": "0.00000019",
  "time": "2026-10-11T21:23:18.316516003Z",
  "mode": "ticker",
  "scraped_at": "2026-10-11T21:23:20.000000Z"
}
```

#### Extracted Data Fields

| Field | Type | Description |
|---|---|---|
| `product_id` | String | Trading product identifier, such as `BTC-USD`. |
| `ask` | String | Best available ask price in a ticker record. |
| `bid` | String | Best available bid price in a ticker record. |
| `volume` | String | Trading volume, depending on the collection mode. |
| `trade_id` | Integer | Trade identifier in a ticker record. |
| `price` | String | Latest trade price in a ticker record. |
| `size` | String | Size of the latest trade. |
| `time` | String | Trade timestamp or candle interval start time. |
| `rfq_volume` | String | Request-for-quote volume when provided. |
| `open` | String | Opening price in a statistics or candle record. |
| `high` | String | Highest price in a statistics or candle record. |
| `low` | String | Lowest price in a statistics or candle record. |
| `last` | String | Latest price in a 24-hour statistics record. |
| `close` | String | Closing price in a candle record. |
| `volume_30day` | String | 30-day trading volume when provided. |
| `rfq_volume_24hour` | String | 24-hour request-for-quote volume when provided. |
| `rfq_volume_30day` | String | 30-day request-for-quote volume when provided. |
| `id` | String | Product identifier in a catalog record. |
| `display_name` | String | Human-readable product name. |
| `status` | String | Product trading status in a catalog record. |
| `mode` | String | Collection mode: `ticker`, `stats`, `candles`, or `products`. |
| `scraped_at` | String | UTC timestamp indicating when the record was saved. |

#### Data by Mode

- **Ticker:** Latest trade price, bid, ask, trade ID, trade size, timestamp, and available volume information.
- **Stats:** 24-hour opening, high, low, and last prices, along with available volume statistics.
- **Candles:** Time, low, high, open, close, and volume for each returned candle.
- **Products:** Product identifiers, display names, currency information, trading status, and other available catalog fields.

### Working with Your Dataset

After the actor finishes, open the Apify dataset to inspect the collected records or export them in your preferred format.

- **JSON:** Use structured records in Python applications and data pipelines.
- **CSV:** Import market data into spreadsheets, databases, and analytics tools.
- **Excel:** Review price movements, compare trading pairs, and prepare market reports.

For historical analysis, retain the candle timestamps and granularity so that observations from different products can be compared consistently.

### Important Notes

- Ticker and statistics records represent snapshots of the available market data at collection time.
- Supported candle intervals are 60, 300, 900, 3,600, 21,600, and 86,400 seconds.
- Candle results depend on the selected product, interval, optional time boundaries, and available source data.
- The actor does not necessarily retrieve every historical candle for a long date range in a single request.
- The `maxItems` setting defaults to 100 and cannot exceed 1,000 successful records per run.
- Some fields are specific to particular collection modes and may not appear in every record.
- Cryptocurrency prices and trading volumes can change rapidly. Collected snapshots are not guaranteed to represent current market conditions after the run finishes.

### FAQ

**What is the difference between ticker and stats mode?**

Ticker mode retrieves the latest trade and associated bid and ask information. Stats mode provides a broader summary of recent trading activity, including 24-hour price and volume statistics.

**Can I collect historical cryptocurrency prices?**

Yes. Select `candles` mode and configure the desired candle granularity. You can also specify optional start and end timestamps.

**Which candle intervals are supported?**

The supported intervals are 1 minute, 5 minutes, 15 minutes, 1 hour, 6 hours, and 1 day.

**Can I retrieve the available trading products?**

Yes. Select `products` mode to collect the product catalog.

**Can I export the results to CSV or Excel?**

Yes. The Apify dataset supports JSON, CSV, and Excel exports.

### Disclaimer

This actor is an independent tool and is not affiliated with or endorsed by Coinbase. Market data is provided for informational and analytical purposes. Cryptocurrency markets are volatile, and collected information should not be treated as financial advice or a guarantee of future prices.

### Is Web Scraping Legal?

Collecting information that is already public is generally legal. Scraping is not the same thing as hacking, and there is no single law that bans it. The limits are the usual ones: do not break into accounts, do not take private or confidential data, and be careful with personal data and copyrighted works. A site's terms can also restrict how you access it. Facts such as a public name, price, or rating are not the same thing as republishing someone's article or photo.

This actor collects information from public pages. It does not log in and it does not bypass access controls.

For a longer explanation, see Apify's article [Is web scraping legal?](https://blog.apify.com/is-web-scraping-legal/).

# Actor input Schema

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

Coinbase Exchange product ids, one per line, such as BTC-USD. Ticker, 24h stats, and candles request each id. Products mode keeps only these ids when the list is filled in, and returns the public catalog when the list is empty.

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

What to collect. ticker is the latest trade. stats is the 24 hour summary. candles is OHLC rows for one granularity. products is the public product catalog.

## `granularity` (type: `integer`):

Candle size in seconds. Allowed values are 60, 300, 900, 3600, 21600, and 86400. Used only in candles mode.

## `start` (type: `string`):

Optional ISO-8601 start time for candles, such as 2026-10-11T00:00:00Z. Leave empty to omit the parameter. One request is sent per product.

## `end` (type: `string`):

Optional ISO-8601 end time for candles, such as 2026-10-11T21:00:00Z. Leave empty to omit the parameter. One request is sent per product.

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

Maximum successful dataset rows for the run. Error rows do not count toward this cap. Minimum 1, free cap 1000.

## `requestDelaySecs` (type: `number`):

Seconds to wait between requests. Minimum 0.15, which stays under the public limit of about 10 requests per second per IP.

## `timeoutSecs` (type: `integer`):

Stop the run after this many seconds, even if more products are still queued.

## `requestTimeoutSecs` (type: `integer`):

How long to wait for a single response before retrying or recording that request as an error.

## `proxyConfiguration` (type: `object`):

Optional proxy for requests. Default is no proxy. Turn on Apify Proxy only if your network is blocked.

## Actor input object example

```json
{
  "productIds": [
    "BTC-USD",
    "ETH-USD"
  ],
  "mode": "ticker",
  "granularity": 3600,
  "start": "2026-10-11T00:00:00Z",
  "end": "2026-10-11T21:00:00Z",
  "maxItems": 100,
  "requestDelaySecs": 0.15,
  "timeoutSecs": 300,
  "requestTimeoutSecs": 30,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

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

Product, price, bid, ask, volume, time, trade id, and mode.

## `errors` (type: `string`):

Failed lookups with the input, HTTP status, and message.

## `dataset` (type: `string`):

Every row from the run, without a table view applied.

# 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"
    ],
    "mode": "ticker",
    "granularity": 3600,
    "start": "",
    "end": "",
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("zerobreak/coinbase-exchange-market-data-scraper-202610120341").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"],
    "mode": "ticker",
    "granularity": 3600,
    "start": "",
    "end": "",
    "proxyConfiguration": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("zerobreak/coinbase-exchange-market-data-scraper-202610120341").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"
  ],
  "mode": "ticker",
  "granularity": 3600,
  "start": "",
  "end": "",
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call zerobreak/coinbase-exchange-market-data-scraper-202610120341 --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,zerobreak/coinbase-exchange-market-data-scraper-202610120341"
        }
    }
}
```

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/gXovWwzYUZpsvoh3A/builds/yU2R7zzeqw9H1lgmM/openapi.json
