> 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/fetching-an-inflation-curve.md).

# Fetching Inflation Curves

Fetch zero-coupon inflation curves for UK RPI, UK CPI and EU HICP for inflation-linked bond analysis, real rate calculations, and inflation hedging.

The `/inflation_curve` endpoint returns zero-coupon inflation rates for tenors from 1Y to 50Y, derived from inflation swap market data. Use this when you need to **price inflation-linked instruments**, calculate **real rates**, or analyse **breakeven inflation**.

***

## When to Use Inflation Curves

| Use Case                           | Why Inflation Curves?                                        |
| ---------------------------------- | ------------------------------------------------------------ |
| **Real rate calculation**          | Subtract inflation from nominal swap rates to get real rates |
| **Inflation-linked bond analysis** | Price or value index-linked gilts and linkers                |
| **Breakeven inflation**            | Compare implied inflation expectations across tenors         |
| **Inflation hedging**              | Size and value inflation swap positions                      |

***

## Basic Example

```python
import requests

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

params = {
    "index": "UK RPI"
}

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

for point in data["rates"]:
    print(f"{point['tenor']}: {point['zc_rate']:.2f}%")
```

```bash
curl -X GET "https://api.bluegamma.io/v1/inflation_curve?index=UK%20RPI" \
  -H "x-api-key: your_api_key_here"
```

**Response:**

```json
{
  "index": "UK RPI",
  "discount_index": "SONIA",
  "rates": [
    {"tenor": "1Y", "zc_rate": 4.96},
    {"tenor": "2Y", "zc_rate": 4.32},
    {"tenor": "3Y", "zc_rate": 4.12},
    {"tenor": "5Y", "zc_rate": 3.76},
    {"tenor": "10Y", "zc_rate": 3.44},
    {"tenor": "20Y", "zc_rate": 3.35},
    {"tenor": "30Y", "zc_rate": 3.31},
    {"tenor": "50Y", "zc_rate": 3.36}
  ],
  "timestamp": "2026-04-16"
}
```

| Field            | Description                                         |
| ---------------- | --------------------------------------------------- |
| `rates`          | Array of zero-coupon inflation rate points by tenor |
| `zc_rate`        | The zero-coupon inflation rate as a percentage      |
| `tenor`          | The maturity point on the curve (1Y to 50Y)         |
| `discount_index` | The nominal rate index used for discounting         |
| `timestamp`      | When the underlying market data was captured        |

{% hint style="info" %}
**Full curve:** The API returns rates for every year from 1Y to 50Y. The response above is abbreviated for clarity.
{% endhint %}

***

## Use Case: Calculating Real Rates

Subtract the implied inflation rate from nominal swap rates to get the real rate at each tenor:

```python
import requests

headers = {"x-api-key": "your_api_key"}

# Fetch the nominal SONIA swap curve
swap_response = requests.get(
    "https://api.bluegamma.io/v1/get_swap_curve",
    headers=headers,
    params={"index": "SONIA"}
)
swap_curve = {p["tenor"]: p["swap_rate"] for p in swap_response.json()["swap_rates"]}

# Fetch the UK RPI inflation curve
inflation_response = requests.get(
    "https://api.bluegamma.io/v1/inflation_curve",
    headers=headers,
    params={"index": "UK RPI"}
)
inflation_curve = {p["tenor"]: p["zc_rate"] for p in inflation_response.json()["rates"]}

# Calculate real rates for common tenors
for tenor in ["2Y", "5Y", "10Y", "20Y", "30Y"]:
    if tenor in swap_curve and tenor in inflation_curve:
        real_rate = swap_curve[tenor] - inflation_curve[tenor]
        print(f"{tenor}: Nominal {swap_curve[tenor]:.2f}% - Inflation {inflation_curve[tenor]:.2f}% = Real {real_rate:.2f}%")
```

***

## Use Case: Comparing UK and Eurozone Inflation

```python
import requests

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

uk_rpi = requests.get(url, headers=headers, params={"index": "UK RPI"}).json()
eu_hicp = requests.get(url, headers=headers, params={"index": "EU HICP"}).json()

uk_rates = {p["tenor"]: p["zc_rate"] for p in uk_rpi["rates"]}
eu_rates = {p["tenor"]: p["zc_rate"] for p in eu_hicp["rates"]}

for tenor in ["1Y", "2Y", "5Y", "10Y", "30Y"]:
    spread_bps = (uk_rates[tenor] - eu_rates[tenor]) * 100
    print(f"{tenor}: UK RPI {uk_rates[tenor]:.2f}% | EU HICP {eu_rates[tenor]:.2f}% | Spread {spread_bps:+.0f}bps")
```

**Output (April 2026):**

```
1Y: UK RPI 4.96% | EU HICP 3.20% | Spread +176bps
2Y: UK RPI 4.32% | EU HICP 2.68% | Spread +164bps
5Y: UK RPI 3.76% | EU HICP 2.28% | Spread +148bps
10Y: UK RPI 3.44% | EU HICP 2.22% | Spread +121bps
30Y: UK RPI 3.31% | EU HICP 2.35% | Spread +96bps
```

***

## Parameters

| Parameter        | Required | Description                                         |
| ---------------- | -------- | --------------------------------------------------- |
| `index`          | Yes      | Inflation index: `UK RPI`, `UK CPI`, or `EU HICP`   |
| `valuation_time` | No       | Historical timestamp (ISO 8601) for reproducibility |

***

## Supported Indices

| Index     | Region         | Discount Index | Description                                                                                                                          |
| --------- | -------------- | -------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| `UK RPI`  | United Kingdom | SONIA          | Retail Prices Index                                                                                                                  |
| `UK CPI`  | United Kingdom | SONIA          | Consumer Prices Index, derived from RPI minus a market-implied wedge ([methodology](/documentation/methodology/inflation-curves.md)) |
| `EU HICP` | Eurozone       | 6M EURIBOR     | Harmonised Index of Consumer Prices                                                                                                  |

***

## Reproducibility with `valuation_time`

Lock in the inflation curve at a specific point in time:

```python
params = {
    "index": "UK RPI",
    "valuation_time": "2026-03-31T16:00:00Z"
}

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

```bash
curl -X GET "https://api.bluegamma.io/v1/inflation_curve?index=UK%20RPI&valuation_time=2026-03-31T16%3A00%3A00Z" \
  -H "x-api-key: your_api_key_here"
```

***

## Related Endpoints

| If you need...             | Use                                                                                               |
| -------------------------- | ------------------------------------------------------------------------------------------------- |
| Nominal swap rates         | [`/get_swap_curve`](/documentation/integrations/api/how-to-guides/fetching-a-swap-curve.md)       |
| Government bond yields     | [`/gov_yield`](/documentation/integrations/api/how-to-guides/fetching-a-government-bond-curve.md) |
| Forward rates              | [`/forward_curve`](/documentation/integrations/api/how-to-guides/getting-a-forward-curve.md)      |
| Zero rates for discounting | [`/zero_rate`](/documentation/integrations/api/how-to-guides/fetching-zero-rates.md)              |

***

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/fetching-an-inflation-curve.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.
