Search and lookup
MAIA API HTTP reference
MAIA's API takes a search over HTTP and returns the parcels or places in San Francisco that public records say fit it, each fact with its source. It also looks up what MAIA holds about one parcel or place, and geocodes street addresses and points to the parcels MAIA holds. A program calls it with a key; this page has everything it needs to make its first call and read the reply.
The API is for a program that needs MAIA's records about places, such as an agent's tool or a backend job. To use MAIA from Claude or ChatGPT instead, see Connect your AI assistant and the connector's tools.
For a program or an agent, this page is also served as plain Markdown at /docs/api/reference.md, and the API's spec is an OpenAPI 3.1 file at /openapi.json.
What it covers#
San Francisco County, California, for now. A search names its region, and a region MAIA does not cover is refused with the list of what is covered.
The records are San Francisco's public records: parcels and their zoning, land use, buildings, assessed values and sales; businesses and points of interest with their hours; permits; flood zones, hazards and ground elevation; schools, transit and neighborhoods. Each fact in a reply names the dataset it came from.
Get a key#
API access is open by invitation for now. To ask for it, email support@maia-analytics.com with the name of your company and what you will build, and say that you want search. MAIA sends you an invitation link and turns search on for your workspace. When you accept the invitation, API access opens for your workspace.
To make a key, sign in at app.maia-analytics.com/console/keys, give the key a name and copy it: the full key is shown only once. The first call below needs search: a key from a workspace without it is refused with forbidden.
Searches, lookups and geocodes are paid from your workspace's credits (see Price and limits). A key from a workspace that is out of credits is refused with out_of_credits. To add credits, see Buy credits.
A key belongs to your workspace, not to a person, and keeps working when the person who made it leaves. Every member of the workspace sees its keys on the Keys page. Keep a key on a server: anyone who reads it can make calls as your workspace. If a key leaks, revoke it on the Keys page and make another: a revoked key is refused at its next call. Do not rotate a leaked key, because a rotated key keeps working for 24 hours.
Make your first call#
A search for vacant lots zoned M-1 or PDR-1-G in San Francisco, outside flood zone AE, returns the lots that fit, each with the facts that matched and their sources.
Put your key in an environment variable:
export MAIA_API_KEY="maia_sk_..."Send the search:
curl https://api.maia-analytics.com/api/v1/search \
-H "Authorization: Bearer $MAIA_API_KEY" \
-H "Content-Type: application/json" \
-d '{"query": {"all": ["vacant lot", ["M-1", "PDR-1-G"]], "not": ["flood zone AE"]}, "region": {"county": ["San Francisco County, CA"]}, "limit": 3}'The reply looks like this; the values here are illustrative:
{
"output": "list",
"count": 41,
"results": [
{
"kind": "parcel",
"id": "06075:3780001",
"label": {
"parcel_number": "3780001",
"address": "1 Example St",
"neighborhood": "Bayview Hunters Point",
"use": "Vacant"
},
"values": {},
"matched": [
{"fact": "zoning district PDR-1-G", "sources": ["s1"]},
{"fact": "vacant lot", "sources": ["s2"]}
]
}
],
"sources": {
"s1": {"dataset": "Zoning Map - Zoning Districts", "publisher": "City and County of San Francisco"},
"s2": {"dataset": "Assessor Historical Secured Property Tax Rolls", "publisher": "City and County of San Francisco"}
},
"flags": [],
"cursor": "eyJ...",
"meta": {
"request_id": "6f1c2a...",
"cost_usd": "0.005",
"truncated": true,
"narrow": "Send cursor with the same request for the next page.",
"replayed": false
}
}This call is charged as one search, so its meta.cost_usd is "0.005". A reply with cursor has more results. Send the same request again with that cursor to read the next page.
Read the reply#
| Field | Type | Always there | Meaning |
|---|---|---|---|
output | Typestring | Always thereYes | Meaninglist, count or stats, as the request asked |
count | Typeinteger | Always thereYes | MeaningHow many results fit, over all pages |
results | Typelist | Always thereNo | MeaningA list's page of results. Each result is described below |
examples | Typelist | Always thereNo | MeaningFor count: a few of the results counted, in the same shape as results |
stats | Typeobject | Always thereNo | MeaningFor stats: each column's n, min, median, mean and max |
sources | Typeobject | Always thereNo | MeaningEach source a matched fact names, by its key: its dataset and, where on record, its publisher, licence and as_of date |
flags | Typelist | Always thereYes | MeaningWhat found nothing, was cut or was left out. Each flag names its part of the query, says what happened and what to do |
cursor | Typestring | Always thereNo | MeaningSet when more results fit than the page holds. Send it back with the same request for the next page. It is good for 60 minutes |
meta | Typeobject | Always thereYes | MeaningThe facts about the call: see Every reply |
Each result in results has these fields:
| Field | Meaning |
|---|---|
kind, id | MeaningWhat the result is (parcel or place), and the id that names it to MAIA |
label | MeaningWhat to call it. A parcel: parcel_number, address, neighborhood, use. A place: name, address, category, status, hours (by day, as text) and hours_source. A field MAIA has no record of is left out |
values | MeaningIts value for each column the request filtered or sorted by |
matched | MeaningThe facts about it that matched the query. Each names its sources by their keys in sources |
A reply is at most about 40 KB. A page that would be larger holds the results that fit, and its cursor reads on.
Calls#
Every call is a POST with a JSON body to https://api.maia-analytics.com/api/v1, with your key in the Authorization: Bearer header.
POST /search#
Finds parcels, or businesses and points of interest, by what public records say about them. Each search is charged from your workspace's credits: see Price and limits.
To send a search again safely, such as after a timeout, send an Idempotency-Key header with it: 1 to 255 printable characters, a new value for each new search. The same body sent again with the same key in the next 24 hours returns the first reply without running the search again, and is not charged again. That reply has meta.replayed set to true, the header Idempotent-Replayed: true and the first call's meta.request_id; its X-Request-Id header is its own. While the first call runs, the same call is refused with request_in_progress. The same key with another body is refused with idempotency_key_reused. A search that fails before it is charged frees its key, so sending it again runs it.
Search is open to every workspace with API access. A key from a workspace that MAIA has turned search off for is refused with forbidden.
| Field | Type | Required | Meaning |
|---|---|---|---|
query | Typestring or object | RequiredYes | MeaningWhat to find. Text is searched as one part. As parts: every item of all must hold, and each part of not takes away what it matches. An item is one part (a few words naming one thing, such as vacant lot, M-1 or Noe Valley) or a list of alternatives, any one of which counts. Name the narrowest thing in not: flood zone AE, not flood zone. At most 8 parts |
region | Typeobject | RequiredYes | MeaningThe broad place searched: {"county": ["San Francisco County, CA"]} or {"state": "CA"}. A place is its name or its FIPS code. Name a neighborhood as a part of the query, not as the region |
kind | Typestring | RequiredNo | MeaningThe kind of result: parcel (the default) or place, a business or point of interest. A place search returns only open places unless filters.status asks for others. sort and stats are for parcels only |
time | Typeobject | RequiredNo | MeaningWhen the facts must be true: {"from": "2023-01-01", "to": "2023-12-31", "match": "any"}, whole days in UTC, both included. Left out, today. Most records carry no dates and count as true at every time |
filters | Typeobject | RequiredNo | MeaningNarrows the results. A parcel search takes a minimum, a maximum or both for a column, such as {"acres": {"min": 0.5}}. The parcel columns and the place filters are listed below this table. A result with no value for a filter is left out |
output | Typestring | RequiredNo | Meaninglist (the default) returns the results; count how many there are, with a few examples; stats the count with the minimum, median, mean and maximum of each column. count and stats take no sort or cursor |
sort | Typeobject | RequiredNo | MeaningOrders a list by one column: {"by": "acres", "order": "desc"}. Left out, best match first |
limit | Typeinteger | RequiredNo | MeaningHow many results a page holds, 1 to 100 (default 10) |
cursor | Typestring | RequiredNo | MeaningA reply's cursor, exactly as given, with the same request, for the next page. Leave it out for a new search |
A parcel search can filter by these columns:
| Column | Meaning |
|---|---|
acres | MeaningThe parcel's lot area, in acres |
year_built | MeaningThe year the parcel's building was built |
total_value | MeaningThe parcel's total assessed value (land and improvements), in US dollars |
nearest_substation_m | MeaningThe straight-line distance from the parcel to the nearest electric substation, in metres |
nearest_transmission_line_m | MeaningThe straight-line distance to the nearest high-voltage transmission line (69 kV and up), in metres |
nearest_highway_m | MeaningThe straight-line distance to the nearest highway (a motorway or trunk road), in metres |
nearest_highway_ramp_m | MeaningThe straight-line distance to the nearest highway on- or off-ramp, in metres |
nearest_rail_transit_station_m | MeaningThe straight-line distance to the nearest rail transit station (subway, light rail, streetcar or monorail), in metres |
nearest_school_m | MeaningThe straight-line distance to the nearest K-12 school, in metres |
MAIA records no nearest_*_m distance beyond 80 km, so a filter on that column leaves such a parcel out.
A search with kind place returns only open places, unless filters.status asks for others. A place search takes these filters. A filter of the other kind is refused with invalid_request, and field is filters.<name>: for example acres on a place search, or status on a parcel search.
| Filter | Takes | Meaning |
|---|---|---|
status | Takes{"is": "open"}; is is open, temporarily_closed, permanently_closed or any | MeaningThe place's operating status. Left out, open |
open_on | Takes{"day": "mon"}, a day from mon to sun | MeaningIt has opening hours that day. A place with no recorded hours is not in the results |
open_after | Takes{"hour": "21:00", "day": "fri"}, with day optional | MeaningStill open after that time, on that day or on any day. A time before 05:00 is the night after that day. A place with no recorded hours is not in the results |
open_24_hours | Takes{"is": true} | MeaningRecorded as open the whole of every day. A place with no recorded hours is not in the results |
The reply is described in Read the reply.
A request the search will not run is refused with invalid_request: field names the field to change and detail says why. A search that cannot finish in its time limit is refused with timed_out: make it smaller (fewer or narrower parts, a filter, count in place of a sorted list) and send it again. While MAIA has paused search, every search, a next page included, is refused with at_capacity and no Retry-After: try again later. While your workspace is out of credits, every search, a next page included, is refused with out_of_credits before it runs.
POST /lookup#
Reads what MAIA holds about one parcel or place: every fact linked to it, or only the facts that answer your questions. A lookup that finds a parcel or place is charged one lookup from your workspace's credits; one that finds nothing (not_held) costs nothing. See Price and limits. A lookup counts toward your workspace's searches a minute.
Lookup is open to the same workspaces as search. A key from any other workspace is refused with forbidden.
To send a lookup again safely, send an Idempotency-Key header with it, as for a search: the same rules apply. A key already used for another call in the last 24 hours is refused with idempotency_key_reused. While your workspace is out of credits, a lookup is refused with out_of_credits before it runs.
Name the parcel or place by the id of a search result, or by a point, or name a parcel by its street address. A point resolves to the parcel it lies in, or the nearest within 25 m; for a place, the nearest place within 30 m. An address resolves to the parcel whose record holds it, from MAIA's own records only. An address that several parcels hold equally is refused with invalid_request (status 400): field is location.address, and detail names up to three of the parcels, each by address and id, and counts the others. Add a unit to the address, or send one parcel's id as location.id.
curl https://api.maia-analytics.com/api/v1/lookup \
-H "Authorization: Bearer $MAIA_API_KEY" \
-H "Content-Type: application/json" \
-d '{"location": {"point": {"lat": 37.7793, "lon": -122.4193}}, "questions": ["What is it zoned?"]}'| Field | Type | Required | Meaning |
|---|---|---|---|
location | Typeobject | RequiredYes | MeaningThe parcel or place, as exactly one of {"id": "<id of a search result>"}, {"point": {"lat": 37.7793, "lon": -122.4193}} or, for a parcel, {"address": "1 Dr Carlton B Goodlett Pl, San Francisco, CA"} |
kind | Typestring | RequiredNo | MeaningWhat the location names: parcel (the default) or place, a business or point of interest. An id must be of this kind |
questions | Typelist of string | RequiredNo | Meaning1 to 10 questions about it, in plain words, such as what is the zoning and height limit?. Each gets only the facts relevant to it. Left out, the reply holds every fact linked to it |
time | Typeobject | RequiredNo | MeaningWhen the facts must be true, as in a search: {"from": "2023-01-01", "to": "2023-12-31", "match": "any"}, whole days in UTC. Left out, today |
| Field | Type | Always there | Meaning |
|---|---|---|---|
status | Typestring | Always thereYes | Meaningresolved, or not_held when no parcel or place fits the location |
reason | Typestring | Always thereNo | MeaningWhy it is not held, when status is not_held |
result | Typeobject | Always thereNo | MeaningWhat the location matched: its kind, id, label and a point on it; matched_by (exact for an id or an address held as asked, close for an address held with differs or unchecked as in /geocode, within for a point inside a parcel, nearest with distance_m for a point on none); and candidates, the ids of others that also fit |
subjects | Typelist of object | Always thereNo | MeaningWithout questions: every fact, by subject. A fact has its field and value, its description where held, its sources by key into sources, and true: the days it holds |
questions | Typelist of object | Always thereNo | MeaningWith questions: each in order, with status found or nothing_relevant and only the facts relevant to it, by subject |
sources | Typeobject | Always thereNo | MeaningEach source a fact names, by key: its dataset, publisher and licence |
disagreements | Typelist of object | Always thereNo | MeaningWhere sources state the same thing differently: what each says, and when |
flags | Typelist of object | Always thereNo | MeaningWhat to know about the match or the reply, each with what it means |
time | Typeobject | Always thereNo | MeaningThe days the facts hold for |
meta | Typeobject | Always thereYes | MeaningThe facts about the call: see Every reply |
A request the lookup will not run is refused with invalid_request: field names the field to change and detail says why.
POST /geocode#
Finds the parcels MAIA holds at street addresses, or nearest to points, and gives MAIA's id for each: the id a search result has and /lookup takes. Every value in the reply comes from records MAIA holds. Each row MAIA holds, matched or ambiguous, is charged one geocode from your workspace's credits; a row that is not_held or refused costs nothing. See Price and limits.
Geocode is open to the same workspaces as search. A key from any other workspace is refused with forbidden.
To send a geocode again safely, send an Idempotency-Key header with it, as for a search: the same rules apply. A key already used for another call in the last 24 hours is refused with idempotency_key_reused. While your workspace is out of credits, a geocode is refused with out_of_credits before it runs.
curl https://api.maia-analytics.com/api/v1/geocode \
-H "Authorization: Bearer $MAIA_API_KEY" \
-H "Content-Type: application/json" \
-d '{"rows": [{"address": "1 Dr Carlton B Goodlett Pl, San Francisco, CA 94102"}, {"point": {"lat": 37.7793, "lon": -122.4193}}]}'| Field | Type | Required | Meaning |
|---|---|---|---|
rows | Typelist of object, 1 to 100 items | RequiredYes | MeaningEach row is exactly one of {"address": "..."}, a house number and street, then optionally a unit, city, state and ZIP, at most 300 characters; or {"point": {"lat": 37.7793, "lon": -122.4193}}. Send more than 100 rows in more calls |
| Field | Type | Always there | Meaning |
|---|---|---|---|
coverage | Typelist of object | Always thereYes | MeaningThe counties a row can be matched in, each with its county FIPS code, name and state |
rows | Typelist of object | Always thereYes | MeaningOne answer for each row sent, in the same order. Each is described below |
The reply also carries meta: see Every reply.
Each answer in rows has its index, counting from 0, and a status:
| `status` | Meaning |
|---|---|
matched | Meaningplace is the parcel |
ambiguous | MeaningMore than one parcel holds the address equally well. tied counts them and candidates lists up to 10 of them; MAIA does not pick one. Add the unit, city or state, or choose by county |
not_held | MeaningMAIA holds no parcel for the row, and reason says why |
refused | MeaningThe row can't be matched as sent: code is invalid_request, field names it, such as rows[2].address, and reason says why. The other rows are still answered |
A place, and each of the candidates, has these fields:
| Field | Meaning |
|---|---|
id, kind, county | MeaningMAIA's id for the parcel, parcel, and its county FIPS code |
address | MeaningThe address as MAIA's records hold it |
point | MeaningA point on the parcel: lat and lon |
match | MeaningFor an address, exact (held as sent) or close. For a point, within (the parcel holds it) or nearest, with distance_m |
differs | MeaningFor a close match: the street_type, direction or unit that differ from what was sent |
unchecked | MeaningFor a close match: the city or zip sent that MAIA's records can't confirm at the parcel |
A request MAIA will not run, such as one with no rows or more than 100, is refused whole with invalid_request: field names the field to change and detail says why.
POST /feedback#
Tells the MAIA team about a wrong result, an error or something MAIA can't do. The team reads each report but does not reply through the API.
curl https://api.maia-analytics.com/api/v1/feedback \
-H "Authorization: Bearer $MAIA_API_KEY" \
-H "Content-Type: application/json" \
-d '{"kind": "wrong_result", "message": "Search 6f1c2a... returned a parcel in flood zone AE."}'| Field | Type | Required | Meaning |
|---|---|---|---|
kind | Typewrong_result, error, missing_capability, feature_request, confusing, slow, praise or other | RequiredYes | MeaningWhat kind of report it is |
message | Typestring, up to 2,000 characters | RequiredYes | MeaningWhat was expected and what happened. Quote a reply's request_id. Leave out personal information |
impact | Typeblocked, worked_around or minor | RequiredNo | MeaningHow much it got in your way |
user_asked | Typeboolean | RequiredNo | Meaningtrue when a person asked for the report to be sent. Defaults to false |
| Field | Type | Always there | Meaning |
|---|---|---|---|
note | Typestring | Always thereYes | MeaningSent to the MAIA team. |
meta | Typeobject | Always thereYes | MeaningThe facts about the call: see Every reply |
Every reply#
Every reply, refused or not, carries the same facts about the call, in the body's meta and in headers.
| Field | Type | Always there | Meaning |
|---|---|---|---|
request_id | Typestring | Always thereYes | MeaningNames this call to MAIA. Also in the X-Request-Id header. Quote it in a feedback report |
cost_usd | Typestring | Always thereYes | MeaningWhat this call was charged, in US dollars, such as "0.005". A price under a cent keeps its places. "0.00" when the call was not charged |
limit | Typeobject | Always thereNo | MeaningThe calls left this minute: limit, remaining and resets_in_seconds |
truncated | Typeboolean | Always thereNo | Meaningtrue when the reply holds less than matched. Defaults to false |
narrow | Typestring | Always thereNo | MeaningHow to get the rest, when truncated is true |
replayed | Typeboolean | Always thereNo | Meaningtrue when this is the stored reply to an earlier /search, /lookup or /geocode with the same Idempotency-Key, not run or charged again. Defaults to false |
| Header | Meaning |
|---|---|
X-Request-Id | MeaningThe request id |
RateLimit-Limit, RateLimit-Remaining, RateLimit-Reset | MeaningThe calls a minute, the calls left, and the seconds until the minute starts again. On /search and /lookup they count your workspace's searches and lookups. On /geocode they report the key's calls or the workspace's rows, whichever has fewer left |
Retry-After | MeaningOn a refusal you can retry: the seconds to wait |
Idempotent-Replayed | Meaningtrue on a /search, /lookup or /geocode reply replayed for its Idempotency-Key |
Price and limits#
Searches, lookups and geocodes are paid from your workspace's credits. A search and a lookup cost the same over the API and MAIA's connector. Each reply's meta.cost_usd says what the call cost.
| Call | Price |
|---|---|
/search for a list | Price$0.005 a search ($5 per 1,000). It includes the search's first 10 results, counted over all its pages. Each result after those costs $0.001, on whichever page returns it. A list that finds nothing costs nothing |
/search for count | Price$0.005, also when nothing matches |
/search for stats | Price$0.008, also when nothing matches |
/lookup | Price$0.01 a lookup that finds a parcel or place ($10 per 1,000). A lookup that finds nothing costs nothing |
/geocode | Price$0.001 a row that is matched or ambiguous ($1 per 1,000 rows). A row that is not_held or refused costs nothing |
/feedback | PriceNot charged |
A call that is refused or fails costs nothing. A call sent again with its Idempotency-Key returns the first reply and is not charged again.
There are no free calls. When your workspace is out of credits, a search, a lookup or a geocode is refused with out_of_credits before it runs. Its detail says the date (UTC) your credits come back, when they will. To keep going before then, add credits: see Buy credits and Out of credits.
| Limit | Value |
|---|---|
| Searches | Value300 a minute for each workspace, over the API and MAIA's connector together. A next page counts like a first, and a lookup counts like a search |
| Geocode | Value30 calls a minute for each key, shared with /feedback, and 1,000 rows a minute for each workspace: a call of 100 rows counts 100. 1 to 100 rows a call |
| Feedback | Value30 calls a minute for each key, shared with /geocode, and 20 reports in each 24 hours |
| Keys that aren't valid | Value120 calls a minute from one address with a key that isn't valid. Past that, every call from the address is refused before its key is read, a valid key included |
| Page size | Value1 to 100 results (default 10). A reply is at most about 40 KB |
| Query | ValueAt most 8 parts |
| Cursor | ValueGood for 60 minutes |
Past a limit, a call is refused with limit_reached (status 429), and Retry-After says how many seconds to wait when the wait is known.
Errors#
A refused or failed call returns application/problem+json (RFC 9457 problem details):
{
"type": "tag:maia-analytics.com,2026:error:invalid_request",
"title": "The request can't be run as sent",
"status": 400,
"detail": "limit: must be at most 100.",
"code": "invalid_request",
"field": "limit",
"request_id": "6f1c2a...",
"meta": {"request_id": "6f1c2a...", "cost_usd": "0.00", "truncated": false, "replayed": false}
}Branch on code; it does not change. detail is written for a person and can change. field names the field to change, when one is at fault. A path the API does not have gets a plain 404 with {"detail": "..."}, not a problem object.
| `code` | Status | When | What to do |
|---|---|---|---|
invalid_request | Status400 | WhenThe body does not match the fields on this page, or it holds a cursor MAIA did not make | What to doChange the request as detail and field say |
unauthorized | Status401 | WhenNo key, or a key that is unknown or revoked | What to doCheck the key. Don't retry with a revoked key |
forbidden | Status403 | WhenThe call is not open to your workspace, your workspace is suspended, or its paid plan has not been paid | What to doDon't retry. Ask MAIA, or pay the plan |
not_found | Status404 | WhenThe call names something MAIA has no record of | What to doCheck the name |
idempotency_key_reused | Status422 | WhenThe Idempotency-Key was sent in the last 24 hours with another body, or to another call | What to doUse a new key for a new request |
request_in_progress | Status409 | WhenA call with this Idempotency-Key is still running | What to doSend it again after Retry-After seconds to get its reply |
limit_reached | Status429 | WhenToo many calls or geocode rows in a minute, too many calls from one address with a key that isn't valid, or the day's feedback reports are used | What to doWait Retry-After seconds, when it is set |
out_of_credits | Status402 | WhenYour workspace is out of credits. detail says the date (UTC) its credits come back, when they will | What to doAdd credits, or wait for that date. Don't retry before then |
at_capacity | Status503 | WhenMAIA has paused search. It has no Retry-After | What to doTry again later |
internal | Status500 | WhenMAIA failed | What to doRetry once. If it fails again, send a feedback report quoting request_id |
unavailable | Status503 | WhenMAIA is unavailable for a moment | What to doRetry after Retry-After seconds |
timed_out | Status504 | WhenA search could not finish in its time limit | What to doDon't send the same request again. Make it smaller and send it again |
Changes#
MAIA adds fields to replies, codes to the table above and optional fields to requests without notice, so ignore fields you don't know. Removing or renaming a field or a code, or changing what one means, happens only under a new version of the API (a new base URL), with notice, except that a field or a code no call returns can be removed without one. This page and /openapi.json follow each MAIA release.