# 获取历史股价数据

**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 条记录。"
    }
  }
}
```
