EasyAgentIDX

Typeahead

The typeahead endpoint powers location autocomplete inputs. Given a partial search string, it returns a list of matching cities, ZIP codes, neighborhoods, and specific addresses.

Endpoint

GET /api/v1/typeahead

Query parameters

ParameterTypeRequiredDescription
qstringYesSearch string. Minimum 2 characters required.
limitintegerNoMaximum suggestions. Default 5, maximum 10.

Response shape

The data field contains an array of suggestion objects:

{ "data": [
  { "id": "...", "label": "La Jolla, CA", "type": "city", "city": "La Jolla", "state": "CA" },
  { "id": "...", "label": "92037", "type": "zip", "zip": "92037" }
] }
FieldTypeDescription
labelstringPrimary display text for the suggestion
idstringStable suggestion identifier
typestringcity, zip, neighborhood, address, or county
city, state, zipstringOptional normalized location fields

Example request

Typeahead
curl -H "Authorization: Bearer eai_YOUR_KEY" \
  -H "X-EAI-Site-ID: site_YOUR_SITE_ID" \
  "https://app.easyagentidx.com/api/v1/typeahead?q=La+Jolla"
→ 200 OK { "data": [...suggestions] }

Usage guidance

Debounce calls to this endpoint by at least 300ms to avoid excessive requests while the user is typing. Cache responses for identical query strings within a session to reduce API usage.