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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
query | query | string | yes | The user's current input string. |
indexName | query | string | yes | Name of the index to query against. |
serviceName | query | string | yes | Name of the service that owns the index. |
regionId | query | string | no | Force a specific region. Omit to use latency-based auto-selection. |
weighted | query | boolean | no | If true, ranks results using integer weights stored alongside each record. |
latitude | query | number | no | Caller latitude, for geosearch-enabled indexes. |
longitude | query | number | no | Caller longitude, for geosearch-enabled indexes. |
Example request
curl -X GET \
'https://api.eztype.io/v1/search'Responses
200 — Ranked results. Each entry carries an id along with searchable fields.
{
"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.