{"openapi":"3.1.0","info":{"title":"Bylaw Insider API","version":"1.0.0","description":"Read-only JSON for Canadian municipal bylaw sections indexed by Bylaw Insider. Section text follows the municipality licence: full_text, a short snippet, or no text. Calgary is link-only and is not fetched. Responses include a citation string and the official source URL. This is an unofficial copy; the official version governs."},"servers":[{"url":"https://www.bylawinsider.com"}],"paths":{"/api/v1/search":{"get":{"operationId":"searchSections","summary":"Search indexed Canadian bylaw sections","parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string"},"description":"Keywords, a quoted phrase, or a section number such as 591-2.1."},{"name":"city","in":"query","required":false,"schema":{"type":"string"},"description":"City slug, for example toronto or quebec-city."},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1}}],"responses":{"200":{"description":"Matching sections, with text limited by display mode.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchResponse"}}}}}}},"/api/v1/section/{province}/{city}/{bylaw}/{section}":{"get":{"operationId":"getSection","summary":"One section by its stable permalink id","parameters":[{"name":"province","in":"path","required":true,"schema":{"type":"string"},"example":"on"},{"name":"city","in":"path","required":true,"schema":{"type":"string"},"example":"toronto"},{"name":"bylaw","in":"path","required":true,"schema":{"type":"string"},"example":"591"},{"name":"section","in":"path","required":true,"schema":{"type":"string"},"example":"591-2-1"}],"responses":{"200":{"description":"The section record.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Section"}}}},"404":{"description":"No indexed section at that id."}}}}},"components":{"schemas":{"Section":{"type":"object","required":["id","city","province","bylawNumber","sectionNumber","displayMode","sourceUrl","citation","url","fetchedAt"],"properties":{"id":{"type":"string","description":"province/city/bylaw/section"},"city":{"type":"string"},"citySlug":{"type":"string"},"province":{"type":"string"},"bylawNumber":{"type":"string"},"bylawTitle":{"type":"string"},"bylawSlug":{"type":"string"},"sectionNumber":{"type":"string"},"sectionSlug":{"type":"string"},"heading":{"type":"string"},"pathLabel":{"type":"string"},"displayMode":{"type":"string","enum":["full_text","snippet","link_only"]},"text":{"type":["string","null"],"description":"Null unless the licence allows the returned text."},"summary":{"type":["string","null"],"description":"Extract from the indexed text. Null when the section has too little text."},"sourceUrl":{"type":"string","format":"uri"},"citation":{"type":"string"},"url":{"type":"string","format":"uri"},"fetchedAt":{"type":"string","format":"date-time"},"licenceName":{"type":["string","null"]},"licenceUrl":{"type":["string","null"]},"attribution":{"type":["string","null"]}}},"SearchResponse":{"type":"object","required":["query","city","page","pageSize","total","results"],"properties":{"query":{"type":"string"},"city":{"type":["string","null"]},"page":{"type":"integer"},"pageSize":{"type":"integer"},"total":{"type":"integer"},"exact":{"type":"boolean"},"notices":{"type":"array","items":{"type":"object"}},"results":{"type":"array","items":{"$ref":"#/components/schemas/Section"}}}}}}}