# Kraken Market Data Scraper — Prices, OHLC & Order Book (`hipersoft/kraken-market-data-scraper`) Actor

Fetch Kraken spot market data in bulk: ticker stats (ask, bid, last, 24h high/low/volume/vwap), OHLC candles for any interval, order book depth (top bids/asks), and tradable pair metadata. Fast, clean and cheap.

- **URL**: https://apify.com/hipersoft/kraken-market-data-scraper.md
- **Developed by:** [hiper soft](https://apify.com/hipersoft) (community)
- **Categories:** Other, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.0005 / pair scraped

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

## Kraken Market Data Scraper — Prices, OHLC & Order Book

Pull **Kraken spot market data** in bulk and export it as clean JSON, CSV or Excel. Get **ticker statistics** (ask, bid, last price plus 24-hour high, low, volume and VWAP), **OHLC candles** at any interval, **order book depth** (top bids and asks), and the full **tradable pair list** — **one tidy row per pair or per candle**.

Perfect for **crypto trading bots, price dashboards, backtesting, portfolio trackers, alerting and automated watchlists**.

### What you get

- 🐙 **Every spot pair** — request specific pairs like `XBTUSD` and `ETHUSD`, or leave the list empty to snapshot all tradable pairs at once (ticker & asset pairs).
- 📈 **Four datasets in one Actor** — ticker stats, OHLC candles, order book depth, and tradable pair metadata. Pick one with a single `dataType` field.
- 🕯️ **Candles at any interval** — 1m, 5m, 15m, 1h, 4h, 1d, 1w and more, up to the 720 most recent candles per pair.
- 📖 **Order book snapshots** — top bids and asks per side, with best bid, best ask and spread computed for you.
- ⚡ **Fast & clean** — flat records with numeric fields (not strings), ready for spreadsheets, databases or code.

> **Note:** Kraken uses **XBT** for Bitcoin, so Bitcoin/US-Dollar is `XBTUSD` (not `BTCUSD`).

### Example input

Top pairs, ticker statistics:

```json
{ "pairs": ["XBTUSD", "ETHUSD", "SOLUSD"], "dataType": "ticker" }
```

Every pair's ticker in one run (leave `pairs` empty):

```json
{ "pairs": [], "dataType": "ticker" }
```

Hourly candles for two pairs:

```json
{ "pairs": ["XBTUSD", "ETHUSD"], "dataType": "ohlc", "interval": 60 }
```

Order book depth, top 50 levels per side:

```json
{ "pairs": ["XBTUSD"], "dataType": "depth", "count": 50 }
```

### Output

#### Ticker (`ticker`) — one row per pair

```json
{
  "pair": "XXBTZUSD",
  "dataType": "ticker",
  "ask": 77179.7,
  "bid": 77179.6,
  "last": 77183.6,
  "open24h": 77398.1,
  "high24h": 77736.2,
  "low24h": 76236.9,
  "vwap24h": 77105.55859,
  "volume24h": 2264.55629102,
  "trades24h": 106260
}
```

#### OHLC (`ohlc`) — one row per candle

```json
{
  "pair": "XXBTZUSD",
  "dataType": "ohlc",
  "interval": 60,
  "time": 1785783600,
  "open": 63807.2,
  "high": 64008.2,
  "low": 63784.8,
  "close": 63813.4,
  "vwap": 63901.6,
  "volume": 106.80970701,
  "count": 2594
}
```

#### Order book depth (`depth`) — one row per pair

```json
{
  "pair": "XXBTZUSD",
  "dataType": "depth",
  "bestBid": 77182.3,
  "bestAsk": 77182.4,
  "spread": 0.1,
  "bids": [{ "price": 77182.3, "volume": 0.767, "timestamp": 1788378142 }],
  "asks": [{ "price": 77182.4, "volume": 0.831, "timestamp": 1788378142 }]
}
```

#### Asset pairs (`assetpairs`) — one row per pair

```json
{
  "pair": "XXBTZUSD",
  "dataType": "assetpairs",
  "altname": "XBTUSD",
  "wsname": "XBT/USD",
  "base": "XXBT",
  "quote": "ZUSD",
  "status": "online",
  "pairDecimals": 1,
  "orderMin": 0.00005,
  "tickSize": 0.1
}
```

### Input fields

| Field | Description |
|-------|-------------|
| `pairs` | Trading pairs in Kraken format (e.g. `XBTUSD`, `ETHUSD`). Empty = all pairs (ticker & asset pairs only; OHLC and depth need at least one pair). |
| `dataType` | `ticker` (ask/bid/last + 24h stats), `ohlc` (candles), `depth` (order book), or `assetpairs` (tradable pair list). Default `ticker`. |
| `interval` | Candle interval in minutes for `ohlc`: `1`, `5`, `15`, `30`, `60`, `240`, `1440`, `10080`, `21600`. Default `60`. |
| `count` | Order-book depth per side for `depth` (1-500). Ignored for the other data types. |

### FAQ

**Which pairs can I request?**
Any Kraken spot trading pair, written as base + quote with no separator — `XBTUSD`, `ETHUSD`, `SOLEUR`, `ADAUSD`, and so on. Remember Kraken uses `XBT` for Bitcoin. For a full snapshot of every pair, leave `pairs` empty (ticker or asset pairs). Not sure of a pair's exact code? Run `assetpairs` first to list every tradable pair.

**What interval options are there for candles?**
`1`, `5`, `15`, `30`, `60`, `240` minutes, plus `1440` (daily), `10080` (weekly) and `21600`. You get up to the 720 most recent candles per pair.

**How is order book depth returned?**
One row per pair containing the top bids and asks (each a `price`, `volume` and `timestamp`), plus the best bid, best ask and the computed spread. Use `count` to choose how many levels per side.

**What's the output format?**
Structured JSON — one clean record per pair or per candle, with numeric fields. Export as JSON, CSV, Excel or via the API.

**Can I use this in n8n?**
Yes. Apify has an official [n8n community node](https://apify.com/integrations/n8n) — run this Actor from an n8n workflow and pipe the returned market data straight into your automation, database or spreadsheet. It also works with [Make](https://apify.com/integrations/make), [Zapier](https://apify.com/integrations/zapier) and [many more](https://apify.com/integrations).

**Can I integrate this with other tools?**
The Kraken Market Data Scraper connects with almost any cloud service or web app via [integrations on the Apify platform](https://apify.com/integrations): [Make](https://apify.com/integrations/make), [Zapier](https://apify.com/integrations/zapier), [Slack](https://docs.apify.com/platform/integrations/slack), [Google Drive](https://docs.apify.com/platform/integrations/drive) and more, plus the [Apify API](https://docs.apify.com/api/v2), JavaScript/Python clients, webhooks and MCP.

### Notes

Market data is © Kraken and the respective venues, and is provided for informational purposes — respect their terms and any redistribution restrictions. Original clean-room implementation.

# Actor input Schema

## `pairs` (type: `array`):

Trading pairs to fetch, in Kraken format (base + quote, no separator), e.g. "XBTUSD", "ETHUSD", "SOLEUR". Leave empty to fetch every tradable pair (supported for the "ticker" and "assetpairs" data types; "ohlc" and "depth" require at least one pair). Note Kraken uses XBT for Bitcoin (XBTUSD, not BTCUSD).

## `dataType` (type: `string`):

Which market dataset to return. "ticker" = latest ticker + rolling 24-hour stats (one row per pair). "ohlc" = OHLC candles (one row per candle). "depth" = order book snapshot with the top bids and asks (one row per pair). "assetpairs" = metadata for every tradable pair (one row per pair).

## `interval` (type: `integer`):

Candle interval in minutes, used only when Data type is "ohlc". One of: 1, 5, 15, 30, 60, 240, 1440 (daily), 10080 (weekly), 21600. Returns up to the 720 most recent candles per pair.

## `count` (type: `integer`):

How many order book levels to return per side (bids and asks). Used only when Data type is "depth" (1-500). Ignored for the other data types.

## Actor input object example

```json
{
  "pairs": [
    "XBTUSD",
    "ETHUSD"
  ],
  "dataType": "ticker",
  "interval": 60,
  "count": 100
}
```

# Actor output Schema

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

The results as dataset items.

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("hipersoft/kraken-market-data-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 = {}

# Run the Actor and wait for it to finish
run = client.actor("hipersoft/kraken-market-data-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 '{}' |
apify call hipersoft/kraken-market-data-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,hipersoft/kraken-market-data-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/GvRZ11wwQbLkMLLoJ/builds/WdisoSO8VZR1o8lsz/openapi.json
