hk-realtime-quote
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseHK 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
| 规则 | 值 |
|---|---|
| 参数名 | |
| 代码格式 | 纯数字,不带 |
| 单次上限 | 500 个代码 |
| 分隔符 | 英文逗号 |
| 示例 | 说明 |
|---|---|
| 腾讯控股 |
| 阿里巴巴 |
| 百度 |
❌ 错误写法:、
00700.HKHK00700| Rule | Value |
|---|---|
| Parameter Name | |
| Code Format | Pure numbers, no |
| Single Request Limit | 500 codes |
| Separator | English comma |
| Example | Description |
|---|---|
| Tencent Holdings |
| Alibaba |
| Baidu |
❌ Incorrect Format: ,
00700.HKHK00700端点详情
Endpoint Details
GET /api/v2/hkstock/securities
GET /api/v2/hkstock/securities
批量查询港股实时报价。
| Parameter | Type | Required | Description |
|---|---|---|---|
| string | Yes | 证券代码,逗号分隔(如 |
| string | No | 返回字段,逗号分隔(不传返回全部) |
Batch query real-time quotes of Hong Kong stocks.
| Parameter | Type | Required | Description |
|---|---|---|---|
| string | Yes | Stock codes, separated by commas (e.g. |
| string | No | Return fields, separated by commas (returns all if not provided) |
调用示例
Call Examples
bash
undefinedbash
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
| 错误 | 原因 | 修复 |
|---|---|---|
| 返回空数据 | | 用纯数字: |
| 400 | API key 无效 | 联系管理员检查 API Key |
| 部分代码无数据 | 代码不存在 | 核对港股代码是否正确 |
| Error | Cause | Fix |
|---|---|---|
| Returns empty data | | Use pure numbers: |
| 400 | Invalid API key | Contact administrator to check API Key |
| Partial codes have no data | Code does not exist | Verify if the Hong Kong stock code is correct |