> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fcontext.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Financial Context

> 由 openapi.fcontext.com 提供的認證市場資料介面

Financial Context 提供已認證、按量計費的只讀美股市場資料存取。請使用 `/api/market-data/*` 下受支援的路徑取得行情、K 線、公司資料、新聞、日曆、選股器和相關分析資料。

## Base URL

```text theme={null}
https://openapi.fcontext.com
```

本參考中的每個介面都以 `https://openapi.fcontext.com/api/market-data` 為根路徑；當介面需要 symbol 或 market 篩選條件時，請使用 `.US` 標的或 `US` 市場。

## 認證

使用帳戶設定中的 Financial Context key：

```bash theme={null}
curl "https://openapi.fcontext.com/api/market-data/quote?symbols=AAPL.US" \
  -H "x-api-key: YOUR_FCONTEXT_API_KEY"
```

OAuth 用戶端可以使用具備市場資料存取權限的 bearer token：

```bash theme={null}
curl "https://openapi.fcontext.com/api/market-data/quote?symbols=AAPL.US" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
```

## 路徑格式

在 `/api/market-data` 前綴之後使用受支援的只讀 `GET` 介面。例如，即時行情使用 `https://openapi.fcontext.com/api/market-data/quote`，新聞使用 `https://openapi.fcontext.com/api/market-data/content/news`，公司概況使用 `https://openapi.fcontext.com/api/market-data/fundamental/company`。API 參考會列出目前介面範圍。

篩選條件、日期範圍、分頁和介面特定選項都透過查詢字串傳入。

## 限制與錯誤

所有市場資料請求都會作為 Financial Context 資料請求計量。

| 狀態碼   | 含義                             |
| ----- | ------------------------------ |
| `400` | 路徑或查詢參數無效                      |
| `401` | 缺少或使用了無效的 Financial Context 憑證 |
| `402` | 需要方案或資料請求額度                    |
| `403` | 憑證無權存取市場資料介面                   |
| `405` | 不支援該方法；請使用 `GET`               |

完整介面列表和參數詳情請查看 API Reference 區域。
