Skip to content

Use case · legal AI and legal research

The local law your legal AI is missing

Case law and statutes are well served. City and county ordinances are not — and they decide a large share of the questions clients actually bring: permits, licenses, rentals, land use, nuisances. GoCodebook gives your product the verbatim local text, cited and linked.

Five problems, and what the API changes

Local law is scattered

Each city and county publishes its own code, on its own publisher's site — Municode, American Legal, General Code, Code Publishing or the city itself. There is no single API across them, and scraping their sites is fragile and often against their terms.

With GoCodebook

One API over the codes of 540 California cities and counties, with one result shape for all of them.

Models invent local rules

Asked about a setback, a permit or a fee in a particular city, a model will often answer from memory with a confident number and a section number that does not exist.

With GoCodebook

Ground the model in returned text: every result is a verbatim excerpt with its citation and a link to the full section, so an answer can be checked line by line.

The right jurisdiction is hard to pin down

An unincorporated neighborhood follows the county code, not the city named in its mailing address; the same section number means different things in different cities.

With GoCodebook

The API resolves the jurisdiction and says how (from the request, from a place named in the query, or the default), and returns notices such as scope_mismatch and section_elsewhere when the question belongs to another code.

No way to tell how current a rule is

Local codes are amended constantly, and a copy without a date cannot be trusted for a filing or an opinion.

With GoCodebook

Each result names its document and edition, and GET /v1/jurisdictions/{id} returns when every code was last collected.

Saying “not found” honestly

A retrieval system that always returns something pushes the model to answer anyway.

With GoCodebook

When a section number is not in the code, or a query asks about law the library does not hold, the API says so in notices[] instead of returning the closest text.

Where it fits

  1. 1

    Resolve the place

    Pass a jurisdiction id, or let the API detect the city or county named in the question.

  2. 2

    Search the local code

    POST /v1/search returns ranked sections with citations, verbatim excerpts and links.

  3. 3

    Ground the answer

    Hand the excerpts to your model, or ask for the AI overview, whose bracket markers map back to the results.

  4. 4

    Show the source

    Display the citation and link to the full section next to every statement your product makes.

Keep your case law and statute sources; add GoCodebook for the local layer.

A request

curl -s https://api.gocodebook.com/v1/search \
  -H "Authorization: Bearer $GOCODEBOOK_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "relocation payments owed to a tenant evicted for owner move-in",
    "jurisdiction": "us-ca-oakland",
    "include": ["overview"],
    "limit": 5
  }'

The response lists Oakland's relocation sections — each with its citation, a verbatim excerpt and a link — and an overview whose markers point back to them. The full response shape is in the API reference; the subjects covered are on the topics page.

Questions

Does the API replace a case law or statute database?

No. It covers local ordinances — the municipal, zoning and planning codes of California cities and counties. Most legal AI products already have case law and statutes; this fills the local layer they usually lack.

Can the excerpts be shown to users or quoted in a memo?

Yes. Show the citation and link the result's url next to any excerpt you display, so a reader can see the full section. Results are code text, not legal advice.

What happens when the law asked about is not in the library?

The response says so in notices[] — for example section_not_found, section_elsewhere or corpus_gap — instead of returning the nearest text as if it answered the question.

How is it priced?

$0.30 a search with the AI overview included, from a prepaid balance; a search with no results is not charged. Contracts with volume pricing and invoiced billing are available.