{"openapi":"3.1.0","info":{"title":"San Andreas Register of Law API","version":"1.0.0","description":"This is the fictional law of the State of San Andreas on Fat Duck Gaming (FDG), a GTA V FiveM roleplay server. It applies only to in-game roleplay on that server. It is not real-world law and is not legal advice. Fines are in in-game dollars.\n\nRead-only, public and unauthenticated. Responses are cacheable for 5 minutes (sentencing trends until their next update)."},"servers":[{"url":"/law/api/v1"}],"paths":{"/acts":{"get":{"operationId":"listActs","summary":"List every act, in reading order","responses":{"200":{"description":"The acts","content":{"application/json":{"schema":{"type":"object","required":["notice","asAt","acts"],"properties":{"notice":{"type":"string","description":"Reminder that this is fictional, in-game law, not real-world law or legal advice."},"asAt":{"type":"string","description":"When this snapshot of the Register was read (ISO 8601). Data may be up to 5 minutes old."},"acts":{"type":"array","items":{"$ref":"#/components/schemas/ActSummary"}}}}}}},"503":{"description":"The Register is temporarily unavailable; see Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/acts/{act}":{"get":{"operationId":"getAct","summary":"One act and all of its sections","parameters":[{"name":"act","in":"path","required":true,"schema":{"type":"string"},"description":"The act's `name`"}],"responses":{"200":{"description":"The act","content":{"application/json":{"schema":{"type":"object","required":["notice","asAt","act"],"properties":{"notice":{"type":"string","description":"Reminder that this is fictional, in-game law, not real-world law or legal advice."},"asAt":{"type":"string","description":"When this snapshot of the Register was read (ISO 8601). Data may be up to 5 minutes old."},"act":{"$ref":"#/components/schemas/Act"}}}}}},"404":{"description":"No such act","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"The Register is temporarily unavailable; see Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sections/{reference}":{"get":{"operationId":"getSection","summary":"One section, with its amendment history","parameters":[{"name":"reference","in":"path","required":true,"schema":{"type":"string"},"description":"The section's reference, e.g. T1 (unique across the Register; case-insensitive)"}],"responses":{"200":{"description":"The section","content":{"application/json":{"schema":{"type":"object","required":["notice","asAt","section"],"properties":{"notice":{"type":"string","description":"Reminder that this is fictional, in-game law, not real-world law or legal advice."},"asAt":{"type":"string","description":"When this snapshot of the Register was read (ISO 8601). Data may be up to 5 minutes old."},"section":{"$ref":"#/components/schemas/SectionWithHistory"}}}}}},"404":{"description":"No such section","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"The Register is temporarily unavailable; see Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sections/{reference}/trends":{"get":{"operationId":"getSectionTrends","summary":"How a section has been charged over the last 12 complete months, and this month so far","description":"From charges recorded in COPS, the in-game police records system; not court outcomes or sentencing guidance. Updated every 48 hours (see nextUpdate). Counts from 1 to 4 are withheld (null). Penalty figures use only charges where this was the only section, as a charge's fine and imprisonment are totals across its sections.","parameters":[{"name":"reference","in":"path","required":true,"schema":{"type":"string"},"description":"The section's reference (case-insensitive)"}],"responses":{"200":{"description":"The section's trends; asAt is when they were computed","content":{"application/json":{"schema":{"type":"object","required":["notice","asAt","reference","nextUpdate","months","current","total","alone","chargedWith"],"properties":{"notice":{"type":"string","description":"Reminder that this is fictional, in-game law, not real-world law or legal advice."},"asAt":{"type":"string","description":"When this snapshot of the Register was read (ISO 8601). Data may be up to 5 minutes old."},"reference":{"type":"string"},"nextUpdate":{"type":"string","description":"When these figures are next refreshed (ISO 8601)"},"months":{"type":"array","description":"Oldest first","items":{"type":"object","required":["month","charges"],"properties":{"month":{"type":"string","description":"YYYY-MM"},"charges":{"oneOf":[{"type":"integer","description":"Charges including this section; null for 1 to 4"},{"type":"null"}]}}}},"current":{"type":"object","description":"This month so far, as at asAt; not included in total, alone or chargedWith","required":["month","charges","projected"],"properties":{"month":{"type":"string","description":"YYYY-MM"},"charges":{"oneOf":[{"type":"integer","description":"Charges so far; null for 1 to 4"},{"type":"null"}]},"projected":{"oneOf":[{"type":"integer","description":"Charges projected for the whole month at the rate so far; null before the 7th or when charges is null"},{"type":"null"}]}}},"total":{"oneOf":[{"type":"integer","description":"Charges over the 12 complete months; null for 1 to 4"},{"type":"null"}]},"alone":{"oneOf":[{"type":"object","description":"Penalties when this was the only section charged; null with fewer than 10 such charges","required":["charges","fine","jailMinutes","jailShare"],"properties":{"charges":{"type":"integer"},"fine":{"$ref":"#/components/schemas/Spread"},"jailMinutes":{"$ref":"#/components/schemas/Spread"},"jailShare":{"type":"number","description":"Share of these charges with any imprisonment, 0 to 1"}}},{"type":"null"}]},"chargedWith":{"type":"array","description":"Sections most often on the same charge (at least 5 shared charges), most first","items":{"type":"object","required":["reference","act","title","charges"],"properties":{"reference":{"type":"string"},"act":{"type":"string"},"title":{"type":"string"},"charges":{"type":"integer"}}}}}}}}},"404":{"description":"No such section","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"The Register is temporarily unavailable; see Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/search":{"get":{"operationId":"searchSections","summary":"Search sections by reference, title or text","description":"Best matches first: exact reference, reference prefix, title prefix, a title word starting with the query, title containing it, then text containing it. Case-insensitive.","parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"act","in":"query","required":false,"schema":{"type":"string"},"description":"Only sections of this act (`name`)"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":50,"default":20}}],"responses":{"200":{"description":"Matching sections","content":{"application/json":{"schema":{"type":"object","required":["notice","asAt","query","results"],"properties":{"notice":{"type":"string","description":"Reminder that this is fictional, in-game law, not real-world law or legal advice."},"asAt":{"type":"string","description":"When this snapshot of the Register was read (ISO 8601). Data may be up to 5 minutes old."},"query":{"type":"string"},"results":{"type":"array","items":{"$ref":"#/components/schemas/SearchResult"}}}}}}},"400":{"description":"Invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"The Register is temporarily unavailable; see Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"schemas":{"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}},"ActSummary":{"type":"object","required":["name","code","title","description","sectionCount","url","markdownPath"],"properties":{"name":{"type":"string","description":"Identifier used in URLs"},"code":{"oneOf":[{"type":"string","description":"Short code, e.g. T"},{"type":"null"}]},"title":{"type":"string"},"description":{"type":"string","description":"Markdown"},"sectionCount":{"type":"integer"},"url":{"type":"string","description":"The act on the website"},"markdownPath":{"type":"string","description":"The act as Markdown, relative to this API's host"}}},"Act":{"allOf":[{"$ref":"#/components/schemas/ActSummary"},{"type":"object","required":["sections"],"properties":{"sections":{"type":"array","items":{"$ref":"#/components/schemas/Section"}}}}]},"Penalties":{"type":"object","required":["fine","imprisonmentMinutes","vehicleDemeritPoints","firearmsDemeritPoints","additional"],"properties":{"fine":{"oneOf":[{"type":"object","required":["min","max"],"properties":{"min":{"type":"number"},"max":{"type":"number"}},"description":"In-game dollars; null when there is no fine"},{"type":"null"}]},"imprisonmentMinutes":{"oneOf":[{"type":"object","required":["min","max"],"properties":{"min":{"type":"number"},"max":{"type":"number"}},"description":"Null when there is no imprisonment"},{"type":"null"}]},"vehicleDemeritPoints":{"type":"integer"},"firearmsDemeritPoints":{"type":"integer"},"additional":{"oneOf":[{"type":"string","description":"Any other punishment, as Markdown"},{"type":"null"}]}}},"Section":{"type":"object","required":["reference","act","title","text","penalties","lastAmended","aggravatingFactors","mitigatingFactors","related","url","markdownPath"],"properties":{"reference":{"type":"string"},"act":{"type":"string","description":"The act's `name`"},"title":{"type":"string"},"text":{"type":"string","description":"Markdown. Numbered provisions are written as (1), (a), (i) labels at the start of a line."},"penalties":{"$ref":"#/components/schemas/Penalties"},"lastAmended":{"oneOf":[{"type":"string","description":"ISO 8601"},{"type":"null"}]},"aggravatingFactors":{"type":"array","items":{"type":"string"}},"mitigatingFactors":{"type":"array","items":{"type":"string"}},"related":{"type":"array","items":{"type":"object","required":["reference","act","title","note"],"properties":{"reference":{"type":"string"},"act":{"type":"string"},"title":{"type":"string"},"note":{"oneOf":[{"type":"string","description":"Markdown"},{"type":"null"}]}}}},"url":{"type":"string","description":"The section on the website"},"markdownPath":{"type":"string","description":"The section as Markdown, relative to this API's host"}}},"SectionWithHistory":{"allOf":[{"$ref":"#/components/schemas/Section"},{"type":"object","required":["history"],"properties":{"history":{"type":"array","description":"Past versions, most recently superseded first; each is the section as it stood until supersededAt","items":{"type":"object","required":["act","title","text","penalties","lastAmended","supersededAt"],"properties":{"act":{"type":"string"},"title":{"type":"string"},"text":{"type":"string","description":"Markdown"},"penalties":{"$ref":"#/components/schemas/Penalties"},"lastAmended":{"oneOf":[{"type":"string","description":"ISO 8601"},{"type":"null"}]},"supersededAt":{"oneOf":[{"type":"string","description":"ISO 8601"},{"type":"null"}]}}}}}}]},"Spread":{"type":"object","required":["median","lower","upper"],"properties":{"median":{"type":"number"},"lower":{"type":"number","description":"25th percentile"},"upper":{"type":"number","description":"75th percentile"}}},"SearchResult":{"type":"object","required":["reference","act","title","snippet","url","markdownPath"],"properties":{"reference":{"type":"string"},"act":{"type":"string"},"title":{"type":"string"},"snippet":{"type":"string","description":"Plain text around the first match"},"url":{"type":"string"},"markdownPath":{"type":"string"}}}}}}