Developers
A JSON REST API with daily exchange rates from 15 Sri Lankan banks and the Central Bank. All rates are in Sri Lankan rupees (LKR) per 1 unit of foreign currency.
Authentication
Every request needs two headers. Contact us to request a key.
X-API-Key: fx_xxxxxxxxxxxxxxxxxxxxxxxx
X-API-Secret: your-secret
Missing headers return 401, wrong credentials 403. Always call over HTTPS.
Endpoints
Base URL: https://fxratelkr.turn.global
| Method & path | Returns |
|---|---|
| GET /rates/latest?currency=USD&bank=boc | Each bank's newest published rates; both filters optional |
| GET /rates/{CCY}/compare | One currency across all banks, best TT buying first |
| GET /rates?currency=USD&bank=hnb&from=2026-10-01&to=2026-10-31&limit=500 | Historical rows (max 5000) |
| GET /banks | Bank list with latest date and currency count |
| GET /health | Status check (no auth) |
Rate fields
null means the bank does not publish that rate type.
- tt_buying / tt_selling
- Telegraphic transfer
- cash_buying / cash_selling
- Currency notes
- dd_buying / dd_selling
- Demand drafts, cheques, TCs
- import_bill_selling
- Import bill selling rate
- indicative
- CBSL indicative spot (mid) rate
- rate_date / fetched_at
- Date the bank published / when it was collected (UTC)
Bank codes: amana, boc, cbsl, combank, dfcc, hnb, ndb, nsb, ntb, pabc, peoples, sampath, sbi, seylan, union
Examples
cURL
curl https://fxratelkr.turn.global/rates/USD/compare \
-H "X-API-Key: $FX_API_KEY" \
-H "X-API-Secret: $FX_API_SECRET"
Flutter / Dart
import 'dart:convert';
import 'package:http/http.dart' as http;
final res = await http.get(
Uri.parse('https://fxratelkr.turn.global/rates/USD/compare'),
headers: {'X-API-Key': apiKey, 'X-API-Secret': apiSecret},
);
final banks = jsonDecode(res.body)['banks'] as List;
JavaScript
const res = await fetch('https://fxratelkr.turn.global/rates/latest?currency=EUR', {
headers: { 'X-API-Key': apiKey, 'X-API-Secret': apiSecret },
});
const rows = await res.json();
Sample response
[]