Autocomplete
Real-time address suggestions, typo- and diacritic-tolerant.
GET
/v1/addresses/autocompleteQuery parameters
| Name | Type | Required | Description |
|---|---|---|---|
q | string | yes | The text typed by the user. Two characters minimum. |
limit | integer | no | Maximum number of suggestions (1-10). Defaults to 5. |
county | string | no | Filter by county (code or name). |
Example request
curl https://api.posty.ro/v1/addresses/autocomplete?q=Mihai+Vit \
-H "Authorization: Bearer psk_live_xxx"Example response
{
"suggestions": [
{
"text": "Strada Mihai Viteazu 12, Cluj-Napoca, Cluj",
"locality": "Cluj-Napoca",
"county": "Cluj",
"postal_code": "400151"
},
{
"text": "Strada Mihai Viteazu, Cluj-Napoca, Cluj",
"locality": "Cluj-Napoca",
"county": "Cluj",
"postal_code": "400xxx"
}
],
"request_id": "req_01J9Z8H..."
}