POSTfinance-a-shares-price
A股報價
A股報價
5 匠幣/次
接入文件
介面簡介
本介面提供中國大陸A股市場(含上海、深圳、北京證券交易所)的實時報價資料。開發者可透過傳入股票程式碼,獲取包括最新價、漲跌幅、成交量、成交額以及買賣五檔盤口在內的詳細行情資訊。資料覆蓋全面,適用於需要實時監控股市動態的應用場景。
A股報價
5 匠幣/次
本介面提供中國大陸A股市場(含上海、深圳、北京證券交易所)的實時報價資料。開發者可透過傳入股票程式碼,獲取包括最新價、漲跌幅、成交量、成交額以及買賣五檔盤口在內的詳細行情資訊。資料覆蓋全面,適用於需要實時監控股市動態的應用場景。
請求方式:POST 請求引數:
symbol (必填, string):品種程式碼,支援多個程式碼以英文逗號分隔。格式需包含交易所字首,如 sz000002 (深市), sh600000 (滬市), bj430047 (北交所)。返回結果:
code:業務狀態碼,200表示成功。data:核心資料物件,鍵名為股票程式碼,值為該股票的詳情物件,包含:name:股票名稱price:實時價格change / changeRate:漲跌額與漲跌率high / low:今日最高/最低價volume / value:成交量與成交額bid1_vol ~ bid5_vol / ask1_vol ~ ask5_vol:買一至買五、賣一至賣五的量bid1 ~ / ~ :買一至買五、賣一至賣五的價格symbol 包含正確的交易所字首(sh/sz/bj),否則可能導致查詢失敗或資料錯誤。code 欄位,僅當 code 為 200 時解析 data 內容,並妥善處理網路超時或服務不可用的情況。提供 Shell、Python、Go、Java、PHP 等常見接入示例,便於直接接到現有專案裡。
{
"symbol": "品种代码,以英文逗号分割,如:sz000002,bj430047"
}{
"msg": "成功",
"code": 200,
"taskNo": "202960247220113090298671",
"data": {
"sh688193": {
"name": "仁度生物",
"bid1_vol": "3850",
"high": "28.670",
"update_time": 1713336733,
"low": "26.710",
"price": "27.910",
"ask1_vol": "454",
"bid2_vol": "700",
"changeRate": "4.6887",
"ask5_vol": "600",
"value": "8457252.000",
"bid4_vol": "40",
"change": "1.2500",
"bid3_vol": "1400",
"ask2_vol": "843",
"volume": "303488",
"bid5_vol": "1400",
"ask4_vol": "2064",
"ask5": "28.160",
"ask2": "28.010",
"ask1": "28.000",
"bid5": "27.780",
"ask4": "28.130",
"ask3": "28.020",
"ask": "28.000",
"bid3": "27.840",
"bid4": "27.830",
"bid1": "27.900",
"bid2": "27.850",
"preclose": "26.660",
"bid": "27.900",
"open": "26.880",
"ask3_vol": "1400"
}
}
}以下欄位根據示例 JSON 自動提取,僅作接入參考。
| 欄位路徑 | 型別 | 示例值 |
|---|---|---|
| type | string | object |
| properties | object | {...} |
| properties.symbol | object | {...} |
| properties.symbol.type | string | string |
| properties.symbol.description | string | 品种代码,以英文逗号分割,如:sz000002,bj430047 |
| required | array | "symbol" |
| required[] | string | symbol |
以下欄位根據示例 JSON 自動提取,僅作接入參考。
| 欄位路徑 | 型別 | 示例值 |
|---|---|---|
| type | string | object |
| properties | object | {...} |
| properties.msg | object | {...} |
| properties.msg.type | string | string |
| properties.msg.example | string | 成功 |
| properties.msg.description | string | 接口返回码对应的描述信息 |
| properties.code | object | {...} |
bid5ask1ask5update_time:資料更新時間戳curl --request POST \
--url 'https://openapi.toolkk.com/v1/finance-a-shares-price' \
--header 'Content-Type: application/json' \
--header 'X-API-Key: YOUR_API_KEY' \
--data '{\n "symbol": "品种代码,以英文逗号分割,如:sz000002,bj430047"\n}'import os
import requests
url = "https://openapi.toolkk.com/v1/finance-a-shares-price"
payload = {
"symbol": "品种代码,以英文逗号分割,如:sz000002,bj430047"
}
headers = {
"Content-Type": "application/json",
"X-API-Key": os.getenv("TOOLKK_API_KEY", "YOUR_API_KEY"),
}
response = requests.request("POST", url, headers=headers, json=payload, timeout=30)
response.raise_for_status()
print(response.json())package main
import (
"bytes"
"fmt"
"io"
"net/http"
)
func main() {
endpoint := "https://openapi.toolkk.com/v1/finance-a-shares-price"
payload := []byte("{\n \"symbol\": \"品种代码,以英文逗号分割,如:sz000002,bj430047\"\n}")
req, err := http.NewRequest("POST", endpoint, bytes.NewBuffer(payload))
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("X-API-Key", "YOUR_API_KEY")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, err := io.ReadAll(resp.Body)
if err != nil {
panic(err)
}
fmt.Println(string(body))
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class ToolkkExample {
public static void main(String[] args) throws Exception {
String payload = "{\n \"symbol\": \"品种代码,以英文逗号分割,如:sz000002,bj430047\"\n}";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://openapi.toolkk.com/v1/finance-a-shares-price"))
.method("POST", HttpRequest.BodyPublishers.ofString(payload))
.header("Content-Type", "application/json")
.header("X-API-Key", "YOUR_API_KEY")
.build();
HttpResponse<String> response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}<?php
$endpoint = 'https://openapi.toolkk.com/v1/finance-a-shares-price';
$payload = "{\n \"symbol\": \"品种代码,以英文逗号分割,如:sz000002,bj430047\"\n}";
$ch = curl_init($endpoint);
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => [
'Content-Type: application/json',
'X-API-Key: YOUR_API_KEY',
],
CURLOPT_POSTFIELDS => $payload,
]);
$response = curl_exec($ch);
if ($response === false) {
throw new RuntimeException(curl_error($ch));
}
curl_close($ch);
echo $response;| properties.code.type |
| string |
| number |
| properties.code.example | number | 200 |
| properties.code.description | string | 接口返回码【注意:不等于HTTP响应状态码】 |
| properties.taskNo | object | {...} |
| properties.taskNo.type | string | string |
| properties.taskNo.example | string | 202960247220113090298671 |
| properties.taskNo.description | string | 任务订单号【可反馈服务商复核对应订单】 |
| properties.data | object | {...} |
| properties.data.type | string | object |