# Kucoin Market Data Scraper (`real-estate-api/kucoin-market-data-scraper-202610120341`) Actor

KuCoin Market Data Scraper is a Python tool designed to extract real-time ticker prices, 24-hour trade volumes, order book depth, candlestick OHLCV data, and recent trade histories from KuCoin. It exports structured cryptocurrency market datasets into clean CSV or JSON formats.

- **URL**: https://apify.com/real-estate-api/kucoin-market-data-scraper-202610120341.md
- **Developed by:** [real-estate-api](https://apify.com/real-estate-api) (community)
- **Security:** Limited permissions
- **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

### KuCoin Market Data Scraper — Crypto Tickers, 24h Stats, and Klines

### Overview

KuCoin Market Data Scraper collects publicly available cryptocurrency market data and organizes it into structured dataset records. Choose between individual spot tickers, the full ticker collection, 24-hour market statistics, or candlestick data (klines).

The actor supports configurable trading pairs, candle intervals, and collection limits. Results can be exported as JSON, CSV, or Excel through the Apify dataset for market monitoring, historical analysis, and charting workflows.

### Features

- **Spot ticker data:** Collect the latest price, best bid and ask, and associated order sizes.
- **All-tickers collection:** Gather available ticker information across trading pairs.
- **24-hour market statistics:** Collect available prices, trading volumes, and price-change information.
- **Candlestick data:** Collect market candles using a supported interval.
- **Multiple trading pairs:** Specify symbols such as `BTC-USDT`.
- **Duplicate prevention:** Skip duplicate pairs and duplicate candle records.
- **Structured output:** Store market data in flat dataset rows.
- **Flexible exports:** Download results as JSON, CSV, or Excel.
- **Scheduled monitoring:** Run the actor periodically to maintain updated market snapshots.

### Use Cases

- **Price monitoring:** Track BTC-USDT and other spot pairs, including the latest available bid and ask.
- **Market screening:** Compare ticker prices, change rates, and volumes across trading pairs.
- **Daily market analysis:** Review available 24-hour highs, lows, average prices, and trading volumes.
- **Candlestick archives:** Collect hourly or other supported candles for historical charting.
- **Research datasets:** Prepare structured market records for Python, Pandas, spreadsheets, and data warehouses.
- **Portfolio research:** Monitor market indicators for selected trading pairs as part of an independent analysis workflow.

### Input Parameters

| Parameter | Type | Default | Description |
|---|---|---|---|
| `symbols` | Array of strings | `["BTC-USDT"]` | Trading pairs used for ticker, statistics, and candlestick collection. |
| `mode` | String | `ticker` | Collection mode: `ticker`, `allTickers`, `stats`, or `klines`. |
| `klineType` | String | `1hour` | Candlestick interval, used only in `klines` mode. |
| `maxItems` | Integer | `100` | Maximum number of successful rows to save. Hard maximum: 1,000. |
| `requestDelaySecs` | Number | `0.2` | Minimum delay between requests, in seconds. |
| `timeoutSecs` | Integer | `300` | Maximum run duration. Previously saved rows are retained when the run stops. |
| `requestTimeoutSecs` | Integer | `30` | Maximum wait for an individual response, in seconds. |

#### Example Input

**1. Collect the BTC-USDT ticker**

```json id="u1k6pz"
{
  "symbols": ["BTC-USDT"],
  "mode": "ticker",
  "klineType": "1hour",
  "maxItems": 100,
  "requestDelaySecs": 0.2,
  "timeoutSecs": 300,
  "requestTimeoutSecs": 30
}
```

**2. Collect 24-hour statistics for selected pairs**

```json id="q2w8mf"
{
  "symbols": ["BTC-USDT", "ETH-USDT", "SOL-USDT"],
  "mode": "stats",
  "klineType": "1hour",
  "maxItems": 100,
  "requestDelaySecs": 0.2,
  "timeoutSecs": 300,
  "requestTimeoutSecs": 30
}
```

**3. Collect all available tickers**

```json id="a6n4rb"
{
  "symbols": [],
  "mode": "allTickers",
  "klineType": "1hour",
  "maxItems": 1000,
  "requestDelaySecs": 0.2,
  "timeoutSecs": 300,
  "requestTimeoutSecs": 30
}
```

**4. Collect hourly candlestick data**

```json id="c9v5jd"
{
  "symbols": ["BTC-USDT"],
  "mode": "klines",
  "klineType": "1hour",
  "maxItems": 100,
  "requestDelaySecs": 0.2,
  "timeoutSecs": 300,
  "requestTimeoutSecs": 30
}
```

The `symbols` list is used by ticker, statistics, and candlestick modes. The all-tickers mode collects the available ticker collection rather than relying on individual symbols.

### What Data Does This Actor Extract?

Each successful result is stored as a flat dataset row. The fields depend on the selected collection mode and the data available for the selected trading pair.

#### Extracted Data Fields

| Field | Type | Description |
|---|---|---|
| `time` | Integer | Exchange timestamp in milliseconds for ticker data or seconds for candle open time, depending on the mode. |
| `sequence` | String | Sequence identifier when provided by the ticker record. |
| `price` | String | Latest price reported by the individual ticker. |
| `size` | String | Last-traded size reported by the individual ticker. |
| `bestBid` | String | Best available bid price for the individual ticker. |
| `bestBidSize` | String | Size available at the best bid. |
| `bestAsk` | String | Best available ask price for the individual ticker. |
| `bestAskSize` | String | Size available at the best ask. |
| `symbol` | String | Trading pair, such as `BTC-USDT`. |
| `last` | String | Last price, when provided by all-tickers or statistics data. |
| `vol` | String | Trading volume, when provided by the selected market data. |
| `changeRate` | String | Price change rate, when available. |
| `openPrice` | String | Opening price field when available in the selected data. |
| `closePrice` | String | Closing price field when available in the selected data. |
| `highPrice` | String | High price field when available in the selected data. |
| `lowPrice` | String | Low price field when available in the selected data. |
| `klineType` | String | Candlestick interval associated with the record. |
| `mode` | String | Collection mode: `ticker`, `allTickers`, `stats`, or `klines`. |
| `scraped_at` | String | UTC timestamp indicating when the row was saved. |

Not every field appears in every mode. The actor preserves the market data fields available for the selected collection type.

#### Example Output

```json id="m8x3ft"
{
  "time": 1791753818138,
  "sequence": "38527892128",
  "price": "83334.8",
  "size": "0.03155243",
  "bestBid": "83334.8",
  "bestBidSize": "0.1646019",
  "bestAsk": "83334.9",
  "bestAskSize": "0.0532125",
  "symbol": "BTC-USDT",
  "mode": "ticker",
  "scraped_at": "2026-10-12T00:00:00Z"
}
```

This example illustrates the individual ticker record structure. Actual prices, sizes, timestamps, and other values vary with market conditions and collection time.

### Working with Your Dataset

After the run completes, open the dataset in Apify to inspect or download the collected market records.

- **JSON:** Useful for structured processing and application workflows.
- **CSV:** Suitable for Pandas, spreadsheet analysis, and data transformation.
- **Excel:** Convenient for reviewing market snapshots, filtering symbols, and preparing reports.

For example, use ticker records to compare bid-ask spreads, use statistics records to compare daily trading activity, or use candlestick records to prepare price charts. Check timestamps and field availability before combining data from different modes.

### Important Notes

- The default mode is `ticker`, with `BTC-USDT` as the default symbol.
- Supported modes are `ticker`, `allTickers`, `stats`, and `klines`.
- Candlestick interval settings apply only to `klines` mode.
- The maximum number of successful rows is 1,000 per run.
- The default row limit is 100.
- All-tickers collection may return many trading pairs, so the configured row limit can restrict the saved results.
- The actor processes requests sequentially and observes the configured delay between calls.
- Duplicate pairs and duplicate candles are skipped.
- Results reflect the market information available when the actor runs; they are not guaranteed to represent current prices after collection.
- Trading-pair availability and supported candlestick intervals depend on the exchange's available market data.
- Cryptocurrency prices can change rapidly. Historical snapshots should not be treated as real-time quotes after collection.
- Market data is provided for research and analysis, not as a guarantee of future performance or investment advice.

### FAQ

**What collection modes are available?**

The actor supports individual ticker collection, all-tickers collection, 24-hour market statistics, and candlestick data.

**Can I collect several trading pairs in one run?**

Yes. Provide multiple symbols, such as `BTC-USDT`, `ETH-USDT`, and `SOL-USDT`, for ticker, statistics, or candlestick collection.

**What is the difference between ticker and all-tickers mode?**

Ticker mode collects individual ticker information for the selected symbols. All-tickers mode collects the available collection of ticker records.

**What does stats mode collect?**

Stats mode collects available 24-hour market information, which may include high and low prices, volume, average price, and other statistics.

**What is klines mode?**

Klines mode collects candlestick records for selected trading pairs using the configured interval. The available intervals depend on the exchange's supported options.

**How fresh is the market data?**

Each run collects the information available at collection time. The `scraped_at` field records when a row was saved; it does not guarantee a particular exchange latency.

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

Yes. Apify datasets can be downloaded as JSON, CSV, or Excel.

**Why did the actor save fewer rows than expected?**

The `maxItems` setting limits successful rows. Results can also vary depending on available trading pairs, the selected mode, and the records returned during collection.

### Disclaimer

This actor is an independent data-collection tool and is not affiliated with, endorsed by, sponsored by, or officially associated with KuCoin or its owners. Market data is provided for informational and research purposes. Users are responsible for evaluating the suitability of the collected information for their intended use. Nothing in the dataset constitutes financial advice or a recommendation to buy or sell cryptocurrency.

### 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

## `symbols` (type: `array`):

KuCoin spot symbols such as BTC-USDT. Used by ticker, stats, and klines. One symbol per line. allTickers reads the full public book and does not filter this list.

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

Which public market feed to collect: ticker (level 1 order book), allTickers (every spot ticker), stats (24 hour stats), or klines (candles).

## `klineType` (type: `string`):

Candle interval for klines mode. The verified sample uses 1hour. Other values are the intervals that endpoint accepts.

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

Maximum successful rows to save in one run. Free cap is 1000.

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

Seconds to wait between HTTP calls. Minimum 0.2 so the public pool is not hammered.

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

Maximum seconds the run may spend fetching before it stops and saves what it already collected.

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

Seconds to wait for a single HTTP response before retrying.

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

Optional proxy for requests. Leave Apify Proxy off unless an IP is rate limited. Datacenter proxies are fastest. Residential proxies are harder to detect.

## Actor input object example

```json
{
  "symbols": [
    "BTC-USDT",
    "ETH-USDT"
  ],
  "mode": "ticker",
  "klineType": "1hour",
  "maxItems": 100,
  "requestDelaySecs": 0.2,
  "timeoutSecs": 300,
  "requestTimeoutSecs": 30,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `datasetUrl` (type: `string`):

API link to the default dataset for this run.

## `datasetViewUrl` (type: `string`):

API link to the overview table of the default dataset.

# 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 = {
    "symbols": [
        "BTC-USDT"
    ],
    "mode": "ticker",
    "klineType": "1hour",
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("real-estate-api/kucoin-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 = {
    "symbols": ["BTC-USDT"],
    "mode": "ticker",
    "klineType": "1hour",
    "proxyConfiguration": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("real-estate-api/kucoin-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 '{
  "symbols": [
    "BTC-USDT"
  ],
  "mode": "ticker",
  "klineType": "1hour",
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call real-estate-api/kucoin-market-data-scraper-202610120341 --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,real-estate-api/kucoin-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/b6VYvCodaqqxOpJJ8/builds/1gXQIMotrN38s9szb/openapi.json
