# Eastmoney 东方财富 Scraper — A-Share Quotes, K-Lines (`china-data-lab/eastmoney-stock-scraper`) Actor

Scrape Eastmoney (东方财富), China's most-used retail stock portal. Get real-time A-share quotes for the whole market (code, name, price, change %, volume, turnover, PE, PB, market cap), historical K-lines (daily/weekly/monthly/minute, forward or backward adjusted), and main-capital flow data. Covers...

- **URL**: https://apify.com/china-data-lab/eastmoney-stock-scraper.md
- **Developed by:** [lijinyu](https://apify.com/china-data-lab) (community)
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $30.45 / 1,000 quote rows

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

## Eastmoney Stock Scraper — A-Share Quotes, K-Lines & Flow

Scrape **Eastmoney (东方财富)** — the quote portal Chinese retail investors actually use, and the default place millions of them check prices every morning. This actor turns Eastmoney's public quote endpoints into clean JSON: a full-market real-time quote table, main-force capital-flow rankings, and historical K-lines for any stock or index.

No login. No API key. No cookies. No proxy.

### Why China A-share data

A-shares are one of the world's largest equity markets by listed count — more than 5,000 companies across Shanghai, Shenzhen and Beijing — and one of the least covered by Western data vendors. Three groups of buyers keep asking for exactly this data:

- **Quantitative researchers** who need a cheap, repeatable price and factor source for a market that is not on their existing vendor contract. Daily bars plus PE / PB / market cap / turnover rate are enough to build and backtest a factor book.
- **ADR and cross-listing analysts** who track the link between US-listed China ADRs, their Hong Kong secondaries and the onshore A-share line. You cannot model that spread without a reliable onshore quote feed.
- **Emerging-market factor and macro research** where China is the largest single weight in the index. Index constituents, sector breadth and capital-flow dispersion are inputs, not footnotes.

Eastmoney is the pragmatic source for all three: it is free, it is updated during the session, and it speaks the same field vocabulary (PE, PB, turnover rate, main-force net inflow) that Chinese practitioners use, so the numbers reconcile with local research instead of needing a translation layer.

### Coverage

| Board | `market` key | Code prefixes | `exchange` value |
| --- | --- | --- | --- |
| All A-shares (everything below) | `all_a` | all | `SSE` / `SZSE` / `BSE` |
| Shanghai Stock Exchange — main board | `sh_a` | `60…` | `SSE` |
| Shenzhen Stock Exchange — main board | `sz_a` | `00…` | `SZSE` |
| ChiNext / 创业板 | `chinext` | `30…` | `SZSE` |
| STAR Market / 科创板 | `star` | `68…` | `SSE` |
| Beijing Stock Exchange / 北交所 | `bj` | `8…`, `4…` | `BSE` |

`sh_a` covers the SSE main board **and** STAR Market; `sz_a` covers the SZSE main board **and** ChiNext. `all_a` is the union of all of them.

### What you get

Every quote record is one flat object with these fields. `f` is the raw Eastmoney field id, kept here so you can cross-check against the source.

| Field | `f` | Meaning |
| --- | --- | --- |
| `code` | f12 | 6-digit ticker, e.g. `300663` |
| `name` | f14 | Chinese stock name, kept verbatim, e.g. `科蓝软件` |
| `price` | f2 | latest price, CNY |
| `change_pct` | f3 | change vs previous close, % |
| `change` | f4 | change vs previous close, CNY |
| `volume_lots` | f5 | volume in lots (1 lot = 100 shares) |
| `turnover` | f6 | turnover, CNY |
| `amplitude_pct` | f7 | day amplitude, % |
| `turnover_rate_pct` | f8 | turnover rate, % |
| `pe_dynamic` | f9 | dynamic P/E ratio |
| `volume_ratio` | f10 | volume ratio / 量比 |
| `high` | f15 | day high, CNY |
| `low` | f16 | day low, CNY |
| `open` | f17 | open, CNY |
| `prev_close` | f18 | previous close, CNY |
| `market_cap` | f20 | total market cap, CNY |
| `float_market_cap` | f21 | free-float market cap, CNY |
| `pb` | f23 | price / book |
| `main_net_inflow` | f62 | main-force net inflow, CNY |
| `main_net_inflow_pct` | f184 | main net inflow as % of turnover |
| `super_large_net` | f66 | extra-large order net inflow, CNY |
| `large_net` | f72 | large order net inflow, CNY |
| `medium_net` | f78 | medium order net inflow, CNY |
| `small_net` | f84 | small order net inflow, CNY |

Plus these derived fields, appended to every quote record:

| Field | Meaning |
| --- | --- |
| `market` | the `market` board you requested |
| `exchange` | `SSE` / `SZSE` / `BSE`, derived from the code prefix |
| `secid` | Eastmoney security id — `1.<code>` for Shanghai, `0.<code>` elsewhere |
| `url` | canonical Eastmoney quote page |
| `note` | which mode produced the row (`list` or `fundflow`) |
| `scraped_at` | ISO 8601, UTC |

Missing values come back as `null` rather than `-`, so numeric columns stay numeric.

### Modes

| Mode | What it does | Typical use |
| --- | --- | --- |
| `list` | Whole-market real-time quote table, paged, ordered by `sortBy` | Daily snapshots, screeners, breadth and dispersion work |
| `fundflow` | The same quote table, forced to rank by `f62` main net inflow | Capital-flow rankings, "who is money buying today" |
| `kline` | Historical candles per `secid`, any period and adjustment | Backtesting, charting, technical and volatility research |

In `list` mode `sortBy` takes an Eastmoney field id — `f3` change %, `f6` turnover, `f8` turnover rate, `f9` PE, `f20` market cap. In `fundflow` mode `sortBy` is ignored and the ranking is always by `f62`. `maxItems` caps the total number of rows across pages; `pageSize` (max 100) is only how many rows each HTTP request asks for.

### K-line records

`kline` mode returns one record per candle per security:

| Field | Meaning |
| --- | --- |
| `code` | ticker, e.g. `000001` |
| `date` | bar date `YYYY-MM-DD`, or `YYYY-MM-DD HH:MM` for intraday periods |
| `open` / `close` / `high` / `low` | OHLC |
| `volume_lots` | volume in lots |
| `turnover` | turnover, CNY |
| `amplitude_pct` | bar amplitude, % |
| `secid` | the security id you asked for |
| `period` | the `period` value used |
| `adjust` | the `adjust` value used |

`period`: `101` daily, `102` weekly, `103` monthly, and `1` / `5` / `15` / `30` / `60` for one- to sixty-minute bars. `adjust`: `0` unadjusted, `1` forward-adjusted (qfq), `2` backward-adjusted (hfq). `bars` sets how many candles each security returns — in this mode `maxItems` does not apply.

Indexes use the same endpoint, which is why `1.000001` in the example below is the SSE Composite rather than Ping An Bank.

### Use cases

- **Quantitative factor research** — pull the whole market daily, build value (PE / PB), size (market cap), liquidity (turnover rate) and momentum (change %) factors on one consistent snapshot.
- **A-share sentiment and capital-flow analysis** — `fundflow` ranks the market by main-force net inflow; split it into super-large / large / medium / small order buckets to see whether a move is institutional or retail.
- **Index and basket construction** — screen `star`, `chinext` or `bj` separately, then cap-weight by `float_market_cap` to build your own board-level basket.
- **China market data pipelines** — schedule it on Apify, land the dataset in your warehouse, and you have an onshore price store without a vendor contract.
- **Academic research** — reproduce Chinese-market studies (PEAD, retail attention, order-flow imbalance) against the same field definitions local researchers use.

### Input examples

Real-time quote table — every A-share, sorted by change %:

```json
{
  "mode": "list",
  "market": "all_a",
  "sortBy": "f3",
  "pageSize": 100,
  "maxItems": 100
}
```

Main-force capital flow ranking, ChiNext only:

```json
{
  "mode": "fundflow",
  "market": "chinext",
  "maxItems": 50
}
```

Daily forward-adjusted candles for the SSE Composite and Kweichow Moutai:

```json
{
  "mode": "kline",
  "secids": ["1.000001", "1.600519"],
  "period": 101,
  "adjust": 1,
  "bars": 250
}
```

### Output examples

`list` mode — one record (all quote fields shown above are present; abbreviated here for readability):

```json
{
  "market": "all_a",
  "code": "300663",
  "name": "科蓝软件",
  "price": 6.64,
  "change_pct": 20.07,
  "change": 1.11,
  "volume_lots": 531838.0,
  "turnover": 330605108.52,
  "amplitude_pct": 19.71,
  "turnover_rate_pct": 11.38,
  "pe_dynamic": -21.18,
  "volume_ratio": 3.17
}
```

`kline` mode — one daily bar:

```json
{
  "code": "000001",
  "date": "2026-11-23",
  "open": 3503.52,
  "close": 3538.95,
  "high": 3544.6,
  "low": 3476.65,
  "volume_lots": 512192714.0,
  "turnover": 738500418823.1,
  "amplitude_pct": 1.92,
  "secid": "1.000001",
  "period": 101,
  "adjust": 1
}
```

### Pricing

Pay per event, so a cheap quote pull never subsidises an expensive K-line backfill. Each row written to the dataset is charged as exactly one event:

| Event | Charged for | Price (FREE / BRONZE) |
| --- | --- | --- |
| `result` | one row of the quote table (`list` mode) | $0.035 |
| `fundflow` | one main-capital-flow row (`fundflow` mode) | $0.042 |
| `kline-bar` | one OHLCV candle (`kline` mode) | $0.018 |
| actor start | once per run (one event per GB of memory, minimum one) | $0.03 |

Higher Apify subscription tiers get an automatic discount on every event; the dataset tab shows the exact price for your plan. Charging is strictly after the write — the actor pushes a record, then charges for it, so a failed run never bills you for rows you did not get. `maxItems` (and `bars` in `kline` mode) is the lever: 20 rows is 20 events.

### Notes and limits

- **No login, no API key, no cookies.** Everything is read from Eastmoney's public quote endpoints, so the actor runs on a plain IP out of the box.
- **Public market data only** — quotes, candles and order-flow aggregates. No personal data, no account data.
- **Protocol order matters.** The quote endpoints (`push2.eastmoney.com`) are tried over **http first**, with https as fallback, because some networks and datacenter IPs get their TLS fingerprint rejected when talking to Eastmoney over https. The K-line endpoint (`push2his.eastmoney.com`) is tried over https first with http as fallback. If a run returns nothing, this is the first thing to look at.
- **`secid` format is `MARKET.CODE`**: `1.` = Shanghai Stock Exchange (including STAR `688…`), `0.` = Shenzhen (including ChiNext `300…`) and Beijing. So `1.600519` is Kweichow Moutai, `0.000001` is Ping An Bank, and `1.000001` is the SSE Composite index.
- **Prices for suspended or pre-open stocks** may be `null`; Eastmoney reports `-`, which is normalized to `null`.
- **Pay per event.** Keep `maxItems` and `bars` low while you explore — a test run with `maxItems: 20` costs a fraction of a cent. See the pricing table above for which event each mode charges.
- **Rate limits.** Pagination sleeps ~0.5 s between requests and the client retries 3 times with backoff per host. Requests are sequential by design to stay polite.
- Export as JSON, CSV or Excel from the dataset tab, or pull the dataset with the Apify API.

# Actor input Schema

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

list = real-time quote table, fundflow = capital flow ranking, kline = historical candles for specific stocks

## `market` (type: `string`):

Which board to pull in list/fundflow mode

## `sortBy` (type: `string`):

f3 = change %, f6 = turnover, f20 = market cap, f8 = turnover rate, f9 = PE

## `pageSize` (type: `integer`):

Rows requested per API call, max 100

## `secids` (type: `array`):

Eastmoney secids, format MARKET.CODE where 1=Shanghai, 0=Shenzhen. Example: 1.600519 (Kweichow Moutai), 0.000001 (Ping An Bank), 1.000001 (SSE Composite index)

## `period` (type: `integer`):

101 daily, 102 weekly, 103 monthly, 1 one-minute, 5 five-minute, 15, 30, 60

## `adjust` (type: `integer`):

0 none, 1 forward-adjusted (qfq), 2 backward-adjusted (hfq)

## `bars` (type: `integer`):

How many candles to return for each security

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

Hard cap on returned rows — you pay per result, keep it low while testing

## Actor input object example

```json
{
  "mode": "list",
  "market": "all_a",
  "sortBy": "f3",
  "pageSize": 100,
  "secids": [
    "1.000001",
    "1.600519"
  ],
  "period": 101,
  "adjust": 1,
  "bars": 250,
  "maxItems": 10
}
```

# Actor output Schema

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

No description

# 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 = {
    "secids": [
        "1.000001",
        "1.600519"
    ],
    "maxItems": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("china-data-lab/eastmoney-stock-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 = {
    "secids": [
        "1.000001",
        "1.600519",
    ],
    "maxItems": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("china-data-lab/eastmoney-stock-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 '{
  "secids": [
    "1.000001",
    "1.600519"
  ],
  "maxItems": 10
}' |
apify call china-data-lab/eastmoney-stock-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,china-data-lab/eastmoney-stock-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/govwVaJdzrdrGaIjb/builds/OgnrgphzGaDPrmtRb/openapi.json
