Search

Query indexes for autocomplete and full-text results.

GET /v1/search

Run a search query

Returns ranked results matching the query string. Supports prefix matching for autocomplete-style queries, full-phrase matching for richer searches, and optional latitude/longitude bias for geo-aware ranking. Requests are routed to the region closest to the caller when regionId is omitted.

Authentication. Indexes marked PUBLIC are queryable anonymously. Any other index requires a Bearer key (sk-ezt-… or pk-ezt-srh-…); the key's tenant must own the index.

Each result carries an id — the stable, addressable identifier of the underlying record. Hold onto it; that's how you address records via the Records endpoints (e.g. GET /v1/indexes/{indexName}/records/{recordId}).

Parameters

NameInTypeRequiredDescription
queryquerystringyesThe user's current input string.
indexNamequerystringyesName of the index to query against.
serviceNamequerystringyesName of the service that owns the index.
regionIdquerystringnoForce a specific region. Omit to use latency-based auto-selection.
weightedquerybooleannoIf true, ranks results using integer weights stored alongside each record.
latitudequerynumbernoCaller latitude, for geosearch-enabled indexes.
longitudequerynumbernoCaller longitude, for geosearch-enabled indexes.

Example request

bash
curl -X GET \
  'https://api.eztype.io/v1/search'

Responses

200 — Ranked results. Each entry carries an id along with searchable fields.

json
{
  "suggestions": [
    {
      "id": "x1lGy50Bcp0W2C44-Se-",
      "title": "Sweden",
      "weight": 10402070,
      "images": [
        "https://flagcdn.com/32x24/se.png"
      ],
      "data": {}
    },
    {
      "id": "I1lGy50Bcp0W2C44-kSx",
      "title": "Switzerland",
      "weight": 8654622,
      "images": [
        "https://flagcdn.com/32x24/ch.png"
      ],
      "data": {}
    },
    {
      "id": "uVlGy50Bcp0W2C44-SrV",
      "title": "Swaziland",
      "weight": 1136281,
      "images": [
        "https://flagcdn.com/32x24/sz.png"
      ],
      "data": {}
    }
  ]
}

400 — Missing or malformed parameter.

401 — API key required (index is not PUBLIC) or supplied key is invalid.