cn-realtime-quote

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

CN Realtime Quote — A股实时行情

CN Realtime Quote — A-share Real-time Market

所有接口均为 V2 版本(
/api/v2/...
)。
All interfaces are V2 version (
/api/v2/...
).

Curl Setup

Curl Setup

bash
BASE="http://43.167.234.49:3101"
AUTH=(-H "X-API-Key: 123456" -H "Content-Type: application/json")

bash
BASE="http://43.167.234.49:3101"
AUTH=(-H "X-API-Key: 123456" -H "Content-Type: application/json")

代码格式规则

Code Format Rules

规则
参数名
codes
代码格式纯数字,不带交易所后缀
单次上限500 个代码
分隔符英文逗号
市场示例
上交所 (SH)
600519
深交所 (SZ)
000001
北交所 (BJ)
430047
❌ 错误写法
600519.SH
SH600519
sh600519

RuleValue
Parameter Name
codes
Code FormatPure numbers, without exchange suffix
Single Request Limit500 codes
SeparatorEnglish comma
MarketExample
Shanghai Stock Exchange (SH)
600519
Shenzhen Stock Exchange (SZ)
000001
Beijing Stock Exchange (BJ)
430047
❌ Incorrect Format:
600519.SH
,
SH600519
,
sh600519

端点详情

Endpoint Details

GET /api/v2/cnstock/securities

GET /api/v2/cnstock/securities

批量查询 A股 实时报价。
ParameterTypeRequiredDescription
codes
stringYes证券代码,逗号分隔(如
600519,000001,300750
fields
stringNo返回字段,逗号分隔(不传返回全部)

Batch query real-time A-share quotes.
ParameterTypeRequiredDescription
codes
stringYesSecurities codes, separated by commas (e.g.,
600519,000001,300750
)
fields
stringNoReturn fields, separated by commas (returns all if not provided)

调用示例

Call Examples

bash
undefined
bash
undefined

查询单只股票

Query single stock

curl -sS "${AUTH[@]}" "$BASE/api/v2/cnstock/securities?codes=600519"
curl -sS "${AUTH[@]}" "$BASE/api/v2/cnstock/securities?codes=600519"

批量查询

Batch query

curl -sS "${AUTH[@]}" "$BASE/api/v2/cnstock/securities?codes=600519,000001,300750"
curl -sS "${AUTH[@]}" "$BASE/api/v2/cnstock/securities?codes=600519,000001,300750"

只查指定字段

Query specified fields only

curl -sS "${AUTH[@]}" "$BASE/api/v2/cnstock/securities?codes=600519&fields=price,chgPct,volume"
curl -sS "${AUTH[@]}" "$BASE/api/v2/cnstock/securities?codes=600519&fields=price,chgPct,volume"

多股票并行查询

Parallel query for multiple stocks

curl -sS "${AUTH[@]}" "$BASE/api/v2/cnstock/securities?codes=600519" & curl -sS "${AUTH[@]}" "$BASE/api/v2/cnstock/securities?codes=000001" & wait

**响应示例**:

```json
{
  "success": true,
  "data": {
    "600519": {
      "name": "贵州茅台",
      "price": 1688.50,
      "chgPct": 1.25,
      "volume": 3500000,
      "high": 1695.00,
      "low": 1675.00,
      "open": 1680.00
    }
  },
  "timestamp": 1710865200000
}

curl -sS "${AUTH[@]}" "$BASE/api/v2/cnstock/securities?codes=600519" & curl -sS "${AUTH[@]}" "$BASE/api/v2/cnstock/securities?codes=000001" & wait

**Response Example**:

```json
{
  "success": true,
  "data": {
    "600519": {
      "name": "Kweichow Moutai",
      "price": 1688.50,
      "chgPct": 1.25,
      "volume": 3500000,
      "high": 1695.00,
      "low": 1675.00,
      "open": 1680.00
    }
  },
  "timestamp": 1710865200000
}

错误排查

Troubleshooting

错误原因修复
返回空数据
codes
带了后缀
用纯数字:
600519
,不要
600519.SH
400API key 无效联系管理员检查 API Key
部分代码无数据代码不存在或已退市核对代码是否正确
ErrorCauseFix
Empty data returned
codes
has suffix
Use pure numbers:
600519
, not
600519.SH
400Invalid API keyContact administrator to check API Key
No data for some codesCode does not exist or has been delistedVerify if the code is correct