# 利率（歷史）

**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 列。"
    }
  }
}
```
