Learn how to use our exchange rate API
Returns the latest exchange rates for all institutions, including BCCR and Monex rates.
{
"timestamp": 1700000000,
"rates": [
{
"entidad": "Banco Nacional",
"compra": 520.50,
"venta": 525.00,
"actualizacion": "2024-01-15",
"institution_id": 1
}
],
"bccr_rate": {
"compra": 520.00,
"venta": 525.00,
"fecha": "2024-01-15"
},
"monex_rate": {
"promedio": 522.50,
"fecha": "2024-01-15"
}
}
Returns historical exchange rate data.
| Parameter | Type | Required | Description |
|---|---|---|---|
| institution_id | integer | No | Filter by institution ID. If omitted, returns all institutions. |
| limit | integer | No | Maximum number of records to return (default: 100) |
{
"history": [
{
"fecha": "2024-01-15",
"compra": 520.50,
"venta": 525.00,
"institution": {
"id": 1,
"name": "Banco Nacional"
}
}
]
}
Returns historical exchange rate data for a specific institution.
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | integer | Yes | Institution ID |
| Parameter | Type | Required | Description |
|---|---|---|---|
| limit | integer | No | Maximum number of records to return (default: 100) |
{
"institution": {
"id": 1,
"name": "Banco Nacional",
"logo_url": "https://example.com/logo.png",
"website_url": "https://www.bncr.fi.cr"
},
"history": [
{
"fecha": "2024-01-15",
"compra": 520.50,
"venta": 525.00
}
]
}
Returns exchange rates formatted for Chrome extension use.
{
"timestamp": 1700000000,
"rates": [
{
"entidad": "Banco Nacional",
"compra": 520.50,
"venta": 525.00,
"actualizacion": "2024-01-15"
}
],
"bccr_rate": {
"compra": 520.00,
"venta": 525.00,
"fecha": "2024-01-15"
},
"monex_rate": {
"promedio": 522.50,
"fecha": "2024-01-15"
}
}
All API endpoints are protected by rate limiting to ensure fair usage and system stability. Rate limits are applied per IP address.
| Endpoint | Limit | Window |
|---|---|---|
| GET /api/rates | 100 requests | 1 minute |
| GET /api/rates/history | 100 requests | 1 minute |
| GET /api/rates/institution/{id} | 100 requests | 1 minute |
| GET /api/extension/rates | 100 requests | 1 minute |
When the rate limit is exceeded, the API will return a 429 Too Many Requests status code with the following response:
{
"error": "Too many requests. Please try again later."
}
The response will also include a Retry-After header indicating the number of seconds to wait before making another request.