# Fetching FX Forward Curves

The `/fx_forward_curve` endpoint returns a full forward curve for a currency pair in a single request. Use this instead of making multiple `/fx_forward` calls when you need forward rates across many tenors.

***

## When to Use FX Forward Curves

| Use Case                     | Why a Full Curve?                                                 |
| ---------------------------- | ----------------------------------------------------------------- |
| **FX hedging analysis**      | Compare forward rates across tenors to choose optimal hedge dates |
| **Cash flow forecasting**    | Project future revenue or costs in foreign currencies             |
| **Forward premium analysis** | Visualise how the forward premium/discount evolves over time      |
| **Risk reporting**           | Feed a complete curve into VaR or exposure models                 |

***

## Basic Example (Standard Mode)

Standard mode returns forward rates at market-standard tenors (1W through 10Y):

```python
import requests

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

params = {
    "currency_pair": "EURUSD",
    "frequency": "standard"
}

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

print(f"Spot: {data['spot_rate']}")
for point in data["curve"]:
    print(f"{point['tenor']:>4s}  {point['forward_rate']:.4f}  ({point['forward_diff']:+.4f})")
```

```bash
curl -X GET "https://api.bluegamma.io/v1/fx_forward_curve?currency_pair=EURUSD&frequency=standard" \
  -H "x-api-key: your_api_key_here"
```

**Response (April 2026):**

```json
{
  "currency_pair": "EURUSD",
  "spot_rate": 1.17732,
  "valuation_time": "2026-04-16T14:17:37",
  "frequency": "standard",
  "curve": [
    {"tenor": "1W",  "date": "2026-04-23", "forward_rate": 1.177651, "forward_diff": 0.000331},
    {"tenor": "1M",  "date": "2026-05-16", "forward_rate": 1.178947, "forward_diff": 0.001627},
    {"tenor": "3M",  "date": "2026-07-15", "forward_rate": 1.182132, "forward_diff": 0.004812},
    {"tenor": "6M",  "date": "2026-10-13", "forward_rate": 1.186226, "forward_diff": 0.008906},
    {"tenor": "1Y",  "date": "2027-04-16", "forward_rate": 1.193153, "forward_diff": 0.015833},
    {"tenor": "2Y",  "date": "2028-04-15", "forward_rate": 1.205230, "forward_diff": 0.027910},
    {"tenor": "3Y",  "date": "2029-04-15", "forward_rate": 1.216651, "forward_diff": 0.039331},
    {"tenor": "5Y",  "date": "2031-04-15", "forward_rate": 1.240700, "forward_diff": 0.063380},
    {"tenor": "7Y",  "date": "2033-04-14", "forward_rate": 1.267598, "forward_diff": 0.090278},
    {"tenor": "10Y", "date": "2036-04-13", "forward_rate": 1.307298, "forward_diff": 0.129978}
  ]
}
```

| Field          | Description                               |
| -------------- | ----------------------------------------- |
| `spot_rate`    | Current spot FX rate                      |
| `curve`        | Array of forward rate points              |
| `forward_rate` | The outright forward rate at that tenor   |
| `forward_diff` | Forward points (forward rate minus spot)  |
| `tenor`        | Standard tenor label (standard mode only) |
| `date`         | The settlement date for the forward       |

{% hint style="info" %}
**Standard mode** returns all available market tenors for the pair (1W through 10Y). The response above is abbreviated for clarity.
{% endhint %}

***

## Custom Mode

Use custom mode to get forward rates at a regular interval between two dates:

```python
params = {
    "currency_pair": "GBPUSD",
    "frequency": "3M",
    "start_date": "2026-04-16",
    "end_date": "2028-04-16"
}

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

```bash
curl -X GET "https://api.bluegamma.io/v1/fx_forward_curve?currency_pair=GBPUSD&frequency=3M&start_date=2026-04-16&end_date=2028-04-16" \
  -H "x-api-key: your_api_key_here"
```

**Response (April 2026):**

```json
{
  "currency_pair": "GBPUSD",
  "spot_rate": 1.35434,
  "valuation_time": "2026-04-16T14:18:20",
  "start_date": "2026-04-16",
  "end_date": "2028-04-16",
  "frequency": "3M",
  "curve": [
    {"date": "2026-07-15", "forward_rate": 1.354014, "forward_diff": -0.000326},
    {"date": "2026-10-13", "forward_rate": 1.352889, "forward_diff": -0.001451},
    {"date": "2027-01-11", "forward_rate": 1.351261, "forward_diff": -0.003079},
    {"date": "2027-04-11", "forward_rate": 1.349620, "forward_diff": -0.004720},
    {"date": "2027-07-10", "forward_rate": 1.347853, "forward_diff": -0.006487},
    {"date": "2027-10-08", "forward_rate": 1.346066, "forward_diff": -0.008274},
    {"date": "2028-01-06", "forward_rate": 1.344278, "forward_diff": -0.010062},
    {"date": "2028-04-05", "forward_rate": 1.342490, "forward_diff": -0.011850}
  ]
}
```

GBPUSD trades at a forward discount (negative `forward_diff`) because GBP rates are lower than USD rates.

***

## Visualising the Curve

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

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

data = requests.get(url, headers=headers, params={
    "currency_pair": "EURUSD", "frequency": "standard"
}).json()

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

plt.figure(figsize=(10, 5))
plt.plot(dates, rates, "o-")
plt.axhline(y=data["spot_rate"], color="gray", linestyle="--", label=f"Spot ({data['spot_rate']:.4f})")
plt.xlabel("Date")
plt.ylabel("EURUSD Forward Rate")
plt.title("EURUSD Forward Curve")
plt.legend()
plt.grid(True, alpha=0.3)
plt.tight_layout()
plt.show()
```

<figure><img src="/files/dspMNskvtACHetaGHcH9" alt="EURUSD forward curve showing forward premium increasing over time"><figcaption><p>EURUSD forward curve - live API data, April 2026</p></figcaption></figure>

EURUSD trades at a forward premium (EUR rates lower than USD rates), with the premium widening from +3 pips at 1W to +1,300 pips at 10Y.

***

## Parameters

| Parameter       | Required | Description                                                                               |
| --------------- | -------- | ----------------------------------------------------------------------------------------- |
| `currency_pair` | Yes      | Currency pair in ISO format (e.g., `EURUSD`, `GBPUSD`, `USDJPY`)                          |
| `frequency`     | No       | `standard` (default) for market tenors, or interval like `1M`, `3M`, `6M` for custom mode |
| `start_date`    | No       | Start date for custom mode (YYYY-MM-DD). Ignored in standard mode                         |
| `end_date`      | No       | End date for custom mode (YYYY-MM-DD). Ignored in standard mode                           |

***

## Related Endpoints

| If you need...                     | Use                                                                                          |
| ---------------------------------- | -------------------------------------------------------------------------------------------- |
| A single forward rate for one date | [`/fx_forward`](/documentation/integrations/api/how-to-guides/fetching-fx-forward-rates.md)  |
| The spot rate only                 | [`/fx`](/documentation/integrations/api/api-reference.md)                                    |
| Interest rate forward curves       | [`/forward_curve`](/documentation/integrations/api/how-to-guides/getting-a-forward-curve.md) |

***

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


---

# Agent Instructions: 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:

```
GET https://bluegamma.io/documentation/integrations/api/how-to-guides/fetching-an-fx-forward-curve.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
