# Central Bank of Peru FX & Data API
> Live official data for the Peruvian sol (PEN) and the full statistics database of the Central Reserve Bank of Peru (Banco Central de Reserva del Perú, BCRP) — straight from its public series API as clean JSON. Get the latest official interbank USD/PEN exchange rate (buy, sell and mid); pull the daily interbank USD/PEN rate over any date range; convert between USD and PEN at the BCRP's interbank mid rate; or fetch any BCRP statistical series by its code — exchange rates, international reserves, interest rates, inflation, monetary aggregates and thousands more — over a date range, for direct access to the central bank's whole time-series database (join up to 10 codes at once). Read live from the BCRP, nothing cached. This is the official Peruvian-sol rate plus Peru's central-bank statistics — distinct from the ECB, BCRA, BCB and other central-bank feeds and from market mid-rates: the BCRP's own published sol rate and economic series.

## Authentication
All requests require your oanor API key in the `x-oanor-key` header. Get one at https://www.oanor.com/developer/keys.

```bash
curl -H "x-oanor-key: oanor_live_…" "https://api.oanor.com/bcrp-api/..."
```

## Pricing
- **Free** (Free) — 600 calls/Mo, 2 req/s
- **Starter** ($8/Mo) — 26,000 calls/Mo, 8 req/s
- **Pro** ($24/Mo) — 135,000 calls/Mo, 20 req/s
- **Business** ($57/Mo) — 680,000 calls/Mo, 42 req/s

## Endpoints

### USD

#### `GET /v1/usd` — Latest official interbank USD/PEN rate (buy, sell, mid)

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/bcrp-api/v1/usd"
```

**Response:**
```json
{
    "data": {
        "buy": 3.4731,
        "mid": 3.4787,
        "base": "USD",
        "date": "2026-06-08",
        "pair": "USD/PEN",
        "sell": 3.4842,
        "quote": "PEN",
        "source": "Banco Central de Reserva del Perú"
    },
    "meta": {
        "timestamp": "2026-06-10T13:59:14.398Z",
        "request_id": "ae9f75b8-bb51-4337-933d-e193c7c7a373"
    },
    "status": "ok",
    "message": "USD/PEN rate retrieved successfully",
    "success": true
}
```

### History

#### `GET /v1/history` — Daily interbank USD/PEN rate over a date range

**Parameters:**
- `from` (query, optional, string) — Start date YYYY-MM-DD Example: `2026-06-01`
- `to` (query, optional, string) — End date YYYY-MM-DD Example: `2026-06-08`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/bcrp-api/v1/history?from=2026-06-01&to=2026-06-08"
```

**Response:**
```json
{
    "data": {
        "to": "2026-06-08",
        "from": "2026-06-01",
        "pair": "USD/PEN",
        "count": 6,
        "source": "Banco Central de Reserva del Perú",
        "history": [
            {
                "buy": 3.4166,
                "mid": 3.4177,
                "date": "2026-06-01",
                "sell": 3.4188
            },
            {
                "buy": 3.4081,
                "mid": 3.4091,
                "date": "2026-06-02",
                "sell": 3.4101
            },
            {
                "buy": 3.4179,
                "mid": 3.4188,
                "date": "2026-06-03",
                "sell": 3.4198
            },
            {
                "buy": 3.4127,
                "mid": 3.4137,
                "date": "2026-06-04",
                "sell": 3.4147
            },
            {
                "buy": 3.4509,
                "mid": 3.4529,
                "date": "2026-06-05",
                "sell": 3.4549
            },
            {
                "buy": 3.4731,
                "mid": 3.4787,
                "date": "2026-06-08",
                "sell": 3.4842
            }
        ]
    },
    "meta": {
        "timestamp": "2026-06-10T13:59:16.349Z",
        "request_id": "b64cd908-2db3-4e21-837d-ed1a5eeeeee5"
    },
    "status": "ok",
    "message": "History retrieved successfully",
    "success": true
}
```

### Convert

#### `GET /v1/convert` — Convert between USD and PEN at the interbank mid rate

