Guide · Peru economic indicators
Peru inflation API: how to get the CPI, annual and monthly inflation from BCRPData
How to get Peru's inflation from your code or an AI agent: what the Lima Metropolitan CPI measures, the latest published figure, inflation for every year since 2015, and how to receive the series as clean JSON with Better Llama's MCP tool, with no key.
Inflation in Peru: what it measures and the latest figure
Peru's official inflation is the change in the Lima Metropolitan consumer price index (CPI), compiled by the Instituto Nacional de Estadística e Informática (INEI). The Banco Central de Reserva del Perú (BCRP) publishes it on BCRPData, its statistics portal, together with the measures it uses for monetary policy. BCRPData allows reproduction citing the source (terms of use).
The latest figure on BCRPData when checked on December 1, 2026 is for October 2026:
- 12-month inflation: 5.25% (rose from 4.55% in September).
- Monthly inflation: 0.57%. Year-to-date inflation in 2026 (December 2025 to October): 4.88%.
- Excluding food and energy: 4.64% over 12 months. Core: 3.07%.
- 12-month inflation expectations (BCRP survey): 3.05%.
The BCRP runs an explicit inflation-targeting regime with a target range of 1% to 3% a year (BCRP Inflation Report, March 2026). 12-month inflation was above 3% for 8 straight months of 2026, from March to October, and the reference rate rose from 4.25% to 4.50% on November 13, 2026.
These are the last 12 published months (Lima Metropolitan CPI changes, in %):
| Month | 12-month | Monthly | Ex food and energy (12m) | Core (12m) |
|---|---|---|---|---|
| Oct 2026 | 5.25% | 0.57% | 4.64% | 3.07% |
| Sep 2026 | 4.55% | 0.12% | 4.51% | 2.85% |
| Aug 2026 | 4.44% | 0.07% | 4.50% | 2.72% |
| Jul 2026 | 4.07% | 0.29% | 4.57% | 2.58% |
| Jun 2026 | 4.01% | 0.23% | 4.46% | 2.53% |
| May 2026 | 3.91% | -0.16% | 4.44% | 2.55% |
| Apr 2026 | 4.01% | 0.52% | 4.41% | 2.37% |
| Mar 2026 | 3.80% | 2.38% | 3.65% | 2.25% |
| Feb 2026 | 2.21% | 0.69% | 2.20% | 2.13% |
| Jan 2026 | 1.70% | 0.10% | 2.02% | 2.19% |
| Dec 2025 | 1.51% | 0.24% | 1.83% | 2.12% |
| Nov 2025 | 1.37% | 0.11% | 1.77% | 2.12% |
Peru annual inflation by year
A year's inflation is the 12-month change in December. The same tool (series inflacion_12m since 2015) gives this table:
| Year | Annual inflation (December to December) |
|---|---|
| 2026 (year to date, October) | 4.88% |
| 2025 | 1.51% |
| 2024 | 1.97% |
| 2023 | 3.24% |
| 2022 | 8.46% |
| 2021 | 6.43% |
| 2020 | 1.97% |
| 2019 | 1.90% |
| 2018 | 2.19% |
| 2017 | 1.36% |
| 2016 | 3.23% |
| 2015 | 4.40% |
INEI publishes each month's CPI at the start of the following month and BCRPData adds it afterwards; the tool always returns what BCRPData has published at the time of the call.
Two ways to get inflation by API
1. The BCRPData API directly
BCRPData has a public API with no key, with the pattern /estadisticas/series/api/[codes]/[format]/[start]/[end]/[language]. For example, monthly and 12-month inflation for September and October 2026:
curl -s "https://estadisticas.bcrp.gob.pe/estadisticas/series/api/PN01271PM-PN01273PM/json/2026-9/2026-10/esp"Real response (December 1, 2026):
{
"config": {
"title": "Índice de precios Lima Metropolitana (var% mensual)",
"series": [
{
"name": "Índice de precios Lima Metropolitana (var% mensual) - IPC",
"dec": "2"
},
{
"name": "Índice de precios Lima Metropolitana (var% 12 meses) - IPC",
"dec": "2"
}
]
},
"periods": [
{
"name": "Sep.2026",
"values": [
"0.117298939892575",
"4.54865469481509"
]
},
{
"name": "Oct.2026",
"values": [
"0.571496537877728",
"5.25100548299322"
]
}
]
}The integration is up to you: values come as text, months come as Oct.2026 and months with no data show as n.d..
2. Better Llama's BCRP tool (over MCP)
Our tool Peru BCRP: exchange rate, inflation and series, peru_bcrp_series, queries BCRPData and returns a ready-to-use result:
- Easy aliases (
inflacion_12m,inflacion_mensual,ipc_indice…) or any BCRPData code, up to 10 series per call. - An ISO month (
2026-10) and a numeric value in each point, newest first, with a summary inlatest. n.d.months are skipped and reported inwarnings; every response carries the source attribution.
Use it as an MCP tool from Claude, Cursor or other agents, or over HTTP with JSON-RPC from any language.
Step by step: get Peru's inflation
Step 1. Choose the inflation measure
These are the inflation series in the peru_bcrp_series catalog (with operation set to catalogo and query set to inflación you get the list), plus the reference rate:
| Alias | BCRPData code | What it is |
|---|---|---|
inflacion_12m | PN01273PM | Lima Metropolitan CPI inflation, 12-month % change |
inflacion_mensual | PN01271PM | Lima Metropolitan CPI inflation, monthly % change |
inflacion_sin_alimentos_energia_12m | PN01277PM | CPI excluding food and energy, 12-month % change |
inflacion_subyacente_12m | PN01279PM | Core CPI, 12-month % change |
ipc_indice | PN38705PM | Lima Metropolitan consumer price index (Dec 2021 = 100) |
expectativa_inflacion_12m | PD12912AM | 12-month inflation expectations (BCRP survey) |
tasa_referencia | PD12301MD | Monetary policy reference rate (daily) |
Step 2. Connect the MCP server
Use the MCP https://mcp.betterllama.com/mcp in your client or call it over HTTP with JSON-RPC, as in the examples. This tool needs no key, and no account or sign-up is needed during the beta.
Step 3. Build your query
| Parameter | What it does |
|---|---|
series | List of aliases or BCRPData codes (up to 10) |
fromDate / toDate | From and to. For monthly series YYYY-MM or YYYY is enough |
maxItems | Maximum points per series (1 to 1000, default 30), the most recent ones |
For a long series, raise maxItems: the by-year table above uses fromDate set to 2015-01 and maxItems set to 200 (142 months).
Step 4. Call the tool with curl
A JSON-RPC POST returns the result as JSON. This call asks for 12-month and monthly inflation since August 2026:
curl -s https://mcp.betterllama.com/mcp \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{"jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": {"name": "peru_bcrp_series", "arguments": {"series": ["inflacion_12m", "inflacion_mensual"], "fromDate": "2026-08"}}}'Year-to-date and 12-month inflation in Python
The script fetches the index and the official inflation, recomputes the 12-month change from the index (it matches the BCRP figure), works out year-to-date inflation and counts the months above the target range:
import json
import requests
URL = "https://mcp.betterllama.com/mcp"
HEADERS = {"Accept": "application/json, text/event-stream"}
def bcrp(series, start):
"""Monthly BCRPData series through the peru_bcrp_series tool."""
body = {"jsonrpc": "2.0", "id": 1, "method": "tools/call",
"params": {"name": "peru_bcrp_series",
"arguments": {"series": series, "fromDate": start}}}
resp = requests.post(URL, json=body, headers=HEADERS, timeout=60)
resp.raise_for_status()
data = json.loads(resp.json()["result"]["content"][0]["text"])
return {s["alias"]: {p["date"]: p["value"] for p in s["points"]} for s in data["results"]}
d = bcrp(["ipc_indice", "inflacion_12m"], "2025-01")
cpi, official = d["ipc_indice"], d["inflacion_12m"]
last = max(cpi) # e.g. "2026-10"
year, month = last.split("-")
year_ago = f"{int(year) - 1}-{month}"
prev_dec = f"{int(year) - 1}-12"
twelve_months = (cpi[last] / cpi[year_ago] - 1) * 100
year_to_date = (cpi[last] / cpi[prev_dec] - 1) * 100
print("Latest Lima CPI:", last, "index", round(cpi[last], 2))
print("12-month inflation (computed):", round(twelve_months, 2), "%")
print("12-month inflation (BCRP): ", round(official[last], 2), "%")
print("Year-to-date inflation", year + ":", round(year_to_date, 2), "%")
above = [m for m, v in sorted(official.items()) if m.startswith(year) and v > 3]
print("Months of", year, "above the target range (3%):", len(above), above[0], "to", above[-1])Real output (December 1, 2026, 10:25 Chile time):
Latest Lima CPI: 2026-10 index 121.55
12-month inflation (computed): 5.25 %
12-month inflation (BCRP): 5.25 %
Year-to-date inflation 2026: 4.88 %
Months of 2026 above the target range (3%): 8 2026-03 to 2026-10From JavaScript or any other language, a POST with the same JSON-RPC body is enough (for example, with fetch).
Use the inflation API from an AI agent (MCP)
Add Better Llama's MCP server in your client (Claude, Cursor, VS Code or any other with remote MCP). One MCP brings peru_bcrp_series and the rest of the catalog, with no sign-up during the beta.
{
"mcpServers": {
"better-llama": {
"url": "https://mcp.betterllama.com/mcp"
}
}
}claude mcp add --transport http better-llama https://mcp.betterllama.com/mcpSetup for Claude, Codex, Gemini CLI, Windsurf, VS Code and other clients: connect your agent.
Ready-to-run Python and Node.js examples, with config files for each client: examples repository on GitHub.
Example scripts for this guide: python/bcrp_peru.py (Python), node/latam.mjs (Node.js).
Then ask, for example: "What is Peru's 12-month inflation according to the latest BCRP figure, is it within the target range and how does it compare with core inflation? Cite the source."
Beta: free and with no sign-up while we test the service.
Which fields it returns
Each series in results has code, alias, name, unit, frequency, requestedRange, latest, count, points (each with period as the BCRP publishes it, an ISO date and a numeric value) and sourceUrl. The response also includes warnings, attribution, source and retrievedAt.
Real, complete response to the curl call above (December 1, 2026, 10:25 Chile time); text fields come in Spanish, as the source publishes them:
{
"tool": "peru_bcrp_series",
"count": 2,
"results": [
{
"code": "PN01273PM",
"alias": "inflacion_12m",
"name": "Índice de precios Lima Metropolitana (var% 12 meses) - IPC",
"unit": "%",
"frequency": "mensual",
"requestedRange": {
"from": "2026-8",
"to": "2026-12"
},
"latest": {
"period": "Oct.2026",
"date": "2026-10",
"value": 5.25100548299322
},
"count": 3,
"points": [
{
"period": "Oct.2026",
"date": "2026-10",
"value": 5.25100548299322
},
{
"period": "Sep.2026",
"date": "2026-09",
"value": 4.54865469481509
},
{
"period": "Ago.2026",
"date": "2026-08",
"value": 4.43780929778608
}
],
"sourceUrl": "https://estadisticas.bcrp.gob.pe/estadisticas/series/api/PN01273PM/html/2026-8/2026-12/esp"
},
{
"code": "PN01271PM",
"alias": "inflacion_mensual",
"name": "Índice de precios Lima Metropolitana (var% mensual) - IPC",
"unit": "%",
"frequency": "mensual",
"requestedRange": {
"from": "2026-8",
"to": "2026-12"
},
"latest": {
"period": "Oct.2026",
"date": "2026-10",
"value": 0.571496537877728
},
"count": 3,
"points": [
{
"period": "Oct.2026",
"date": "2026-10",
"value": 0.571496537877728
},
{
"period": "Sep.2026",
"date": "2026-09",
"value": 0.117298939892575
},
{
"period": "Ago.2026",
"date": "2026-08",
"value": 0.0668060620400374
}
],
"sourceUrl": "https://estadisticas.bcrp.gob.pe/estadisticas/series/api/PN01271PM/html/2026-8/2026-12/esp"
}
],
"warnings": [],
"attribution": "Fuente: Banco Central de Reserva del Perú (BCRP), BCRPData — estadisticas.bcrp.gob.pe. Reproducción permitida citando la fuente (Condiciones de uso de BCRPData). En series de fuente externa (p. ej. IPC elaborado por el INEI) la responsabilidad del dato recae en la entidad que lo provee. Datos sin modificar salvo formato; no constituyen asesoramiento.",
"source": "https://estadisticas.bcrp.gob.pe/estadisticas/series/",
"retrievedAt": "2026-12-01T13:25:03.550Z"
}If you reuse the data, cite "Source: Banco Central de Reserva del Perú (BCRP), BCRPData"; the CPI is compiled by INEI.
Pricing
Free during the beta, no sign-up, with a limit of 60 requests per minute per IP. If paid plans come later, we will announce them on betterllama.com first. This tool needs no key.
Frequently asked questions
What is Peru's inflation rate?
According to the latest figure on BCRPData as of December 1, 2026, 12-month Lima Metropolitan CPI inflation was 5.25% in October 2026, with a monthly change of 0.57%. The peru_bcrp_series tool always returns the latest published month.
What was Peru's inflation in 2025?
1.51%: the 12-month change in the Lima Metropolitan CPI in December 2025. In 2024 it was 1.97% and in 2022, the highest year since 2015, 8.46%.
What is the BCRP inflation target range?
1% to 3% a year. The BCRP sets its reference rate to keep inflation and its expectations within that range; in October 2026 12-month inflation (5.25%) was above the range and 12-month expectations were 3.05%.
How do headline, core and ex food and energy inflation differ?
Headline covers all CPI prices. Ex food and energy leaves out those two groups, usually the most volatile, and core is another trend measure the BCRP publishes. In October 2026 they were 5.25%, 4.64% and 3.07% over 12 months.
How do I compute year-to-date inflation?
Divide the latest month's index by the previous December's and subtract 1: with ipc_indice, 121.55 in October 2026 and 115.89 in December 2025, that gives 4.88%. The Python script in this guide does it for you.
Do I need a key or token?
No. Neither the BCRPData API nor Better Llama's tool asks for a key. Better Llama's is free during the beta, with a limit of 60 requests per minute per IP.
Can I use the inflation API from Claude, Cursor or another AI agent?
Yes. Add Better Llama's MCP server (https://mcp.betterllama.com/mcp) in your client and the agent can use peru_bcrp_series to get inflation, the CPI or the reference rate in natural language.
Is Better Llama affiliated with the BCRP or INEI?
No. Better Llama is an independent project, not affiliated with, sponsored by or endorsed by the BCRP or INEI. The data source is BCRPData, reused citing the source under its terms of use.
Other guides
- Peru BCRP API: exchange rate, inflation and rates — BCRPData series with no key, curl and Python examples, and MCP usage.
- Peru exchange rate API: SUNAT and SBS USD/PEN rates — Daily SBS buy and sell rates, the SUNAT rate for a date and the interbank rate, no key, and MCP usage.
- Peru public procurement API (SEACE): tenders as JSON — OECE tenders with buyer, reference value, bidders and winning companies, no key, and MCP usage.
- Chile CPI API: monthly, 12-month and year-to-date inflation as JSON — the latest month's CPI, a month, a year or a range from the CMF; the index, 12-month and year-to-date change from the Central Bank BDE; how it drives the UF and the UTM, with curl, Python, JavaScript and MCP usage.
- Banxico API: Mexico's FIX exchange rate, UDIS and TIIE — Banco de México SIE indicators with no token to request, curl and Python examples, and MCP usage.
- Chile open data APIs: official sources by API and MCP — map of the official Chilean sources available by API and MCP, how to find the tool with search_tools, one real call per family and an index of every guide.
This guide is also available en español.