系統 Python 指標源碼與文檔
GET/api/v1.0/quote/system-indicator-python-docs/details按系統指標目錄中的 guid 獲取系統指標 Python 源碼、說明與輸入輸出參數,locale 須與目錄相同。需登錄用戶;guid 去重並去除兩端空白後區分大小寫匹配,未命中的原始 guid 列在 not_found。
請求參數
| 參數 | 類型 | 位置 | 必填 | 說明 |
|---|---|---|---|---|
locale | string | 查詢 | 否 | 語言,默認 zh-CN,支持 en、zh-CN、zh-Hans-CN、ja-JP;zh-Hans-CN 與 zh-CN 對應獨立目錄 |
guids | string[] | 查詢 | 是 | 1 到 20 個 guid(去重前查詢項上限 20),服務端去除首尾空白並去重後區分大小寫匹配;查詢多個值時重複傳入同名查詢參數 |
請求示例
bash
curl -s "https://webapi.futunn.com/api/v1.0/quote/system-indicator-python-docs/details?locale=en&guids=901A30FB285C4f1aB536F3829DD41B6C" \
-H "Authorization: Bearer <AccessToken>"響應字段
以下為 data 內字段。
| 字段 | 類型 | 說明 |
|---|---|---|
locale | string | 實際使用的語言 |
catalog_version | string | 產生本次源碼的快照版本,建議與 locale 組合作為緩存鍵 |
indicators | object[] | 找到的指標列表,按請求順序排列,最多 20 條 |
indicators[].guid | string | 去除首尾空白後的 guid |
indicators[].py_indicator_name | string | Python 指標名,允許為空串 |
indicators[].indicator_short_name | string | 指標簡稱 |
indicators[].indicator_name | string | 指標名稱 |
indicators[].summary | string | 短說明,與目錄接口一致 |
indicators[].py_doc | string | Python 說明全文,缺失時為空串 |
indicators[].py_indicator_src | string | Python 源碼 |
indicators[].py_input_parameters | string | 入參定義 JSON 字符串 |
indicators[].py_output_parameter | string | 出參定義 JSON 字符串 |
not_found | string[] | 該語言下未命中的原始 guid 列表,最多 20 個;全部命中時為空數組 |
響應示例
json
{
"code": 0,
"message": "success",
"data": {
"locale": "en",
"catalog_version": "2b8f67",
"indicators": [],
"not_found": [
"901A30FB285C4f1aB536F3829DD41B6C"
]
}
}錯誤碼
失敗響應(code != 0)會在頂層附加 trace_id(code=0 時省略)。
| code | 說明 |
|---|---|
| -3 | 請求參數不合法,例如缺失 guids、guids 超過 20 項或 locale 不在允許範圍內 |
| -5 | 未登錄、用戶歸屬地不在支持範圍(支持 CN/HKG/US/SG/AU/JP)或內部查詢失敗 |
| -9 | 當前訪問策略拒絕 |
| -11 | 請求過於頻繁,按 Retry-After 秒數退避 |
| -13 | 限頻服務暫不可用 |