SearchAutocomplete
Autocomplete persons
Searches the person collection by full name and personal identity number. Returns slim autocomplete results. Requires the integrator-search-persons subscription feature.
This endpoint has stricter throttling, currentley maximum 120 requests per minute. Also it requires minimum 8 characters to be entered.
Authorization
x-api-keystringheaderrequiredYour API key, sent in the x-api-key header.
Bodyapplication/json
qstring | nullpageintegerper_pageinteger | nullResponses
Slim autocomplete response · application/json
foundintegerpageintegeroutOfintegersearchTimeMsintegerhitsPersonAutocomplete_Dto[] | nullHide child attributes
personIdintegerpersonalIdentityNumberstring | nullgivenNamestring | nullfirstNamestring | nullmiddleNamestring | nulllastNamestring | nullfolkbokforingsadressCareOfstring | nullfolkbokforingsadressStreetAddress1string | nullfolkbokforingsadressStreetAddress2string | nullfolkbokforingsadressPostalCodestring | nullfolkbokforingsadressCitystring | nullUpstream Typesense error
How the query is matched
The request carries only q, page and per_page. Everything else is fixed by the API, which searches the person collection as below.
| Field searched | Type | Description |
|---|---|---|
firstName | ||
middleName | ||
lastName | ||
personalIdentityNumber | ||
spar.folkbokforingsadress_SvenskAdress_Postort |
q- Required, at least 8 characters; anything shorter is answered with 400.
per_page- 1 to 5; omitted means 5, more is answered with 400.
- Always filtered
isProtected:=falsePeople with a protected identity are never returned.
- The last word is a prefix
- While someone types, the word under the cursor matches the start of a word: "volv" finds Volvo. Earlier words match whole.
- Typos are forgiven
- Words of 4 to 6 characters match with one typo, 7 or more with two. Shorter words must be exact.
- Words drop from the end
- When no hit contains every word, the last words are dropped until something matches, so a longer query narrows the list without emptying it.
- Ranked by text match
- Hits come back best match first (
_text_match:desc); there is no other sort.
Try the autocomplete
Type as your users would and watch the hits arrive through the proxy, listed the way an integration shows them.
Stored in this browser only (until you forget it) and sent as the x-api-key header through the documentation proxy.
Each pause while typing (300 ms) sends one request, which counts against your API key's quota.
curl -X POST "https://lens-api.tic.io/search-autocomplete/persons" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"page": 1,
"per_page": 5
}'