Skip to content

Search and lookup

MAIA API tools

Through its connector, the MAIA API gives an assistant two tools. maia_search finds parcels and places by what public records say about them, and send_feedback sends a report to MAIA's team.

A workspace made in the connect step has these two tools and no others. It has no project, upload or run tools, and no prompts.

Finds parcels, and places (businesses and points of interest), from MAIA's index of public records, by what the records say about them: zoning, land use, flood zones, schools, districts, named areas and other mapped facts. It is read-only and covers San Francisco County, CA.

queryRequiredYesWhat it isWhat to find. Text, searched as one part, or the parts of the query as {"all": [...], "not": [...]}. At most 8 parts
kindRequiredNoWhat it isThe kind of result: parcel (the default) or place, a business or point of interest. sort and stats are for parcels only
regionRequiredYesWhat it isThe broad place searched: one county or state, by name or FIPS code, such as {"county": ["San Francisco County, CA"]}. A county region also sees that county's own codes, such as its zoning districts
timeRequiredNoWhat it isWhen the facts must be true, as whole days in UTC: from, to, and match as any (the default) or whole. Left out, it is today
filtersRequiredNoWhat it isFor parcels, a minimum, a maximum or both on a number each parcel holds: lot size in acres, the year built, the total assessed value, or the distance in metres to the nearest K-12 school, rail transit station, highway, highway ramp, electric substation or high-voltage transmission line. For places, whether a place is open and its opening hours
outputRequiredNoWhat it islist (the default) returns the results, count how many with a few examples, and stats the count with the minimum, median, mean and maximum of each column
sortRequiredNoWhat it isOrders a list by one column, asc (the default) or desc. Left out, the best match comes first
limitRequiredNoWhat it isHow many results a page holds, 1 to 100. The default is 10
cursorRequiredNoWhat it isA reply's cursor, with the same request, to read the next page. It is good for 60 minutes

The parts of a query#

Every item in all must hold for a result. An item is one part, a few words that name one thing, such as schools, M-1 or in the Mission. An item can also be a list of alternatives, any one of which counts, such as ["M-1", "RM-1"]. Each part in not is taken away.

{"all": ["schools", ["M-1", "RM-1"]], "not": ["flood zone"]}

MAIA reads nothing out of the text: "or" and "not" go in the structure, not in the words. MAIA joins only what its records already link. To combine results another way, make two searches and combine them.

What it returns#

outputWhat it islist, count or stats, as asked
resultsWhat it isFor a list, the page of results. Each has its kind and id, a label to name it by, its values for the columns filtered or sorted by, and the facts about it that matched the query, each naming its sources
examplesWhat it isFor a count, a few of the results counted
countWhat it isHow many results fit, over all pages
statsWhat it isFor stats, each column's count, minimum, median, mean and maximum
sourcesWhat it isEach source a matched fact names: its dataset and, where recorded, its publisher, licence and date
flagsWhat it isWhat found nothing, was cut or was left out, each with its part and what to do
cursorWhat it isSet when more results fit than the page holds
metaWhat it isThe call's request id, what it cost and its limits. See Pricing

When the matched facts are not what a part meant, rephrase that part and search again.

When it refuses#

  • A wrong request is refused with the name of the field and the reason.
  • A region outside San Francisco County is refused as not covered.
  • Too many searches in a minute: the reply says how many seconds to wait.
  • The workspace's credits are spent: a charged search is refused before it runs.
  • MAIA's team has paused the search: the reply says so, and the assistant answers from what it knows.

send_feedback#

Sends MAIA's team a report: a wrong or unusable result, an error, something MAIA cannot do, a feature request, a confusing reply, a slow answer, or praise. The assistant uses it when you ask, or when a MAIA tool failed or gave a wrong result, once for each problem.

kindRequiredYesWhat it iswrong_result, error, missing_capability, feature_request, confusing, slow, praise or other
messageRequiredYesWhat it isWhat was expected, what happened, and any workaround, up to 2,000 characters
user_askedRequiredYesWhat it isWhether the user asked for the report
impactRequiredNoWhat it isblocked, worked_around or minor
toolRequiredNoWhat it isThe MAIA tool the report is about
project_id, run_idRequiredNoWhat it isA project or run on the platform. An API workspace has none

The report is stored and reaches MAIA's team with your email, your workspace and the name of your client. The team reads each report and does not reply in the chat.