{"openapi":"3.1.0","info":{"title":"Oakrule API","description":"US rental housing law at an address and a date: which rules apply, whether a rent increase is within the cap, and what changes next for your buildings. Every answer cites its official source. **Information, not legal advice.** Human docs with curl examples: [/developers](/developers). Use is subject to the [API terms](/api-terms), the [Terms of Service](/terms) and the [Acceptable Use Policy](/acceptable-use).","termsOfService":"/api-terms","contact":{"name":"Oakrule","email":"help@oakrule.com"},"version":"1.0.0"},"servers":[{"url":"/v1"}],"paths":{"/rules":{"get":{"tags":["Rules"],"summary":"Rules at an address on a date","description":"Every rule in our corpus for the place, with its result for this building on the date: `applies`,\n`unknown` (a fact is missing: see `needs_facts`), `not_yet_effective`, `superseded` (a local rule governs) or\n`pending` (a bill, not law). Results depend on the building facts you send.","operationId":"rules_rules_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"address","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"description":"Street address with city and state (US Census geocoder)","title":"Address"},"description":"Street address with city and state (US Census geocoder)"},{"name":"state","in":"query","required":false,"schema":{"anyOf":[{"type":"string","minLength":2,"maxLength":2},{"type":"null"}],"description":"Instead of address: CA, NJ or MA","title":"State"},"description":"Instead of address: CA, NJ or MA"},{"name":"city","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":60},{"type":"null"}],"description":"With state: a covered city, e.g. Los Angeles","title":"City"},"description":"With state: a covered city, e.g. Los Angeles"},{"name":"date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"YYYY-MM-DD the rules apply to (default: today)","title":"Date"},"description":"YYYY-MM-DD the rules apply to (default: today)"},{"name":"year_built","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":2100,"minimum":1700},{"type":"null"}],"title":"Year Built"}},{"name":"units","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":5000,"minimum":1},{"type":"null"}],"description":"Units in the building","title":"Units"},"description":"Units in the building"},{"name":"owner_occupied","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Does the owner live in the building?","title":"Owner Occupied"},"description":"Does the owner live in the building?"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/rent-increase/check":{"post":{"tags":["Rent increases"],"summary":"Check a rent increase","description":"Whether the increase is within the rent cap for this building on the effective date, and whether the\nnotice period is met. Each verdict cites the rule it comes from. `kind`: `ok`, `over`, `short` (notice too late), `none` (no cap) or `unknown` (`need` names what is missing).","operationId":"check_increase_rent_increase_check_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckBody"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/properties":{"get":{"tags":["Portfolio"],"summary":"Your buildings","operationId":"properties_properties_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/portfolio/changes":{"get":{"tags":["Portfolio"],"summary":"Upcoming changes for your buildings","description":"Every dated change in the law at each of the organisation's buildings (a rule takes effect, ends or changes,\na figure period ends) and the last day to send the written notice of the next lawful raise, soonest first.","operationId":"portfolio_changes_portfolio_changes_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"from","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"YYYY-MM-DD (default: today)","title":"From"},"description":"YYYY-MM-DD (default: today)"},{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":3650,"minimum":1,"description":"How far ahead","default":365,"title":"Days"},"description":"How far ahead"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/usage":{"get":{"tags":["Account"],"summary":"API calls this month","description":"Not billed and not counted.","operationId":"usage_usage_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/dataset":{"get":{"tags":["Dataset"],"summary":"Rules dataset releases","description":"Monthly releases of every reviewed rule (CSV and JSON, schema, changelog, SHA-256 sums), newest first.\nIncluded with the API plan; downloads do not count as lookups.","operationId":"dataset_list_dataset_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/dataset/sample/{name}":{"get":{"tags":["Dataset"],"summary":"Free slice (no key)","description":"The latest release's Massachusetts rules. Public, no key needed.","operationId":"dataset_sample_dataset_sample__name__get","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string","title":"Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/dataset/{release}/{name}":{"get":{"tags":["Dataset"],"summary":"Download a release file","description":"`release` is YYYY-MM or `latest`. Every file's SHA-256 is in SHA256SUMS and the X-Content-SHA256 header.","operationId":"dataset_file_dataset__release___name__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"release","in":"path","required":true,"schema":{"type":"string","title":"Release"}},{"name":"name","in":"path","required":true,"schema":{"type":"string","title":"Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"CheckBody":{"properties":{"address":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Address","description":"Street address with city and state"},"state":{"anyOf":[{"type":"string","maxLength":2,"minLength":2},{"type":"null"}],"title":"State","description":"Instead of address"},"city":{"anyOf":[{"type":"string","maxLength":60},{"type":"null"}],"title":"City"},"facts":{"$ref":"#/components/schemas/FactsIn","default":{}},"current_rent":{"type":"number","maximum":1000000.0,"exclusiveMinimum":0.0,"title":"Current Rent","description":"Monthly rent now, USD"},"new_rent":{"anyOf":[{"type":"number","maximum":1000000.0,"exclusiveMinimum":0.0},{"type":"null"}],"title":"New Rent","description":"Monthly rent after the increase"},"increase_pct":{"anyOf":[{"type":"number","maximum":1000.0,"minimum":-100.0},{"type":"null"}],"title":"Increase Pct","description":"Instead of new_rent"},"effective_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Effective Date","description":"Day the new rent starts (default: today)"},"notice_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Notice Date","description":"Day the tenant got written notice"},"cpi":{"anyOf":[{"type":"number","maximum":30.0,"minimum":-20.0},{"type":"null"}],"title":"Cpi","description":"Local CPI change in %, where the cap depends on it"}},"additionalProperties":false,"type":"object","required":["current_rent"],"title":"CheckBody","example":{"address":"6238 De Longpre Ave, Los Angeles, CA","current_rent":2000,"effective_date":"2027-01-01","facts":{"units":12,"year_built":1964},"new_rent":2080,"notice_date":"2026-11-15"}},"FactsIn":{"properties":{"year_built":{"anyOf":[{"type":"integer","maximum":2100.0,"minimum":1700.0},{"type":"null"}],"title":"Year Built"},"units":{"anyOf":[{"type":"integer","maximum":5000.0,"minimum":1.0},{"type":"null"}],"title":"Units"},"owner_occupied":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Owner Occupied"}},"additionalProperties":false,"type":"object","title":"FactsIn"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}},"securitySchemes":{"HTTPBearer":{"type":"http","description":"Your API key: `Authorization: Bearer ce_<id>_<secret>`","scheme":"bearer"}}}}