# Kraken Market Scraper: Ticker, OHLC & Spread Data (`arman-bd/kraken-market-scraper`) Actor

Scrape Kraken public endpoints: ticker snapshots, OHLC candles, recent trades, spreads and asset pair specifications. No API key, no proxy, no browser.

- **URL**: https://apify.com/arman-bd/kraken-market-scraper.md
- **Developed by:** [Arman Hossain](https://apify.com/arman-bd) (community)
- **Categories:** Business, Developer tools
- **Stats:** 3 total users, 2 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.37 / 1,000 series scrapeds

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

## Kraken Market Scraper: Ticker, OHLC & Spread Data

![Kraken Market Scraper: Live bid/ask, OHLC candles, recent trades and spread history for any Kraken pair, no key required](https://api.apify.com/v2/key-value-stores/ZQOcNAOHrIgTacAmy/records/kraken-market-scraper.jpg)

Pulls live market data for any Kraken pair. You get the best bid and ask, the last trade, 24-hour volume and VWAP, high, low and open, OHLC candles at nine intervals, recent trades, spread history, and the pair's full trading specification.

Kraken publishes all of this on unauthenticated endpoints under `api.kraken.com/0/public`, so there's no credentials, no signing, no proxy and no browser. A ticker snapshot for one pair takes about 120 ms, and the whole 1,430-pair specification index downloads in a single request.

**Agent skill: [SKILL.md](https://api.apify.com/v2/key-value-stores/t7YoTxpZEJOWvw4Ug/records/kraken-market-scraper.md)**

```
https://api.apify.com/v2/key-value-stores/t7YoTxpZEJOWvw4Ug/records/kraken-market-scraper.md
```

### What you get

| Field | What it holds |
|---|---|
| `pair`, `krakenPair`, `wsname` | The altname you'd type (`XBTUSD`), Kraken's canonical key (`XXBTZUSD`) and the WebSocket name (`XBT/USD`) |
| `baseAsset`, `quoteAsset` | Readable base and quote symbols, plus `baseAssetId` and `quoteAssetId` for Kraken's internal codes |
| `status` | `online` or `post_only`, meaning whether the pair is currently taking orders |
| `lotDecimals`, `pairDecimals`, `costDecimals`, `orderMin`, `costMin`, `tickSize` | The full trading specification |
| `ask`, `bid`, `lastPrice`, `lastVolume` | Top of book and the most recent fill |
| `spread`, `spreadPct` | Current ask minus bid, in quote currency and as a percentage of the ask |
| `volume24h`, `volumeToday` | Rolling 24-hour volume and volume since midnight UTC |
| `volumeWeightedAvg`, `volumeWeightedAvgToday` | VWAP over the same two windows |
| `tradeCount`, `tradeCountToday` | Number of trades over the same two windows |
| `high24h`, `low24h`, `highToday`, `lowToday`, `openPrice` | Range and today's opening price |
| `ohlcCandles`, `ohlcInterval` | Candle array with time, open, high, low, close, vwap, volume and tradeCount, plus the interval used |
| `recentTrades` | Time, price, volume, side (`buy` or `sell`) and order type (`market` or `limit`) |
| `spreadHistory` | Tick-level bid and ask history with the spread precomputed |
| `scrapedAt` | When the run happened |

`RUN_SUMMARY` in the key-value store holds per-run counts, the filters you used, and any pair that failed.

### Use cases

- **Cross-exchange arbitrage.** Poll ticker on a schedule and diff Kraken's bid and ask against another venue.
- **OHLC history without a vendor.** Pull daily or hourly candles for a basket of pairs and load them straight into a backtest.
- **Execution-cost modelling.** `spreadHistory` plus `tickSize` and `costMin` tells you what a fill actually costs.
- **Treasury marks.** Take a nightly `lastPrice` snapshot for the pairs your balance sheet holds.
- **Liquidity screening.** Sort a wide pair list by `volume24h` and `tradeCount` to find where the depth is.

### Quick start

Live prices for two pairs:

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

Daily candles plus the ticker, for a basket:

```json
{
 "pairs": ["XBTUSD", "ETH/EUR", "SOLUSD"],
 "dataTypes": ["ticker", "ohlc"],
 "interval": 1440,
 "maxRows": 365
}
```

Microstructure detail for one pair:

```json
{
 "pairs": ["XBTUSD"],
 "dataTypes": ["ticker", "trades", "spread"],
 "maxRows": 500
}
```

### Input

| Field | Type | Default | Notes |
|---|---|---|---|
| `pairs` | array | required | Any Kraken spelling: `XBTUSD`, `XBT/USD` or `XXBTZUSD`. Duplicates that resolve to the same pair are fetched once. |
| `dataTypes` | array | `["ticker"]` | Any of `ticker`, `ohlc`, `trades`, `spread`. Each selection costs one extra request per pair. |
| `interval` | integer | `60` | Candle width in minutes. Kraken supports exactly 1, 5, 15, 30, 60, 240, 1440, 10080 and 21600. |
| `since` | string | `""` | Unix timestamp in seconds. Returns only rows after it, for incremental polling. |
| `maxRows` | integer | `200` | Caps `ohlcCandles`, `recentTrades` and `spreadHistory` length, keeping the newest rows. |

Pair specification fields are always included, whatever `dataTypes` you pick. They come from a single `AssetPairs` call made once per run, not once per pair.

### Output example

```json
{
 "pair": "XBTUSD",
 "krakenPair": "XXBTZUSD",
 "wsname": "XBT/USD",
 "baseAsset": "XBT",
 "quoteAsset": "USD",
 "baseAssetId": "XXBT",
 "quoteAssetId": "ZUSD",
 "status": "online",
 "lotDecimals": 8,
 "pairDecimals": 1,
 "costDecimals": 5,
 "orderMin": 0.00005,
 "costMin": 0.5,
 "tickSize": 0.1,
 "ask": 64562.3,
 "bid": 64562.2,
 "lastPrice": 64562.2,
 "lastVolume": 0.00403978,
 "volumeToday": 274.26421031,
 "volume24h": 1286.18325499,
 "volumeWeightedAvgToday": 64697.53769,
 "volumeWeightedAvg": 64593.30096,
 "tradeCountToday": 14063,
 "tradeCount": 49444,
 "lowToday": 64372.6,
 "low24h": 63823,
 "highToday": 64936.4,
 "high24h": 64954.6,
 "openPrice": 64599.3,
 "spread": 0.1,
 "spreadPct": 0.000155,
 "ohlcInterval": 60,
 "ohlcCandles": [
 {
 "time": "2026-08-06T11:00:00.000Z",
 "open": 64549,
 "high": 64572,
 "low": 64440.5,
 "close": 64562.2,
 "vwap": 64530.1,
 "volume": 18.15301921,
 "tradeCount": 1035
 }
 ],
 "recentTrades": null,
 "spreadHistory": null,
 "scrapedAt": "2026-08-06T11:39:55.722Z"
}
```

### Finding a pair name

Kraken has three names for every market and accepts all of them here.

| Where you see it | Example | Notes |
|---|---|---|
| Trade UI and most docs | `XBT/USD` | The WebSocket name |
| REST shorthand | `XBTUSD` | The altname, which is what most people type |
| REST response keys | `XXBTZUSD` | The canonical key, with Kraken's legacy `X` and `Z` prefixes |

Bitcoin is `XBT` on Kraken, not `BTC`, so `BTCUSD` will not resolve. The Actor downloads the full pair index at the start of every run, so an unrecognised pair is rejected locally with a clear error rather than costing a request.

### API example

```bash
curl -X POST "https://api.apify.com/v2/acts/arman-bd~kraken-market-scraper/run-sync-get-dataset-items?token=YOUR_TOKEN" \
 -H "Content-Type: application/json" \
 -d '{
 "pairs": ["XBTUSD", "ETHUSD"],
 "dataTypes": ["ticker", "ohlc"],
 "interval": 1440,
 "maxRows": 30
 }'
```

### JavaScript example

```js
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: 'YOUR_TOKEN' });
const run = await client.actor('arman-bd/kraken-market-scraper').call({
 pairs: ['XBTUSD', 'ETH/EUR'],
 dataTypes: ['ticker'],
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
for (const s of items) {
 console.log(`${s.pair}: ${s.lastPrice} ${s.quoteAsset} (spread ${s.spread}, 24h vol ${s.volume24h})`);
}
```

### Notes

- Kraken returns HTTP 200 for errors. Real problems arrive in an `error` array inside a 200 response, so the status code alone tells you nothing. The Actor checks that array explicitly and only retries the entries that are transient, meaning rate limits and lockouts.
- A bad pair poisons a batched request. Asking Kraken for `XBTUSD,NOPE` in one call returns nothing at all, not a partial result. The Actor therefore requests one pair at a time so one bad symbol never costs you the rest.
- Prices arrive as decimal strings and are converted to numbers here. Derived spreads are rounded back to 10 decimal places so binary float noise such as `0.09999999` never reaches the dataset.
- Volume windows come in pairs. Every Kraken volume, VWAP, trade-count, high and low field ships as today plus the last 24 hours, and both are exposed, with `Today` meaning since midnight UTC.
- One pair failing won't kill the run. Failures land in `RUN_SUMMARY.failures`, and the Actor only errors out if every pair fails.

### FAQ

**Do I need a Kraken account or API key?** No. You supply no credentials.

**Do I need a proxy?** No. Proxy configuration is not required to run this Actor.

**How far back does OHLC go?** Kraken returns up to 720 candles per call, so the window depends on the interval: 720 hours at `60`, roughly two years at `1440`. Use `since` to walk further back in steps.

**What is the rate limit?** Public endpoints allow roughly 1 request per second sustained. A run of 50 pairs with two data types is 101 requests and stays comfortably inside it.

**Why is `recentTrades` null?** Because `trades` was not in `dataTypes`. Unselected blocks are always present as `null` rather than missing, so the dataset schema stays stable across runs.

**Can I plug it into something else?** Yes. Apify API, the client libraries, webhooks, scheduled runs, dataset exports to JSON, CSV or Excel, or MCP. The output is structured JSON.

# Actor input Schema

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

Pair names in any Kraken spelling: XBTUSD, XBT/USD and the canonical XXBTZUSD all resolve to the same pair. Unknown pairs are rejected before a request is spent on them.

## `dataTypes` (type: `array`):

Which blocks to attach to each pair's record. Each selection is one extra request per pair. Pair specification fields (base, quote, decimals, minimums) are always included.

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

Candle width for the OHLC block. Kraken supports exactly 1, 5, 15, 30, 60, 240, 1440, 10080 and 21600 minutes, and any other value is rejected. Ignored unless 'OHLC candles' is selected.

## `since` (type: `string`):

Return only OHLC, trade or spread rows after this unix timestamp in seconds. Use the previous run's newest row time to poll incrementally. Leave empty for the most recent window.

## `maxRows` (type: `integer`):

Cap the length of the ohlcCandles, recentTrades and spreadHistory arrays, keeping the most recent rows. Kraken returns up to 720 candles and 1000 trades per call, which makes for large records.

## Actor input object example

```json
{
  "pairs": [
    "XBTUSD",
    "ETH/EUR",
    "SOLUSD"
  ],
  "dataTypes": [
    "ticker",
    "ohlc"
  ],
  "interval": 60,
  "since": "1780000000",
  "maxRows": 200
}
```

# Actor output Schema

## `items` (type: `string`):

Every record the run produced.

## `runsummary` (type: `string`):

The RUN\_SUMMARY record from the run's key-value store.

# 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 = {
    "pairs": [
        "XBTUSD",
        "ETHUSD"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("arman-bd/kraken-market-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 = { "pairs": [
        "XBTUSD",
        "ETHUSD",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("arman-bd/kraken-market-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 '{
  "pairs": [
    "XBTUSD",
    "ETHUSD"
  ]
}' |
apify call arman-bd/kraken-market-scraper --silent --output-dataset

```

## MCP server setup

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