Skip to main content

Quickstart

Developer Preview: The LocalCode API is currently available to design partners. These docs describe the draft v1 API contract and may evolve before general availability.

Before you begin

The requests below are illustrative examples. Not all jurisdictions or resources are enabled for every account, and response shape/content can vary based on coverage and access tier. Request API Access

1) Send a Request

curl "https://api.localcode.ai/v1/jurisdictions" \
  -H "Authorization: Bearer {LOCALCODE_API_KEY}"

2) Fetch a Code Section

curl "https://api.localcode.ai/v1/code-sections/{code_section_id}" \
  -H "Authorization: Bearer {LOCALCODE_API_KEY}"

3) Inspect Official Sources

curl "https://api.localcode.ai/v1/code-sections/{code_section_id}/sources" \
  -H "Authorization: Bearer {LOCALCODE_API_KEY}"

4) Read Lineage Context

curl "https://api.localcode.ai/v1/code-sections/{code_section_id}/legislative-chain" \
  -H "Authorization: Bearer {LOCALCODE_API_KEY}"

5) Search by Code Text and Citation

curl "https://api.localcode.ai/v1/search?q=short-term%20rental&jurisdiction_id={jurisdiction_id}" \
  -H "Authorization: Bearer {LOCALCODE_API_KEY}"
The v1 search endpoint is scoped to code-section discovery and retrieval workflows.

Happy path (illustrative IDs)

Use a consistent flow with sample IDs:
  • jurisdiction_id: 8f4d62da-a8c2-4db7-8828-2d25b287c9b1
  • code_section_id: f6e1b0a1-3a7f-4c57-b674-f64ed7ac18cf

1) Get jurisdiction

curl "https://api.localcode.ai/v1/jurisdictions/8f4d62da-a8c2-4db7-8828-2d25b287c9b1" \
  -H "Authorization: Bearer {LOCALCODE_API_KEY}"

2) Get code section

curl "https://api.localcode.ai/v1/code-sections/f6e1b0a1-3a7f-4c57-b674-f64ed7ac18cf" \
  -H "Authorization: Bearer {LOCALCODE_API_KEY}"

3) Get legislative chain

curl "https://api.localcode.ai/v1/code-sections/f6e1b0a1-3a7f-4c57-b674-f64ed7ac18cf/legislative-chain" \
  -H "Authorization: Bearer {LOCALCODE_API_KEY}"

4) Get section sources

curl "https://api.localcode.ai/v1/code-sections/f6e1b0a1-3a7f-4c57-b674-f64ed7ac18cf/sources" \
  -H "Authorization: Bearer {LOCALCODE_API_KEY}"