# 取得歷史股價資料

**API:** Data API

**Endpoint:** `GET /v1/beta/financial/prices`

**Tags:** Financial Data

單一股票的歷史 OHLCV K 線。`ticker`、`interval`、`start_date` 與 `end_date` 四者都是選擇器——沒有近期時間視窗的快捷參數。`interval` 為 day、week、month 或 year 之一。每根 K 線包含 `open`、`close`、`high`、`low`、`volume` 與 `time`，位於 `prices` 陣列中，並與回傳的 `ticker` 一同傳回。用於繪製圖表或衡量已知時間視窗內的漲跌。若只需最新價格，請用 `get_financial_prices_snapshot`。

### 計費參考

- 計量方式：以成功請求為固定成本基礎。
- 參考請求估算：0.02 美元。
- 參考客戶倍率：1.0。不得對已結算的客戶金額再次應用。

僅供參考的中繼資料，並非帳戶報價、保證價格或消費上限。資源額度並非 Felo 額度。最終費用依 Felo 計費記錄為準。

## Base URL

- `https://openapi.felo.ai`

## Authentication

- `FeloBearerAuth` (http bearer, bearer format Felo API Key)
- `FeloApiKey` (apiKey in header `X-API-Key`)

## Parameters

| Name | In | Required | Type | Description |
| --- | --- | --- | --- | --- |
| `end_date` | query | no | string |  |
| `interval` | query | no | string |  |
| `interval_multiplier` | query | no | string |  |
| `start_date` | query | no | string |  |
| `ticker` | query | no | string |  |

## Responses

### 200 — 價格資料回應

Headers:
- `X-Request-Id` (string) — 聯絡 Felo 支援時需提供的請求識別碼。

**application/json**

Schema: `ResponseE40Feb4D3D6B_PricesResponse` (`#/components/schemas/ResponseE40Feb4D3D6B_PricesResponse`)

### 400 — 無法處理該要求。請檢查請求參數。

### 401 — 需要有效的 Felo API 金鑰。

### 402 — 由於未符合計費要求，要求無法繼續。

### 403 — 該帳戶無權執行此操作。

### 429 — 已達到要求或支出上限。

### 502 — 服務無法完成該要求。

### 503 — API 或計費服務暫時無法使用。

### 504 — 服務在處理要求時逾時。

### default — 錯誤回應；上游透傳回應可能採用供應商格式

**application/json**

Schema:

```json
{}
```

## Schema definitions

### ResponseE40Feb4D3D6B_Price

`#/components/schemas/ResponseE40Feb4D3D6B_Price`

```json
{
  "type": "object",
  "properties": {
    "open": {
      "type": "number",
      "description": "該 ticker 在指定時間期間內的開盤價。"
    },
    "close": {
      "type": "number",
      "description": "該 ticker 在指定時間期間內的收盤價。"
    },
    "high": {
      "type": "number",
      "description": "該 ticker 在指定時間期間內的最高價。"
    },
    "low": {
      "type": "number",
      "description": "該 ticker 在指定時間期間內的最低價。"
    },
    "volume": {
      "type": [
        "integer",
        "null"
      ],
      "description": "該 ticker 在指定時間期間內的交易量。"
    },
    "time": {
      "type": "string",
      "description": "UTC 下該價格時間的人類可讀格式。"
    }
  }
}
```

### ResponseE40Feb4D3D6B_PricesResponse

`#/components/schemas/ResponseE40Feb4D3D6B_PricesResponse`

```json
{
  "type": "object",
  "properties": {
    "ticker": {
      "type": "string",
      "description": "股票代號。"
    },
    "prices": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/ResponseE40Feb4D3D6B_Price"
      }
    },
    "next_page_url": {
      "type": "string",
      "description": "下一頁結果的絕對 URL。僅在還有更多結果時出現；依原樣要求即可繼續。每頁最多 100 筆記錄。"
    }
  }
}
```
