# 利率（历史）

**API:** Data API

**Endpoint:** `GET /v1/beta/financial/macro/interest-rates`

**Tags:** Financial Data

一家央行的政策利率随时间的变化，以 `interest_rates` 数组返回，包含 `bank`、`name`、`date` 和 `rate`。`bank` 为必填，并受 `start_date` 和 `end_date` 限定。值得注意的陷阱：代码区分大小写，且必须为大写——FED 可用，fed 会返回 HTTP 404 和 "No data found"，看起来像空结果，而不是参数错误。有效代码为 FED、ECB、BOJ、BOE、BOC、RBA、PBOC、SNB、RBI 和 BOK；不带参数调用 `get_financial_macro_interest_rates_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 |
| --- | --- | --- | --- | --- |
| `bank` | query | yes | string | 央行代码，例如 FED、ECB、BOJ。使用 /macro/interest-rates/banks 端点获取可用央行列表。 |
| `cursor` | query | no | string | 来自先前响应 next_page_url 的不透明分页游标。提供后，其他所有查询参数都会被忽略：游标携带原始请求的筛选条件。请将其视为不透明值，不要构造或修改。 |
| `end_date` | query | no | string | 要返回的最后日期（含当日），格式为 YYYY-MM-DD。默认为今天。 |
| `start_date` | query | no | string | 要返回的第一天（含当日），格式为 YYYY-MM-DD。两个日期都省略时，默认为 end_date 前五年；仅提供 end_date 而省略此项，可获取截至该日期的全部可用历史。 |

## Responses

### 200 — 利率响应

Headers:
- `X-Request-Id` (string) — 联系 Felo 支持时需提供的请求标识符。

**application/json**

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

### 400 — 无法处理该请求。请检查请求参数。

### 401 — 需要有效的 Felo API 密钥。

### 402 — 由于未满足计费要求，请求无法继续。

### 403 — 该账户无权执行此操作。

### 429 — 已达到请求或支出限额。

### 502 — 服务无法完成该请求。

### 503 — API 或计费服务暂时不可用。

### 504 — 服务在处理请求时超时。

### default — 错误响应；上游透传响应可能采用提供方格式

**application/json**

Schema:

```json
{}
```

## Schema definitions

### ResponseE40Feb4D3D6B_InterestRate

`#/components/schemas/ResponseE40Feb4D3D6B_InterestRate`

```json
{
  "type": "object",
  "properties": {
    "bank": {
      "type": "string",
      "description": "央行的代码。"
    },
    "name": {
      "type": "string",
      "description": "央行的名称。"
    },
    "rate": {
      "type": "number",
      "description": "当日政策利率，以百分比表示。对于美联储，为目标区间的中点。"
    },
    "date": {
      "type": "string",
      "description": "利率生效的日历日，格式为 YYYY-MM-DD。"
    }
  }
}
```

### ResponseE40Feb4D3D6B_InterestRatesResponse

`#/components/schemas/ResponseE40Feb4D3D6B_InterestRatesResponse`

```json
{
  "type": "object",
  "properties": {
    "interest_rates": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/ResponseE40Feb4D3D6B_InterestRate"
      }
    },
    "next_page_url": {
      "type": "string",
      "description": "仅限历史数据。下一页结果的绝对 URL。仅在还有更多行时出现；按原样请求即可继续。每页最多 10 行。"
    }
  }
}
```
