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
- 12 currencies against the riyal — USD, EUR, GBP, JPY, CNY, INR, KRW, AUD, CHF, THB, BRL and TRY.
- Two figures per month for every currency: the period average (
monthly_average) and the end-of-period value (close), each dated to the last day of the month. - History since January 2009, queryable by exact date or as a time series.
- The publication month on every response, so a rate is always citable.
- Provenance stated plainly — SAMA publishes no machine-readable feed, so this series is sourced from the KAPSARC open-data mirror of SAMA’s own table and typically trails the calendar by about two months.
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 month, this is the series that answers it, and monthly averages are exactly the shape most accounting policies ask for.
Why official rates, not market rates
A live mid-market feed 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 data — every rate and the publication date. The latest rates are available on every plan, including the free tier (300 requests/month, 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.
Monthly, mirrored, and honest about it
SAMA is unusual among the banks we cover: its statistics portal offers no API, no CSV and no XML — the data sits behind a SharePoint report viewer. The series here comes from KAPSARC, the Saudi research center that republishes SAMA’s exchange-rate table as open data, and reaches back to January 2009. Because the mirror updates after SAMA’s own monthly cycle, expect the newest month to appear roughly two months behind the calendar. If your use case needs a daily, first-party Gulf table instead, the Central Bank of the UAE and Central Bank of Oman both publish every business day.
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?
Monthly. SAMA publishes period-average and end-of-period riyal rates for each calendar month, and the KAPSARC open-data mirror we source from typically carries a new month roughly two months after it closes. Each row is dated to the last day of its month.
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 — 300 requests/month, no credit card.
Get your free API key