Guide · Peru economic indicators
BCRP API: how to get Peru's exchange rate, inflation and central bank series
How to get BCRPData from your code or an AI agent: what Peru's central bank publishes, how to use its API directly, and how to receive the dollar exchange rate, the policy rate, inflation or any series as clean JSON with Better Llama's MCP tool, with no key.
What is BCRPData and which series does it publish?
BCRPData is the statistics portal of the Central Reserve Bank of Peru (Banco Central de Reserva del Perú, BCRP). It publishes thousands of daily, monthly, quarterly and annual series, each with its own code (for example, PD04638PD for the interbank sell exchange rate).
The most requested include the dollar exchange rate (interbank and banking system SBS), the euro exchange rate, the monetary policy reference rate, Metropolitan Lima CPI inflation, inflation expectations, GDP, net international reserves and exports.
Under its terms of use, BCRPData information may be reproduced in whole or in part without express authorization, as long as the source is cited. For series produced by other agencies, such as the INEI's CPI, that agency is responsible for the data.
Two ways to access the BCRP API
1. The BCRPData API
BCRPData has a public API with no key. The URL follows the pattern /estadisticas/series/api/[codes]/[format]/[start]/[end]/[language]: one or more codes separated by hyphens, the format (for example json), the date range and the language. For example, the interbank buy and sell exchange rate between November 16 and 20, 2026:
curl -s "https://estadisticas.bcrp.gob.pe/estadisticas/series/api/PD04637PD-PD04638PD/json/2026-11-16/2026-11-20/esp"The integration is on your side: knowing each series code, adapting dates to its frequency (day, month, quarter or year), converting periods such as 18.Nov.26 or Oct.2026 into dates, turning values that arrive as text into numbers, and skipping days with no data, shown as n.d..
2. Better Llama's BCRP tool (over MCP)
Our Central Reserve Bank of Peru (BCRP) series tool, peru_bcrp_series, queries that same API and returns the result ready to use:
- Readable aliases for popular series (
tc_interbancario_venta,tasa_referencia,inflacion_12m…) plus any BCRPData code. - Up to 10 series per call, with
YYYY-MM-DD,YYYY-MMorYYYYdates that adapt to each series' frequency. - JSON with ISO dates and numeric values, newest first, and each series' latest data point in
latest. - Days with no published data are skipped and reported in
warnings. - Every response includes the source attribution and a link to the series on BCRPData.
Use it as an MCP tool from Claude, Cursor or other agents, or over HTTP with JSON-RPC from any language.
Step by step: query BCRP series
Step 1. Choose the series
Use a catalogue alias or a BCRPData code. These are some of the catalogue series; with operation set to catalogo you get the full list, which you can also filter by text with query (for example, tipo de cambio).
| Alias | BCRP code | Series |
|---|---|---|
tc_interbancario_venta | PD04638PD | Interbank exchange rate, sell (daily, S/ per US$) |
tc_interbancario_compra | PD04637PD | Interbank exchange rate, buy (daily) |
tc_sbs_venta | PD04640PD | Banking system (SBS) exchange rate, sell (daily) |
tc_euro_venta | PD04648PD | Euro exchange rate, sell (daily, S/ per euro) |
tasa_referencia | PD12301MD | Monetary policy reference rate (daily, %) |
inflacion_12m | PN01273PM | CPI inflation, Metropolitan Lima, 12-month change (monthly, %) |
inflacion_subyacente_12m | PN01279PM | Core CPI, 12-month change (monthly, %) |
pbi_var_interanual | PN01728AM | GDP, year-on-year change (monthly, %) |
reservas_internacionales | PD04650MD | Net international reserves (daily, US$ million) |
exportaciones | PN38714BM | FOB exports (monthly, US$ million) |
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 required during the beta.
Step 3. Build your query
| Parameter | What it does |
|---|---|
operation | series (default) to get values or catalogo to list popular series |
series | Up to 10 aliases or BCRPData codes, for example tc_interbancario_venta or PD04638PD |
fromDate / toDate | From and to, as YYYY-MM-DD, YYYY-MM or YYYY; by default the last 45 days for daily series and 24 months for monthly ones |
maxItems | Maximum data points per series (1 to 1000, default 30) |
query | Only with catalogo: filter by text, for example inflación or reservas |
Data comes newest first. If a series has more data points than maxItems, the response says so in warnings.
Step 4. Call the tool with curl
A JSON-RPC POST returns the result as JSON. This call asks for the last 3 data points of the interbank and banking system (SBS) sell exchange rates:
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": ["tc_interbancario_venta", "tc_sbs_venta"], "maxItems": 3}}}'The same in Python
Latest exchange rate, policy rate and 12-month inflation in a single call:
import json
import requests
URL = "https://mcp.betterllama.com/mcp"
HEADERS = {"Accept": "application/json, text/event-stream"}
arguments = {
"series": ["tc_interbancario_venta", "tasa_referencia", "inflacion_12m"],
"maxItems": 5
}
body = {"jsonrpc": "2.0", "id": 1, "method": "tools/call",
"params": {"name": "peru_bcrp_series", "arguments": arguments}}
resp = requests.post(URL, json=body, headers=HEADERS, timeout=60)
resp.raise_for_status()
data = json.loads(resp.json()["result"]["content"][0]["text"])
for serie in data["results"]:
ultimo = serie["latest"]
print(serie["alias"], ultimo["date"], ultimo["value"], serie["unit"])Real output (November 20, 2026, 16:24 Chile time):
tc_interbancario_venta 2026-11-18 3.43214285714286 S/ por US$
tasa_referencia 2026-11-20 4.5 %
inflacion_12m 2026-10 5.25100548299322 %From JavaScript or any other language, a POST with the same JSON-RPC body is enough (for example, with fetch).
Use the BCRP API from an AI agent (MCP)
Add the Better Llama MCP server in your client (Claude, Cursor, VS Code or any client with remote MCP). One MCP brings peru_bcrp_series and the rest of the catalogue, 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.
Then ask, for example: “What was Peru's interbank dollar rate this week, and how does it compare with 12-month inflation? Cite the source.”
Beta: free and with no sign-up while we test the service.
Which fields it returns
Each series includes code, alias, name, unit, frequency, requestedRange, latest (latest data point), count, points (each with period as published by the BCRP, date in ISO format and a numeric value) and sourceUrl, the link to the series on BCRPData. The response also includes attribution and retrievedAt.
Real response to the curl call above (November 20, 2026, 16:22 Chile time), without the warnings and source fields. The latest data point is from November 18 because the BCRP had not yet published the following days (n.d.), which are skipped:
{
"tool": "peru_bcrp_series",
"count": 2,
"results": [
{
"code": "PD04638PD",
"alias": "tc_interbancario_venta",
"name": "Tipo de cambio - TC Interbancario (S/ por US$) - Venta",
"unit": "S/ por US$",
"frequency": "diaria",
"requestedRange": {
"from": "2026-10-06",
"to": "2026-11-20"
},
"latest": {
"period": "18.Nov.26",
"date": "2026-11-18",
"value": 3.43214285714286
},
"count": 3,
"points": [
{
"period": "18.Nov.26",
"date": "2026-11-18",
"value": 3.43214285714286
},
{
"period": "17.Nov.26",
"date": "2026-11-17",
"value": 3.41171428571429
},
{
"period": "16.Nov.26",
"date": "2026-11-16",
"value": 3.41357142857143
}
],
"sourceUrl": "https://estadisticas.bcrp.gob.pe/estadisticas/series/api/PD04638PD/html/2026-10-06/2026-11-20/esp"
},
{
"code": "PD04640PD",
"alias": "tc_sbs_venta",
"name": "Tipo de cambio - TC Sistema bancario SBS (S/ por US$) - Venta",
"unit": "S/ por US$",
"frequency": "diaria",
"requestedRange": {
"from": "2026-10-06",
"to": "2026-11-20"
},
"latest": {
"period": "18.Nov.26",
"date": "2026-11-18",
"value": 3.433
},
"count": 3,
"points": [
{
"period": "18.Nov.26",
"date": "2026-11-18",
"value": 3.433
},
{
"period": "17.Nov.26",
"date": "2026-11-17",
"value": 3.415
},
{
"period": "16.Nov.26",
"date": "2026-11-16",
"value": 3.419
}
],
"sourceUrl": "https://estadisticas.bcrp.gob.pe/estadisticas/series/api/PD04640PD/html/2026-10-06/2026-11-20/esp"
}
],
"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.",
"retrievedAt": "2026-11-20T19:22:56.947Z"
}If you reuse the data, cite “Source: Banco Central de Reserva del Perú (BCRP), BCRPData”, as its terms of use require.
Pricing
Free during the beta, with no sign-up and 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
Does the BCRP have an API?
Yes. BCRPData, the statistics portal of the Central Reserve Bank of Peru, has a public API with no key that returns series as JSON, XML, CSV and other formats from their code and a date range. Better Llama's peru_bcrp_series tool queries that API and returns JSON with ISO dates and numeric values over MCP.
How do I get Peru's dollar exchange rate by API?
Ask peru_bcrp_series for the series tc_interbancario_venta (code PD04638PD) or tc_sbs_venta (PD04640PD). The interbank rate is published on business days; latest holds the most recent data point. For the monthly average, use tc_interbancario_venta_mensual (PN01206PM).
Do I need a key or token for the BCRP API?
No. Neither the BCRPData API nor Better Llama's tool requires a key. Better Llama's tool is free during the beta, with a limit of 60 requests per minute per IP.
How do I find a series code?
Call peru_bcrp_series with operation set to catalogo to see popular series with their alias and code, filtering with query if you like. For other series, look the series up on BCRPData: the code appears on its page (for example, PN01273PM for 12-month inflation) and you can use it directly in series.
How up to date is the data?
It is what the BCRP publishes at query time, with up to 30 minutes of caching. Daily series are published on business days, and days with no data (n.d.) are skipped and reported in warnings; monthly series, such as inflation, appear when the BCRP publishes them.
Can I reuse BCRP data?
BCRPData's terms of use allow reproducing the information in whole or in part without express authorization, as long as the source is cited. Every response includes an attribution field with the citation. For series from external sources, such as the INEI's CPI, that agency is responsible for the data.
Can I use the BCRP API from Claude, Cursor or another AI agent?
Yes. Add the Better Llama MCP server (https://mcp.betterllama.com/mcp) in your client and the agent can use peru_bcrp_series to get the exchange rate, inflation or any BCRP series in natural language.
Is Better Llama affiliated with the BCRP?
No. Better Llama is an independent project, not affiliated with, sponsored by or endorsed by the Central Reserve Bank of Peru. The data source is BCRPData, reproduced under its terms of use citing the source.
Other guides
- 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.
- Chile economic indicators API: UF, dollar, euro, CPI and TPM — One real call per indicator (UF, dollar, euro, UTM, CPI, TMC, TIP, TPM, Imacec, GDP, unemployment and real exchange rate), from the CMF or the Central Bank, with curl, Python, JavaScript and MCP.
- Colombia SECOP II API: public procurement contracts and processes — Open data from datos.gov.co with no key, curl and Python examples, and MCP usage.
- Chile public procurement API: Mercado Público tenders and purchase orders — ChileCompra ticket, curl and Python examples, and MCP usage.
- Chile fuel prices API: gasoline 93, 95, 97, diesel and LPG from Bencina en Línea — CNE data with no sign-up, the cheapest by comuna or near a point, curl, Python and JavaScript examples, and MCP usage.
- Chilexpress API: coverage by comuna, shipping quotes and tracking — covered comunas and sectors with their code and no key, names that differ from the official ones, quotes and tracking with your free keys, and MCP usage.
- Chile earthquakes API: latest quake, magnitude, depth and alerts — Public-domain USGS data with Chile local time, no USGS key, curl and Python examples, and MCP usage.
- Colombia TRM API: today's TRM and the COP/USD rate — Superintendencia Financiera data via datos.gov.co with no key, curl and Python examples, and MCP usage.
- Chile public holidays API: 2026 holidays, business days and RUT — National, regional and local holidays with no key, curl and Python examples, and MCP usage.
- Chile Official Gazette API: laws, decrees and new companies — Laws, decrees, notices and company incorporations with CVE and official PDF, no key, curl and Python examples, 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 electricity market API: marginal cost, generation and demand — Coordinador Eléctrico Nacional grid data with no user_key to request, curl and Python examples, and MCP usage.
- Chile CMF API: UF value, dollar, UTM and maximum conventional rate — the seven API CMF Bancos series with no API key to request, curl and Python examples, and MCP usage.
- Chile USD/CLP exchange rate API: the observed dollar as JSON — today's rate, daily series by month, range or year and the warning for values published in advance, with CMF data, curl, Python and JavaScript examples, and MCP usage.
- Chile UF API: the Unidad de Fomento value as JSON — today's UF, full month, next month's days already published, range or year, with CMF data and a Central Bank cross-check, curl, Python and JavaScript examples, and MCP usage.
- Central Bank of Chile API: BDE series as JSON — dollar, UF, policy rate, CPI, Imacec, GDP, unemployment and any series by code, series search, curl, Python and JavaScript examples, and MCP usage.
- Chile RUT validation API: check digit as JSON — the modulo 11 algorithm, accepted formats, computing the check digit, batches and privacy, curl, Python and JavaScript examples, and MCP usage.
- Chile communes API: regions, provinces and CUT codes — all 346 communes with CUT codes, region filters, name search, curl, Python and JavaScript examples, and MCP usage.
- Chile business days API: deadlines and business-day counts — business-day deadlines from a notice date, Saturdays as business days, calendar days, business days per month, regional holidays and edge cases, with curl, Python and JavaScript, and MCP usage.
This guide is also available en español.