Open source API for live remittance rates and exchange rates across African and beyond
# afrirates-api
> Open source API for live remittance exchange rates across African corridors.
`afrirates-api` fetches live exchange rate data from AfriRates.com, stores it, and exposes it through a clean REST API β free for anyone to self-host or contribute to.
---
## Why this exists
Remittance rates change constantly and vary wildly across providers. AfriRates tracks these rates in real time, but there's no open API for developers to build on top of that data. This project fills that gap.
---
## Features
- β‘ Live rates fetched every 15 minutes from AfriRates.com
- π Priority corridors: USD β NGN, GBP β KES, EUR β GHS
- π Historical rate tracking with PostgreSQL
- π΄ Redis caching for fast reads
- π Webhook support for rate-change alerts
- π§© Fully typed TypeScript monorepo (Turborepo)
- π³ Docker Compose for one-command local setup
---
## Supported corridors
| From | To | Country |
|------|----|---------|
| USD | NGN | Nigeria |
| GBP | KES | Kenya |
| EUR | GHS | Ghana |
> More corridors coming soon. See CONTRIBUTING.md to add one.
---
## API reference
### Get latest rates
```
GET /api/rates?from=USD&to=NGN
```
**Response**
```json
{
"from": "USD",
"to": "NGN",
"rate": 1610.50,
"provider": "afrirates",
"timestamp": "2026-05-03T12:00:00Z"
}
```
---
### Get rate history
```
GET /api/rates/history?from=GBP&to=KES&days=30
```
**Response**
```json
{
"from": "GBP",
"to": "KES",
"history": [
{ "rate": 172.4, "timestamp": "2026-04-03T12:00:00Z" },
{ "rate": 173.1, "timestamp": "2026-04-04T12:00:00Z" }
]
}
```
---
### List supported corridors
```
GET /api/corridors
```
**Response**
```json
{
"corridors": [
{ "from": "USD", "to": "NGN", "label": "US Dollar β Nigerian Naira" },
{ "from": "GBP", "to": "KES", "label": "British Pound β Kenyan Shilling" },
{ "from": "EUR", "to": "GHS", "label": "Euro β Ghanaian Cedi" }
]
}
```
---
### Register a webhook
```
POST /api/webhooks
Content-Type: application/json
{
"url": "
your-app.com β¦