> ## Documentation Index
> Fetch the complete documentation index at: https://docs.localcode.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

# 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](https://www.localcode.ai/api)

## 1) Send a Request

```bash theme={null}
curl "https://api.localcode.ai/v1/jurisdictions" \
  -H "Authorization: Bearer {LOCALCODE_API_KEY}"
```

## 2) Fetch a Code Section

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

## 3) Inspect Official Sources

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

## 4) Read Lineage Context

```bash theme={null}
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

```bash theme={null}
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

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

### 2) Get code section

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

### 3) Get legislative chain

```bash theme={null}
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

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