**Parameters:**
- `from` (query, required, string) — Source currency (USD or PEN) Example: `USD`
- `to` (query, required, string) — Target currency (USD or PEN) Example: `PEN`
- `amount` (query, optional, string) — Amount to convert Example: `100`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/bcrp-api/v1/convert?from=USD&to=PEN&amount=100"
```

**Response:**
```json
{
    "data": {
        "to": "PEN",
        "date": "2026-06-08",
        "from": "USD",
        "rate": 3.4787,
        "amount": 100,
        "result": 347.87,
        "source": "Banco Central de Reserva del Perú",
        "usd_pen_mid": 3.4787
    },
    "meta": {
        "timestamp": "2026-06-10T13:59:18.279Z",
        "request_id": "14858d97-edb9-42a1-a9cd-cd00988f4645"
    },
    "status": "ok",
    "message": "Conversion completed successfully",
    "success": true
}
```

### Series

#### `GET /v1/series` — Any BCRP statistical series by code over a date range

**Parameters:**
- `code` (query, required, string) — BCRP series code (join up to 10 with hyphens) Example: `PD04637PD`
- `from` (query, optional, string) — Start date YYYY-MM-DD Example: `2026-01-01`
- `to` (query, optional, string) — End date YYYY-MM-DD Example: `2026-06-08`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/bcrp-api/v1/series?code=PD04637PD&from=2026-01-01&to=2026-06-08"
```

**Response:**
```json
{
    "data": {
        "to": "2026-06-08",
        "from": "2026-01-01",
        "codes": [
            "PD04637PD"
        ],
        "count": 108,
        "source": "Banco Central de Reserva del Perú",
        "observations": [
            {
                "date": "2026-01-05",
                "values": [
                    3.36257142857143
                ]
            },
            {
                "date": "2026-01-06",
                "values": [
                    3.35914285714286
                ]
            },
            {
                "date": "2026-01-07",
                "values": [
                    3.36142857142857
                ]
            },
            {
                "date": "2026-01-08",
                "values": [
                    3.36228571428571
                ]
            },
            {
                "date": "2026-01-09",
                "values": [
                    3.36028571428571
                ]
            },
            {
                "date": "2026-01-12",
                "values": [
                    3.35957142857143
                ]
            },
            {
                "date": "2026-01-13",
                "values": [
                    3.35742857142857
                ]
            },
            {
                "date": "2026-01-14",
                "values": [
                    3.35842857142857
                ]
            },
            {
                "date": "2026-01-15",
                
…(truncated, see openapi.json for full schema)
```

### Meta

#### `GET /v1/meta` — Service metadata

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/bcrp-api/v1/meta"
```

**Response:**
```json
{
    "data": {
        "date": "2026-06-08",
        "source": "BCRP series API (estadisticas.bcrp.gob.pe, live)",
        "service": "bcrp-api",
        "endpoints": {
            "GET /v1/usd": "Latest official interbank USD/PEN rate (buy, sell, mid).",
            "GET /v1/meta": "This document.",
            "GET /v1/series": "Any BCRP statistical series by code over a range (code=PD04637PD, from=2026-01-01, to=2026-06-09; join up to 10 codes with hyphens).",
            "GET /v1/convert": "Convert between USD and PEN at the interbank mid rate (from=USD, to=PEN, amount=100).",
            "GET /v1/history": "Daily interbank USD/PEN rate over a date range (from=2026-06-01, to=2026-06-09)."
        },
        "description": "Live official data for the Peruvian sol (PEN) and the full BCRP statistics database from the Central Reserve Bank of Peru (Banco Central de Reserva del Perú, BCRP), via its public series API. The usd endpoint returns the latest official interbank USD/PEN rate (buy, sell, mid); the history endpoint returns the daily interbank USD/PEN rate over a date range; the convert endpoint converts between USD and PEN at the interbank mid rate; the series endpoint fetches any BCRP statistical series by code (exchange rates, international reserves, interest rates, inflation, monetary aggregates and thousands more) over a date range. Live, no key, nothing stored. Distinct from the ECB, BCRA, BCB and other central-bank feeds and from market mid-rates — this is the 
…(truncated, see openapi.json for full schema)
```


---
Marketplace page: https://www.oanor.com/api/bcrp-api
OpenAPI spec: https://www.oanor.com/api/bcrp-api/openapi.json
