Inflation Rate API
Access UK Consumer Price Index (CPI) inflation data - monthly readings and historical trends from 1989
Overview
The Inflation Rate API provides access to the UK Consumer Price Index (CPI) annual inflation rate, sourced from the Office for National Statistics (ONS) via the Bank of England Statistical Interactive Database. CPI is the primary measure of inflation used by the Bank of England for its 2% inflation target.
This API provides:
- Current UK CPI annual inflation rate
- Complete monthly history back to 1989
- Each record represents a monthly CPI reading
- Daily automated updates from official BoE/ONS sources
What is CPI Inflation?
The Consumer Price Index (CPI) measures changes in the price level of a weighted average basket of consumer goods and services. The annual rate shows how much prices have changed compared to the same month in the previous year. The Bank of England targets a 2% CPI rate.
Key Features
- Official ONS / Bank of England data source
- Daily automated updates
- Historical data back to 1989
- Monthly granularity
- Sub-second response times
- 1-hour response caching
This API is ideal for:
- Financial applications and dashboards
- Economic analysis and forecasting tools
- Property investment platforms
- Salary and pension adjustment calculators
- Cost of living comparisons
Data Source Notice
All inflation data is sourced from the Bank of England Statistical Interactive Database (Series Code: D7G7), which publishes ONS Consumer Price Index annual rate data. Data is updated monthly when new CPI figures are released.
Authentication
All requests to the Inflation Rate API require authentication using an API key. You can obtain your API key from your PropertyInsights dashboard after subscribing to an API plan.
Include your API key in the request header as follows:
X-API-Key: your_api_key_here
Security Warning
Endpoints
Base URL
https://propertyinsights.co.uk/api/v1/
Get Inflation Rates
/inflation-rates
Get current and historical UK CPI inflation rate data. Returns the latest rate, metadata, and historical data with optional filtering.
Request Parameters
GET /inflation-rates
Query parameters for filtering inflation rate data.
| Parameter | Required | Type | Description |
|---|---|---|---|
| startDate | Optional | String | Start date for historical data (YYYY-MM-DD format) |
| endDate | Optional | String | End date for historical data (YYYY-MM-DD format) |
| limit | Optional | Integer | Maximum records to return (default: 100, max: 500) |
Billing details in the response
Successful chargeable JSON responses include a top-level billing object. The endpoint examples on this page focus on the endpoint-specific data, so this repeated block may not be shown in every example.
"billing": {
"mode": "prepaid",
"creditsCharged": 1,
"creditsRemaining": 1999,
"creditsRefreshAt": "2026-08-14T09:30:00.000Z"
}| Field or header | Meaning |
|---|---|
| billing.creditsCharged X-Credits-Charged | Credits charged by this call. Failed and non-chargeable calls return 0 in the header. |
| billing.creditsRemaining X-Credits-Remaining | The credit balance after the call. |
| billing.creditsRefreshAt X-Credits-Refresh-At | The next monthly credit refresh as an ISO 8601 timestamp. Trial and non-renewing balances return null and omit the header. |
All authenticated API-key calls expose the billing headers, including validation errors and zero-credit status or management requests. Only successful chargeable JSON responses add the billing object to the response body.
Response Format
All API responses are returned in JSON format. The response includes the current inflation rate and a list of monthly readings.
{
"success": true,
"current": {
"rate": 3.2,
"date": "2026-01-01",
"label": "CPI Annual Inflation Rate"
},
"rates": [
{ "date": "2026-01-01", "rate": 3.2 },
{ "date": "2025-12-01", "rate": 3.0 },
{ "date": "2025-11-01", "rate": 2.8 },
{ "date": "2025-10-01", "rate": 2.6 }
]
}Response Fields
| Field | Type | Description |
|---|---|---|
| current.rate | Number | Current CPI annual inflation rate as a percentage |
| current.date | String | Date of the current reading (YYYY-MM-DD) |
| rates | Array | Monthly inflation rate readings with date and rate |
Examples
Example 1: Get Current Inflation Rate
GET https://propertyinsights.co.uk/api/v1/inflation-rates?limit=1 X-API-Key: your_api_key_here
Returns the most recent CPI inflation reading
Example 2: Get Last 12 Months
GET https://propertyinsights.co.uk/api/v1/inflation-rates?limit=12 X-API-Key: your_api_key_here
Returns the 12 most recent monthly inflation readings
Example 3: Inflation in a Date Range
GET https://propertyinsights.co.uk/api/v1/inflation-rates?startDate=2020-01-01&endDate=2023-12-31 X-API-Key: your_api_key_here
Returns all monthly inflation readings between 2020 and 2023
Example 4: Full History
GET https://propertyinsights.co.uk/api/v1/inflation-rates?limit=500 X-API-Key: your_api_key_here
Returns up to 500 monthly readings (covers several decades of data)
Error Handling
The API uses standard HTTP response codes and returns detailed error information in JSON format. All errors follow a consistent structure to help you handle them appropriately in your application.
| HTTP Code | Error Code | Description |
|---|---|---|
| 400 | INVALID_DATE_FORMAT | Date must be in YYYY-MM-DD format |
| 400 | INVALID_LIMIT | Limit must be between 1 and 500 |
| 404 | NO_DATA_FOUND | No inflation rate data found for the specified date range |
| 401 | AUTHENTICATION_REQUIRED | Valid API key is required |
| 402 | INSUFFICIENT_CREDITS | Not enough API credits remaining to perform operation |
| 500 | DATABASE_ERROR | Error accessing database - please try again |
| 500 | INTERNAL_SERVER_ERROR | An unexpected error occurred |
Error Response Format
{
"success": false,
"error": {
"code": "NO_DATA_FOUND",
"message": "No inflation rate data found for the specified date range"
}
}Need Help?
If you need assistance with implementation or have questions about the Inflation Rate API, our support team is here to help.