Saudi Central Bank (SAMA) Exchange Rate API: Official SAR Rates as JSON
The Saudi Central Bank publishes the official exchange rates that accounting, tax, and customs rules in Saudi Arabia reference — published official rates, not moving market prices. This guide shows how to pull them as JSON: via a REST endpoint or the zero-dependency sama-exchange-rate npm package.
/api/v1/central-bank/sama/history?source=EUR&target=SAR).What the SAMA publishes
- 60+ currencies against the riyal — everything on SAMA’s daily table, from the euro, pound and yen to the Gulf dinars, the yuan and the SDR.
- A new table every day, seven days a week, as SAMA dates it (
reference); weekend tables repeat the last business day’s rates, exactly as SAMA prints them. - Daily history since April 2021, plus SAMA’s monthly period averages (
monthly_average) and end-of-period values (close) for 12 currencies back to January 2009. - The publication date on every response, so a rate is always citable.
- First-party source — the daily rates come straight from SAMA’s own exchange-rate page on sama.gov.sa.
The riyal has been pegged to the US dollar at 3.75 since 1986, so the dollar line never moves — the value of this table is everything else. When a Saudi contract, audit schedule or annual report needs the official riyal value of the euro, yen or pound for a given day, this is the series that answers it — and the monthly averages back to 2009 are exactly the shape many accounting policies ask for.
Why official rates, not market rates
A live mid-market exchange rate API answers "what is EUR/SAR trading at right now?" — the right tool for checkouts and dashboards. But accountants, auditors, and tax authorities ask a different question: "which rate were you required to use for this date?" That answer comes from the Saudi Central Bank's published rates, and it never changes after publication.
Get the latest rates (REST)
curl "https://allratestoday.com/api/v1/central-bank/sama/latest" \
-H "Authorization: Bearer YOUR_API_KEY" The response is the bank’s most recent published table — one row per pair in its own quoting direction, the publication date (rate_date) and a freshness flag. Live example captured 2026-07-31:
{
"bank": "sama",
"name": "Saudi Central Bank (SAMA)",
"rate_date": "2026-07-31",
"age_days": 71,
"stale": false,
"cadence": "monthly_average",
"rates": [
{"base": "AUD", "quote": "SAR", "type": "close", "value": 2.63058047221363},
{"base": "AUD", "quote": "SAR", "type": "monthly_average", "value": 2.61183063501772},
{"base": "BRL", "quote": "SAR", "type": "close", "value": 0.739165577840677},
{"base": "BRL", "quote": "SAR", "type": "monthly_average", "value": 0.734010568058027},
… 20 more rows
],
"disclaimer": "Official rates as published by the named central bank. On weekends/holidays the most recent published rate_date is returned."
} Most integrations need one pair. Add source and target and the API returns a single resolved rate — derived: false when Saudi Central Bank (SAMA) printed the pair itself:
curl "https://allratestoday.com/api/v1/central-bank/sama/latest?source=EUR&target=SAR" \
-H "Authorization: Bearer YOUR_API_KEY" {
"bank": "sama",
"name": "Saudi Central Bank (SAMA)",
"rate_date": "2026-07-31",
"source": "EUR",
"target": "SAR",
"rate": 4.29760140142838,
"rate_type": "close",
"derived": false,
"method": "published",
"age_days": 71,
"stale": false,
"cadence": "monthly_average",
"disclaimer": "Official rates as published by the named central bank. On weekends/holidays the most recent published rate_date is returned."
} The response is the bank's most recent published data — every rate and the publication date. The latest rates are available on every plan, including the free tier (no credit card).
The npm SDK
npm install sama-exchange-rate import { getRate, getLatestRates } from 'sama-exchange-rate';
// One pair at the official SAMA rate
const pair = await getRate('EUR', 'SAR', { apiKey: 'art_live_...' });
console.log(pair.rate, pair.rate_date);
// The bank's full published table
const table = await getLatestRates({ apiKey: 'art_live_...' });
console.log(table.rate_date, table.rates.length); Zero dependencies, TypeScript types included, and it runs anywhere fetch exists — Node 18+, Bun, Deno, and edge runtimes.
Historical rates for an invoice date
import { getRatesForDate, getHistory } from 'sama-exchange-rate';
// The official rates for an invoice date — non-publication days return
// the most recent published date, flagged via published_on_requested_date.
const day = await getRatesForDate('2026-06-30', { apiKey: 'art_live_...' });
// Time series for one pair
const series = await getHistory(
{ source: 'EUR', target: 'SAR', from: '2026-01-01' },
{ apiKey: 'art_live_...' }
); Historical dates and time series need a paid plan; the latest rates stay free.
Published vs derived pairs
If the SAMA does not print a pair directly, the API resolves it from the bank's published rates — an inverse, or a cross rate via SAR — and flags it derived: true with the method used. Official and computed values are never silently mixed, which is exactly the distinction an auditor will ask about.
Daily from SAMA, monthly back to 2009
SAMA’s exchange-rate page publishes a riyal table every day, seven days a week, and that is what this API serves: daily rows dated as SAMA dates them, back to April 2021. Each day’s table reflects the previous business day’s market, so Saturday, Sunday and Monday carry the same rates. For longer series, SAMA’s monthly period averages and end-of-period values for 12 currencies (republished as open data by KAPSARC, the Saudi research center) reach back to January 2009. For other Gulf tables, the Central Bank of the UAE and Central Bank of Oman also publish daily.
FAQ
Does the Saudi Central Bank have an official exchange rate API?
The SAMA publishes its official rates on its own site, and AllRatesToday serves the same published rates as clean JSON via REST or the sama-exchange-rate npm package. The latest table is free.
How often do Saudi Central Bank rates update?
Daily. SAMA posts a new riyal table every day, weekends included (Saturday to Monday repeat the last business day’s market rates), and the API picks it up the same morning. Monthly averages for 12 currencies are also available back to 2009.
Can I get the SAMA rate for a past date, like an invoice date?
Yes. The /central-bank/sama/rates-for-date endpoint returns the official rates for any archived date. Non-publication days resolve to the most recent published date and are flagged, so your audit trail stays honest. Historical dates require a paid plan; latest rates are free.
Official Saudi Central Bank rates, as JSON
The latest rates are free — no credit card.
Get your free API keyRelated Articles
- Best exchange rate API for Saudi Arabia in 2026: 8 compared
- Saudi Central Bank rates API — product page
- All covered central banks
- Central Bank of the UAE exchange rate API guide
- Central Bank of Oman exchange rate API guide
- Central bank API documentation
- Best exchange rate APIs in 2026 — how the official-rate and market-rate providers compare
- Exchange rate API — live market rates for 160+ currencies