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-25). Defaults to 10. Out of range → 400 invalid_parameter. |
osm | boolean | no | true/false: include or exclude OpenStreetMap suggestions for this request only. Omitted = your organisation setting. Any other value → 400 invalid_parameter. |
Example request
curl "https://api.posty.ro/v1/addresses/autocomplete?q=cluj-napoca+eroilor" \
-H "Authorization: Bearer psk_live_xxx"Example response
{
"suggestions": [
{
"display": "bd. Eroilor, Cluj-Napoca, Cluj, 400129",
"components": {
"street": "bd. Eroilor",
"locality": "Cluj-Napoca",
"county": "Cluj",
"county_code": "CJ",
"postal_code": "400129"
},
"highlight": "bd. <em>Eroilor</em>, <em>Cluj-Napoca</em>, Cluj, 400129",
"score": 0.83,
"place_id": "psl_...",
"source": "gov"
},
{
"display": "Strada Avram Iancu, Florești, Cluj, 407280",
"components": {
"street": "Strada Avram Iancu",
"locality": "Florești",
"county": "Cluj",
"county_code": "CJ",
"postal_code": "407280"
},
"highlight": "Strada <em>Avram</em> <em>Iancu</em>, <em>Florești</em>, Cluj, 407280",
"score": 0.63,
"place_id": "pos_...",
"source": "osm"
}
],
"query": {
"q": "cluj-napoca eroilor",
"normalized": "cluj-napoca eroilor"
}
}Data sources: official and OpenStreetMap: Every autocomplete suggestion, verify response, batch result row and postal code lookup carries source: "gov" or "osm". Filter on it, or treat OpenStreetMap results differently, if your process accepts only official data.