API guide

Everything a developer or an AI agent needs, on one page: get a key, call the REST API or the MCP connector, read the answer and cite it.

هذا الدليل بالإنجليزية لأنه موجّه للمطورين والوكلاء الأذكياء. لأي سؤال بالعربية راسلنا على data@fast.sa.

Quick start

  1. Get a key. Fill in the form at https://source.fast.sa/#key. During v0 we issue keys by hand and email them; a key starts with sdl_live_. Keep it secret.
  2. Call the API with the key in the Authorization header:
    curl -H "Authorization: Bearer $SDL_KEY" \
      "https://source.fast.sa/v1/calendar/convert?gregorian=2026-10-23"
  3. Use data, cite citations. Every answer says where it came from. Show the source and its link with the answer, and keep any notice.
  4. Handle errors by their code (table below). After 429 rate_limited, wait the Retry-After seconds and try again.

No key yet? The MCP connector needs none.

Base URL and versions

Base URL: https://source.fast.sa. This is v0: paths start with /v1/ and every answer carries "meta": {"version": "v0"}. We may add fields; existing fields keep their meaning.

Authentication

Every /v1/ call needs the header Authorization: Bearer sdl_live_… (the prefix plus 32 characters). A missing, unknown or revoked key gets 401 unauthorized. We store only a hash of your key, so we cannot show it again: if you lose it, ask for a new one.

Answer format

Every successful answer, REST or MCP, has the same shape:

{
  "data": { … },
  "citations": [
    {
      "source": "Saudi Building Code 2024 catalogue (sbc.gov.sa)",
      "url": "https://www.sbc.gov.sa/En/BC/Pages/BuildingCode/BC.aspx?year=2024",
      "checked_at": "2026-10-23T10:00:00.000Z",
      "licence": "Facts only: code numbers, names and editions",
      "notice": "Full text sold by the Saudi Building Code Center"
    }
  ],
  "meta": { "shelf": "standards", "version": "v0" }
}

Field names are snake_case. Dates are YYYY-MM-DD, timestamps are ISO 8601 in UTC, and times of day (prayer times) are Asia/Riyadh.

Errors

{"error": {"code": "not_found", "message": "No standard with that id"}}
CodeHTTPMeaning and what to do
bad_request400A parameter is missing or invalid; the message names it. Fix the request.
out_of_range400The date or year is outside the data we hold (Hijri 1300 to 1600 AH; holidays for 2026 and 2027). Ask within range.
unauthorized401No key, an unknown key or a revoked key. Check the header.
not_found404No such endpoint, record or article. Check the path and the id.
quota_exceeded429This month's calls are used up. They reset on the 1st (Riyadh time); email us if you need more.
rate_limited429Too many requests at once. Wait the Retry-After seconds.
internal_error500Our fault. Try again later, and tell us if it keeps happening.

Limits

Endpoints

All endpoints are GET and answer JSON. Full schemas: /openapi.json (OpenAPI 3.1).

GET /v1/calendar/convert

Convert a date between Gregorian and Hijri (Umm al-Qura) Counts toward the monthly quota

GET /v1/calendar/prayer-times

Prayer times for a Saudi city or coordinates (Umm al-Qura method, Asia/Riyadh time) Counts toward the monthly quota

GET /v1/calendar/holidays

Official holidays by sector, each with the regulation it comes from. Counts toward the monthly quota

GET /v1/calendar/working-day

Whether a date is a working day for a sector, and why. Counts toward the monthly quota

GET /v1/standards/search

Search Saudi standards and building codes by number or title (facts and where to buy, never the text) Counts toward the monthly quota

GET /v1/standards/{id}

One standard's facts: titles, edition, what it adopts, where to read or buy it. Counts toward the monthly quota

GET /v1/sources

The public source register: verdict, licence and when each source was last checked. Not counted toward the quota

No parameters.

GET /v1/usage

Calls counted this month (Riyadh time) across all of the account's keys, and calls by shelf. Not counted toward the quota

No parameters.

Examples

Is a date a working day?

curl -H "Authorization: Bearer $SDL_KEY" \
  "https://source.fast.sa/v1/calendar/working-day?date=2026-09-24&sector=government"

Prayer times for a city

curl -H "Authorization: Bearer $SDL_KEY" \
  "https://source.fast.sa/v1/calendar/prayer-times?city=jeddah&date=2026-10-23"

Find a standard by number

curl -G -H "Authorization: Bearer $SDL_KEY" "https://source.fast.sa/v1/standards/search" \
  --data-urlencode "q=SBC 201"

MCP connector

URL: https://source.fast.sa/mcp. Streamable HTTP, stateless (POST only, JSON answers), no key, up to 60 requests a minute per IP address.

In Claude, add a custom connector with this URL. In ChatGPT, add it as a connector in developer mode. Any MCP client that speaks streamable HTTP works too.

Every tool is read-only. A result has two text parts: a one-paragraph summary that ends with its source line, then the same JSON answer as the REST API. Errors come back as {"error": {"code", "message"}} with isError set.

convert_saudi_date · Convert Hijri and Gregorian dates

Converts a date between the Gregorian calendar and the Umm al-Qura Hijri calendar, the official calendar of Saudi Arabia. Give exactly one of gregorian or hijri. Returns both dates, the weekday and the Hijri month name in Arabic and English. Covers 1300 to 1600 AH.

saudi_prayer_times · Saudi prayer times

Returns the times of the five daily prayers and sunrise for a Saudi city, or for coordinates inside Saudi Arabia, on a date (default: today in Riyadh). Computed with the Umm al-Qura method, in Asia/Riyadh time. Give a city, or both lat and lng.

saudi_holidays · Saudi official holidays

Returns the official holidays of a year for the government sector, the private sector, or both: dates, names in Arabic and English, and the regulation or announcement each rests on, with its link. Years covered: 2026 and 2027.

is_saudi_working_day · Check a Saudi working day

Says whether a date is a working day in Saudi Arabia for the government or the private sector, and why: a weekend, an official holiday (with the regulation it rests on and its link), or a normal working day. Default date: today in Riyadh.

search_saudi_standards · Search Saudi standards

Searches Saudi standards (SASO) and the Saudi Building Code (SBC) by number, e.g. «SBC 201» or «SASO 2902», or by words of the Arabic or English title. Returns the matching standards with number, titles, kind, status, edition year, the international standard adopted, the official page and where the issuing body provides the full text. It never returns the text of a standard.

get_saudi_standard · Get a Saudi standard

Returns one Saudi standard or building code by its id (from search_saudi_standards): number, titles, kind, status, edition, the international standard adopted, the official page and where the issuing body provides the full text, with the source and the date it was checked.

About the data

Help

Email data@fast.sa or see Support. Read the Terms and the Privacy Policy. Machine-readable: /openapi.json, /llms.txt, /llms-full.txt.