Using the Typeahead API
This is documentation for the Regrid Typeahead API, a separate endpoint that couples nicely with our Parcel API. Please see the Parcel API documentation for full reference on the Parcel API.
Requests
The endpoint is accessible via GET requests at:
https://app.regrid.com/api/v2/parcels/typeahead
Example request
GET https://app.regrid.com/api/v2/parcels/typeahead?token=TOKEN&query=407+e+f
Query parameters
token
: Your Regrid authorization token.query
: A street address or partial address, starting at the beginning
Response
You'll receive an object containing a GeoJSON Feature Collection containing a list of Features of matching results like the following. Note this is a lighter-weight response than our regular Parcel API and includes a few essential fields for display and/or further queries to the API.
Response fields
-
parcel_centroids
: A GeoJSON Features Collection of Features, sorted by descending relevance rank, containing a subset of parcel fields and a Point geometry for the centroid of each Parcel Record.geometry
: A GeoJSON Point geometry of the parcel centroid. Note that this is in 'lon, lat' order.properties
ll_uuid
: Our unique parcel identifier, which can be used for more detailed lookups.score
: A confidence score between 0 and 100 of the match quality.context
: The city and state where this parcel was found in printable form.path
: The unique parcel "path" that can be used for API lookups or on the web (e.g. https://app.regrid.com/us/mi/wayne/detroit/181893).address
: The parcel address.
Example response
Notes
This is designed to accept natural input the way a user might type into a search box, including appending a city, state, or ZIP code to the query. We try our best to parse it intelligently and return meaningful results in real time. These would be acceptable queries
"407 e fort detroit"
"407 e fort detroit mi"
"407 e fort 48226"
Integrating the Typeahead API into your app
We suggest connecting your UI search widget directly to our API endpoints for the most responsive experience as users type an address.
Fetching complete parcel record details
We send a lightweight JSON response in the Typeahead API, including enough information to display results and allow a more complete lookup. To retrieve the full set of data fields for a parcel record, including geometry, please use our Parcel API to look up a record by ll_uuid, using a UUID chosen from the typeahead response.
Example client implementation (Javascript)
Here is a sample snippet using the typeahead.js library initially developed by Twitter. It supports search-as-you-type, displaying matches in a dropdown menu, and taking an action when a result is selected.
Notes for client implementation
There are two types of addresses that get loaded, one with address without city, state and zip and a complete address with city, state and zip. We use two sources for the address and provide all options. They are sorted by most relevant to what is entered in the query. The ll_uuid for the address is still the same but this gives the user the flexibility to choose which format to ingest. This also helps when a parcel address has multiple units or secondary addresses.
If you are implementing Typeahead API and interested in one result, you can add a client-side filter in Javascript to keep only the first entry for each ll_uuid.