ashares_index_bars
Pack: china-exchange-data · Connect: https://pipeworx.io/mcp (see Connect below for a single-pack URL)
No MCP client? Call it directly: GET https://gateway.pipeworx.io/v1/tools/ashares_index_bars for the schema, then POST the same URL with its arguments for the data.
上证/深证指数日线周线年线 — Daily, weekly, or annual OHLC + volume + turnover bars for a major China A-share index: 上证指数 Shanghai Composite (000001), 上证50 (000016), 沪深300 CSI 300 (000300), 科创50 STAR50 (000688) from SSE; 深证成指 Shenzhen Component (399001), 创业板指 ChiNext (399006) from SZSE. Weekly history goes back up to 6 years (312 bars); years returns one bar per calendar year (close + year-over-year pct change) for multi-year questions like “5 years of annual closes for CSI 300”. Answers “上证指数000001最近10个交易日OHLC”, “Shanghai Composite last 10 days”, “深证成指周线”, “ChiNext index history”, “CSI 300 annual close 2020-2025”. Source: SSE yunhq public quote system (000xxx/999xxx indices) + SZSE ssjjhq history API (399xxx indices), both keyless.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
index | string | no | Index code: 000001 (上证指数), 000016 (上证50), 000300 (沪深300), 000688 (科创50), 399001 (深证成指), 399006 (创业板指). Default 000001. |
days | number | no | Number of daily bars to return, 1-250 (default 10). Ignored if weeks or years is set. |
weeks | number | no | Number of weekly bars to return, 1-312 (up to ~6 years). Overrides days when set; ignored if years is set. |
years | number | no | Number of annual bars to return, 1-40 — one bar per calendar year with close and year-over-year pct_change. Overrides weeks and days when set. E.g. years:6 for 2020-2025 inclusive. |
Example call
Arguments
{
"index": "000001",
"days": 10
}
curl
curl -X POST https://gateway.pipeworx.io/china-exchange-data/mcp \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"ashares_index_bars","arguments":{"index":"000001","days":10}}}'
TypeScript (@pipeworx/sdk)
import { Pipeworx } from '@pipeworx/sdk';
const pipeworx = new Pipeworx();
const result = await pipeworx.call('ashares_index_bars', {
"index": "000001",
"days": 10
});
More examples
{
"index": "399006",
"weeks": 4
}
{
"index": "000300",
"years": 6
}
Connect
Add this to your MCP client config — every tool in the catalog, including this one — or use one-click install buttons:
{
"mcpServers": {
"pipeworx": {
"url": "https://pipeworx.io/mcp"
}
}
}
Connect to just the china-exchange-data pack
{
"mcpServers": {
"china-exchange-data": {
"url": "https://gateway.pipeworx.io/china-exchange-data/mcp"
}
}
}
See Getting Started for client-specific install steps.