> For the complete documentation index, see [llms.txt](https://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://bluegamma.io/documentation/integrations/api/how-to-guides/fetching-a-forward-swap-curve.md).

# Fetching Forward Swap Curves

The `/forward_swap_curve` endpoint returns swap rates for a single tenor across multiple forward start dates in one request. Use this instead of making multiple `/swap_rate` calls when you need to see how a swap rate evolves across different start dates.

***

## When to Use Forward Swap Curves

| Use Case                 | Why a Forward Swap Curve?                                               |
| ------------------------ | ----------------------------------------------------------------------- |
| **Scenario analysis**    | See how the 5Y swap rate changes for swaps starting 3M, 6M, 1Y from now |
| **Pre-hedging strategy** | Compare rates for different hedge start dates to choose optimal timing  |
| **Curve visualisation**  | Build forward swap rate charts for presentations or dashboards          |
| **Batch pricing**        | Price multiple forward-starting swaps without hitting rate limits       |

{% hint style="info" %}
**vs. `/swap_rate`:** The `/swap_rate` endpoint prices one swap at a time. This endpoint returns an entire curve in a single call, which is faster and avoids rate limits.
{% endhint %}

***

## Basic Example

Get 5Y SOFR swap rates for forward starts every 3 months over the next 2 years:

```python
import requests

url = "https://api.bluegamma.io/v1/forward_swap_curve"
headers = {"x-api-key": "your_api_key"}

params = {
    "index": "SOFR",
    "tenor": "5Y",
    "end_date": "2Y",
    "frequency": "3M",
    "fixed_leg_frequency": "12M"
}

response = requests.get(url, headers=headers, params=params)
data = response.json()

for point in data["curve"]:
    print(f"{point['start_date']} -> {point['maturity_date']}: {point['swap_rate']:.4f}%")
```

```bash
curl -X GET "https://api.bluegamma.io/v1/forward_swap_curve?index=SOFR&tenor=5Y&end_date=2Y&frequency=3M&fixed_leg_frequency=12M" \
  -H "x-api-key: your_api_key_here"
```

**Response (April 2026):**

```json
{
  "index": "SOFR",
  "currency": "USD",
  "tenor": "5Y",
  "start_date": "2026-04-20",
  "end_date": "2028-04-20",
  "frequency": "3M",
  "fixed_leg_frequency": "12M",
  "valuation_time": "2026-04-16T14:17:41.333177",
  "timestamp": "2026-04-16T14:16:58",
  "curve": [
    {"start_date": "2026-04-20", "maturity_date": "2031-04-20", "swap_rate": 3.5876},
    {"start_date": "2026-07-31", "maturity_date": "2031-07-31", "swap_rate": 3.5921},
    {"start_date": "2026-10-31", "maturity_date": "2031-10-31", "swap_rate": 3.5995},
    {"start_date": "2027-01-31", "maturity_date": "2032-01-31", "swap_rate": 3.6106},
    {"start_date": "2027-04-30", "maturity_date": "2032-04-30", "swap_rate": 3.6257},
    {"start_date": "2027-07-31", "maturity_date": "2032-07-31", "swap_rate": 3.6451},
    {"start_date": "2027-10-31", "maturity_date": "2032-10-31", "swap_rate": 3.6705},
    {"start_date": "2028-01-31", "maturity_date": "2033-01-31", "swap_rate": 3.7023},
    {"start_date": "2028-04-30", "maturity_date": "2033-04-30", "swap_rate": 3.7327}
  ]
}
```

| Field           | Description                                         |
| --------------- | --------------------------------------------------- |
| `curve`         | Array of forward-starting swap rate points          |
| `start_date`    | The forward start date for each swap                |
| `maturity_date` | The maturity date (start\_date + tenor)             |
| `swap_rate`     | The fair fixed rate for the swap as a percentage    |
| `tenor`         | The swap maturity length applied to each start date |
| `frequency`     | The spacing between forward start dates             |

The curve shows the 5Y SOFR swap rate rising from 3.59% (spot) to 3.73% for a swap starting in 2 years, reflecting the upward-sloping rate environment.

***

## Visualising the Curve

```python
import requests
import matplotlib.pyplot as plt
from datetime import datetime

url = "https://api.bluegamma.io/v1/forward_swap_curve"
headers = {"x-api-key": "your_api_key"}

data = requests.get(url, headers=headers, params={
    "index": "SOFR", "tenor": "5Y", "end_date": "2Y",
    "frequency": "3M", "fixed_leg_frequency": "12M"
}).json()

dates = [datetime.strptime(p["start_date"], "%Y-%m-%d") for p in data["curve"]]
rates = [p["swap_rate"] for p in data["curve"]]

plt.figure(figsize=(10, 5))
plt.plot(dates, rates, "o-")
plt.xlabel("Forward Start Date")
plt.ylabel("5Y Swap Rate (%)")
plt.title("5Y SOFR Forward Swap Curve")
plt.grid(True, alpha=0.3)
plt.tight_layout()
plt.show()
```

<figure><img src="/files/PewjzikjhLAUUgBM070c" alt="5Y SOFR forward swap curve showing rates rising from 3.59% to 3.73%"><figcaption><p>5Y SOFR forward swap curve - live API data, April 2026</p></figcaption></figure>

***

## Use Case: Comparing Tenors

Fetch forward swap curves for multiple tenors to see how the term structure evolves:

```python
import requests

url = "https://api.bluegamma.io/v1/forward_swap_curve"
headers = {"x-api-key": "your_api_key"}

for tenor in ["2Y", "5Y", "10Y"]:
    data = requests.get(url, headers=headers, params={
        "index": "SOFR",
        "tenor": tenor,
        "end_date": "2Y",
        "frequency": "6M",
        "fixed_leg_frequency": "12M"
    }).json()

    spot_rate = data["curve"][0]["swap_rate"]
    two_year_fwd = data["curve"][-1]["swap_rate"]
    print(f"{tenor}: Spot {spot_rate:.2f}% -> 2Y Forward {two_year_fwd:.2f}% ({two_year_fwd - spot_rate:+.0f}bps)")
```

***

## Parameters

| Parameter                | Required | Description                                                            |
| ------------------------ | -------- | ---------------------------------------------------------------------- |
| `index`                  | Yes      | Interest rate index (e.g., `SOFR`, `SONIA`, `6M EURIBOR`)              |
| `tenor`                  | Yes      | Swap maturity length (e.g., `5Y`, `10Y`). Applied from each start date |
| `end_date`               | Yes      | Last forward start date. Tenor like `2Y` or date like `2028-04-16`     |
| `frequency`              | Yes      | Spacing between start dates (e.g., `1M`, `3M`, `6M`, `1Y`)             |
| `fixed_leg_frequency`    | Yes      | Fixed leg payment frequency (e.g., `6M`, `12M`)                        |
| `start_date`             | No       | First forward start date. Defaults to spot if omitted                  |
| `floating_leg_frequency` | No       | Floating leg payment frequency                                         |
| `fixed_leg_day_count`    | No       | Day count convention for fixed leg (e.g., `Actual360`)                 |
| `floating_leg_day_count` | No       | Day count convention for floating leg                                  |
| `valuation_time`         | No       | Historical timestamp (ISO 8601) for reproducibility                    |
| `is_end_of_month`        | No       | Align dates to month-end (default: `true`)                             |

***

## Related Endpoints

| If you need...                          | Use                                                                                                                                                                    |
| --------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| A single forward-starting swap rate     | [`/swap_rate`](/documentation/integrations/api/how-to-guides/fetching-forward-starting-swap-rates.md)                                                                  |
| The full spot swap curve (all tenors)   | [`/get_swap_curve`](/documentation/integrations/api/how-to-guides/fetching-a-swap-curve.md)                                                                            |
| Forward interest rates (not swap rates) | [`/forward_curve`](/documentation/integrations/api/how-to-guides/getting-a-forward-curve.md)                                                                           |
| Historical swap rates over time         | [`/historical_swap_rates`](https://github.com/Blue-Gamma/BlueGammaUI/blob/development/bluegamma-docs/integrations/api/how-to-guides/fetching-historical-swap-rates.md) |

***

**Need an API key?** 📩 <support@bluegamma.io> | 📅 [Book a call](https://app.lemcal.com/@alivohra/website-demo?back=1)


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://bluegamma.io/documentation/integrations/api/how-to-guides/fetching-a-forward-swap-curve.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
