# China Stock Connect Flow — 北向资金 API (`nexgendata/china-stock-connect-flow`) Actor

Track China Stock Connect flows — Northbound and Southbound capital. Clean JSON for analysts, quants and AI agents.

- **URL**: https://apify.com/nexgendata/china-stock-connect-flow.md
- **Developed by:** [NexGenData](https://apify.com/nexgendata) (community)
- **Categories:** Business
- **Stats:** 4 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $100.00 / 1,000 flow rows

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## China Stock Connect Flow

Track China Stock Connect flows — Northbound and Southbound capital. Built for analysts, quants, fintech builders and AI agents.

Factual public data — not financial or investment advice.

### 📊 What you get

Clean JSON, one record per record (full output has 14 fields):

- `accumDealAmountWan` — Accum Deal Amount Wan
- `buyAmountWan` — Buy Amount Wan
- `channel` — Channel
- `direction` — Direction
- `indexClose` — Index Close
- `indexName` — Index Name
- `leadStock` — Lead Stock
- `leadStockChangePct` — Lead Stock Change Pct
- `netDealAmountWan` — Net Deal Amount Wan
- `note` — Note

**Pricing:** $0.10 per record (Pay-Per-Event) — about **10 records per $1**.

### 🤖 Use with AI agents

Structured JSON built for LLM and agent pipelines — point Claude, the OpenAI Agents SDK, an n8n flow or any MCP-aware client at it and pull China Northbound/Southbound Stock Connect flows on demand.

**Sample agent prompt:**

```
Show today's Northbound Stock Connect net flow and the lead stocks.
```

**Agentic payments (x402):** Supports agentic payment via x402 — agents can call this actor with USDC, no API key required.

### ⏰ Run on a schedule

This is a monitoring play — schedule a recurring pull:

```json
{
  "limit": 50
}
```

### 中文说明

本 Actor 提供沪深港通资金流向数据（北向/南向资金、买入/净成交金额、龙头个股），输出为整洁的 JSON，适用于分析师、量化研究人员、金融科技开发者和 AI 智能体。按「资金流记录」计费（约每美元 10 条）。支持定时运行——可每日或每周自动抓取北向/南向资金流向，是一个持续监控型数据源。公开数据，非投资建议。

### 🔗 Related China actors

**China data suite:** [Listed Company Announcements](https://apify.com/nexgendata/china-listed-company-announcements), [Dragon-Tiger List](https://apify.com/nexgendata/china-dragon-tiger-list), [A-Share Financials](https://apify.com/nexgendata/china-a-share-financials), [Hot Stocks](https://apify.com/nexgendata/china-hot-stocks-attention)

**Cross-market hubs:** [APAC Disclosure Monitor](https://apify.com/nexgendata/apac-disclosure-monitor), [APAC IPO Calendar Sweep](https://apify.com/nexgendata/apac-ipo-calendar-sweep)

***

\*Data from public Chinese market and government sources. Factual public data — not financial or investment advice.

公开数据，非投资建议。\*

# Actor input Schema

## `direction` (type: `string`):

Northbound (foreign money into A-shares), Southbound (mainland money into HK), or all.

## `maxResults` (type: `integer`):

Max channel-day rows to return (6 channels per trading day).

## Actor input object example

```json
{
  "direction": "all",
  "maxResults": 100
}
```

# 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("nexgendata/china-stock-connect-flow").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("nexgendata/china-stock-connect-flow").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).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 nexgendata/china-stock-connect-flow --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=nexgendata/china-stock-connect-flow",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/zAO8htlRqdV5LQljO/builds/P3IhhuMecvwKaOG4Y/openapi.json
