Developers
No signup. No API key. No rate limits.
REST API
Base URL: https://openlegalcodes.org/api/v1
GET /jurisdictions # List all jurisdictions
GET /jurisdictions?state=CA # Filter by state
GET /jurisdictions/:id # Jurisdiction metadata
GET /jurisdictions/:id/toc?depth=2 # Table of contents
GET /jurisdictions/:id/code/:path # Section text + permalink
GET /jurisdictions/:id/search?q=parking # Keyword search
GET /lookup?city=Mountain+View&state=CA # Find by name
MCP Server
Add to your Claude Desktop config for direct tool access:
{
"mcpServers": {
"legal-codes": {
"command": "npx",
"args": ["tsx", "src/mcp.ts"],
"cwd": "/path/to/open-legal-codes"
}
}
}
Tools: lookup_jurisdiction, list_jurisdictions, get_table_of_contents, get_code_text, search_code
CLI
npx tsx src/cli.ts query --jurisdiction ca-mountain-view --path part-i/article-i/section-100
npx tsx src/cli.ts toc --jurisdiction ca-mountain-view --depth 2
npx tsx src/cli.ts search --jurisdiction ca-mountain-view --query "parking"
npx tsx src/cli.ts crawl --jurisdiction ca-mountain-view
npx tsx src/cli.ts list --state CA
Claude Code
Clone the repo and use built-in slash commands:
/query-code ca-mountain-view part-i/article-i/section-100
/search-codes ca-mountain-view "parking"
/crawl-jurisdiction ca-mountain-view
GitHub
Source code: github.com/mchusma/open-legal-codes