- 在 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 | 凭证有效,但没有市场数据访问权限 |