> For the complete documentation index, see [llms.txt](https://www.bluegamma.io/documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.bluegamma.io/documentation/integrations/api/how-to-guides/getting-forward-rates.md).

# Getting Forward Rates

Use the /forward\_rate endpoint to get the implied rate between any two future dates or tenors, live or as of a historical valuation time, and /forward\_rates to price many periods in one call.

Use the /forward\_rate endpoint to retrieve an implied rate between any two future dates or tenors. See the [API Reference](/documentation/integrations/api/api-reference.md) for every parameter.

```python
url = "https://api.bluegamma.io/v1/forward_rate"
params = {
    "index": "SOFR",
    "start_date": "2027-06-01",
    "end_date": "2027-12-01"
}
response = requests.get(url, headers=headers, params=params)
print(response.json())
```

```bash
curl -X GET "https://api.bluegamma.io/v1/forward_rate?index=SOFR&start_date=2027-06-01&end_date=2027-12-01" \
  -H "x-api-key: your_api_key_here"
```

**📆 Example for a Historical Forward Rate**

Add the `valuation_time` parameter (ISO format, UTC) to get the forward rate as it would have been at a specific timestamp.

```python
params = {
    "index": "SOFR",
    "start_date": "2025-06-01",
    "end_date": "2025-12-01",
    "valuation_time": "2025-04-15T12:00:00Z"
}
```

```bash
curl -X GET "https://api.bluegamma.io/v1/forward_rate?index=SOFR&start_date=2025-06-01&end_date=2025-12-01&valuation_time=2025-04-15T12%3A00%3A00Z" \
  -H "x-api-key: your_api_key_here"
```

🧠 **Tips**

* `start_date` and `end_date` can be either tenors (`"6M"`, `"1Y"`) or full ISO dates (`"2025-06-01"`)
* `valuation_time` is optional — omit it for live data
* Historical requests return the rate *as it was known* at that point in time

**Several Periods in One Call**

To price a list of interest periods, such as every period of a loan schedule, send them to `POST /v1/forward_rates` (up to 500 periods per request). All periods are priced off the same curve snapshot. Dates must be in `YYYY-MM-DD` format.

```python
response = requests.post(
    "https://api.bluegamma.io/v1/forward_rates",
    headers=headers,
    json={
        "index": "SOFR",
        "periods": [
            {"start_date": "2027-01-15", "end_date": "2027-04-15"},
            {"start_date": "2027-04-15", "end_date": "2027-07-15"},
        ],
    },
)
for period in response.json()["rates"]:
    print(period["start_date"], period["end_date"], period["forward_rate"])
```

Each `forward_rate` is in percent, in the same order as the periods you sent. `valuation_time` is optional here too.

***

Create a key under **API Keys** in the app sidebar. See [Authentication](/documentation/integrations/api/authentication.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://www.bluegamma.io/documentation/integrations/api/how-to-guides/getting-forward-rates.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
