{"openapi":"3.1.0","info":{"title":"Fast Source API","version":"v0","description":"Saudi standards and calendar for AI apps and developers; every answer cites its source."},"servers":[{"url":"https://source.fast.sa"}],"paths":{"/v1/calendar/convert":{"get":{"summary":"Convert a date between Gregorian and Hijri (Umm al-Qura)","operationId":"v1CalendarConvert","description":"Counts toward the monthly quota.","parameters":[{"name":"gregorian","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"hijri","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"The answer with its citations","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"description":"bad_request or out_of_range","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized: missing, unknown or revoked key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"quota_exceeded or rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/calendar/prayer-times":{"get":{"summary":"Prayer times for a Saudi city or coordinates (Umm al-Qura method, Asia/Riyadh time)","operationId":"v1CalendarPrayerTimes","description":"Counts toward the monthly quota.","parameters":[{"name":"city","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"name":"lat","in":"query","required":false,"schema":{"type":"number"}},{"name":"lng","in":"query","required":false,"schema":{"type":"number"}},{"name":"date","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"The answer with its citations","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"description":"bad_request or out_of_range","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized: missing, unknown or revoked key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"quota_exceeded or rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/calendar/holidays":{"get":{"summary":"Official holidays by sector, each with the regulation it comes from","operationId":"v1CalendarHolidays","description":"Counts toward the monthly quota.","parameters":[{"name":"year","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"sector","in":"query","required":false,"schema":{"type":"string","enum":["government","private"]}}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"The answer with its citations","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"description":"bad_request or out_of_range","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized: missing, unknown or revoked key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"quota_exceeded or rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/calendar/working-day":{"get":{"summary":"Whether a date is a working day for a sector, and why","operationId":"v1CalendarWorkingDay","description":"Counts toward the monthly quota.","parameters":[{"name":"date","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"sector","in":"query","required":true,"schema":{"type":"string","enum":["government","private"]}}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"The answer with its citations","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"description":"bad_request or out_of_range","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized: missing, unknown or revoked key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"quota_exceeded or rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/standards/search":{"get":{"summary":"Search Saudi standards and building codes by number or title (facts and where to buy, never the text)","operationId":"v1StandardsSearch","description":"Counts toward the monthly quota.","parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string","minLength":1}},{"name":"body","in":"query","required":false,"schema":{"type":"string","enum":["SASO","SBC"]}},{"name":"kind","in":"query","required":false,"schema":{"type":"string","enum":["standard","technical_regulation","building_code"]}},{"name":"limit","in":"query","required":false,"schema":{"default":10,"type":"integer","minimum":1,"maximum":50}}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"The answer with its citations","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"description":"bad_request or out_of_range","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized: missing, unknown or revoked key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"quota_exceeded or rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/standards/{id}":{"get":{"summary":"One standard's facts: titles, edition, what it adopts, where to read or buy it","operationId":"v1StandardsId","description":"Counts toward the monthly quota.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"The answer with its citations","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"description":"bad_request or out_of_range","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized: missing, unknown or revoked key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"quota_exceeded or rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/sources":{"get":{"summary":"The public source register: verdict, licence and when each source was last checked","operationId":"v1Sources","description":"Free in every plan: does not count toward the monthly quota (rate limit only).","parameters":[],"security":[{"apiKey":[]}],"responses":{"200":{"description":"The answer with its citations","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"description":"bad_request or out_of_range","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized: missing, unknown or revoked key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"quota_exceeded or rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/usage":{"get":{"summary":"Calls counted this month (Riyadh time) across all of the account's keys, and calls by shelf","operationId":"v1Usage","description":"Free in every plan: does not count toward the monthly quota (rate limit only).","parameters":[],"security":[{"apiKey":[]}],"responses":{"200":{"description":"The answer with its citations","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"description":"bad_request or out_of_range","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized: missing, unknown or revoked key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"quota_exceeded or rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","description":"fs_live_… key"}},"schemas":{"Envelope":{"type":"object","properties":{"data":{},"citations":{"type":"array","items":{"type":"object","properties":{"source":{"type":"string"},"url":{"type":"string"},"checked_at":{"type":"string"},"licence":{"type":"string"},"notice":{"type":"string"}},"required":["source","url","checked_at","licence"]}},"notice":{"type":"string"},"meta":{"type":"object","properties":{"shelf":{"type":"string"},"version":{"type":"string","const":"v0"}},"required":["shelf","version"]}},"required":["data","citations","meta"]},"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["not_found","bad_request","unauthorized","quota_exceeded","rate_limited","out_of_range","internal_error"]},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}