hk-realtime-quote

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

HK Realtime Quote — 港股实时行情

HK Realtime Quote — Real-time Hong Kong Stock 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
代码格式纯数字,不带
.HK
后缀
单次上限500 个代码
分隔符英文逗号
示例说明
00700
腾讯控股
09988
阿里巴巴
09888
百度
❌ 错误写法
00700.HK
HK00700

RuleValue
Parameter Name
codes
Code FormatPure numbers, no
.HK
suffix
Single Request Limit500 codes
SeparatorEnglish comma
ExampleDescription
00700
Tencent Holdings
09988
Alibaba
09888
Baidu
❌ Incorrect Format:
00700.HK
,
HK00700

端点详情

Endpoint Details

GET /api/v2/hkstock/securities

GET /api/v2/hkstock/securities

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

Batch query real-time quotes of Hong Kong stocks.
ParameterTypeRequiredDescription
codes
stringYesStock codes, separated by commas (e.g.
00700,09988,09888
)
fields
stringNoReturn fields, separated by commas (returns all if not provided)

调用示例

Call Examples

bash
undefined
bash
undefined

查询单只股票

Query a single stock

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

批量查询

Batch query

curl -sS "${AUTH[@]}" "$BASE/api/v2/hkstock/securities?codes=00700,09988,09888"
curl -sS "${AUTH[@]}" "$BASE/api/v2/hkstock/securities?codes=00700,09988,09888"

只查指定字段

Query only specified fields

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

多股票并行查询

Parallel query for multiple stocks

curl -sS "${AUTH[@]}" "$BASE/api/v2/hkstock/securities?codes=00700" & curl -sS "${AUTH[@]}" "$BASE/api/v2/hkstock/securities?codes=09988" & wait

**响应示例**:

```json
{
  "success": true,
  "data": {
    "00700": {
      "name": "腾讯控股",
      "price": 375.20,
      "chgPct": -0.53,
      "volume": 12000000
    }
  },
  "timestamp": 1710865200000
}

curl -sS "${AUTH[@]}" "$BASE/api/v2/hkstock/securities?codes=00700" & curl -sS "${AUTH[@]}" "$BASE/api/v2/hkstock/securities?codes=09988" & wait

**Response Example**:

```json
{
  "success": true,
  "data": {
    "00700": {
      "name": "Tencent Holdings",
      "price": 375.20,
      "chgPct": -0.53,
      "volume": 12000000
    }
  },
  "timestamp": 1710865200000
}

错误排查

Troubleshooting

错误原因修复
返回空数据
codes
带了
.HK
后缀
用纯数字:
00700
,不要
00700.HK
400API key 无效联系管理员检查 API Key
部分代码无数据代码不存在核对港股代码是否正确
ErrorCauseFix
Returns empty data
codes
has
.HK
suffix
Use pure numbers:
00700
, not
00700.HK
400Invalid API keyContact administrator to check API Key
Partial codes have no dataCode does not existVerify if the Hong Kong stock code is correct