- 在 Financial Context 帳戶設定中建立的 API key
- 面向已核准 CLI、MCP 或 agent 用戶端的 OAuth bearer token
API Key Header
x-api-key 是伺服器到伺服器整合的建議 header。
OAuth Bearer Token
market_data scope 的市場資料存取權限。
JavaScript 範例
Python 範例
錯誤回應
請定期輪換金鑰,並撤銷不再使用的金鑰。
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
認證 Financial Context 市場資料請求
curl "https://openapi.fcontext.com/api/market-data/quote?symbols=AAPL.US" \
-H "x-api-key: YOUR_FCONTEXT_API_KEY"
x-api-key 是伺服器到伺服器整合的建議 header。
curl "https://openapi.fcontext.com/api/market-data/quote?symbols=AAPL.US" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"
market_data scope 的市場資料存取權限。
const response = await fetch("https://openapi.fcontext.com/api/market-data/quote?symbols=AAPL.US", {
headers: {
"x-api-key": process.env.FCONTEXT_API_KEY,
},
});
if (!response.ok) {
throw new Error(`Request failed with ${response.status}`);
}
const data = await response.json();
import os
import requests
response = requests.get(
"https://openapi.fcontext.com/api/market-data/quote",
params={"symbols": "AAPL.US"},
headers={"x-api-key": os.environ["FCONTEXT_API_KEY"]},
timeout=30,
)
response.raise_for_status()
data = response.json()
| 狀態碼 | 含義 |
|---|---|
401 | 憑證缺失、過期或無效 |
402 | 需要付費方案或剩餘資料請求額度 |
403 | 憑證有效,但沒有市場資料存取權限 |