Localities
Resolve a SIRUTA code to its locality, county and parent.
GET
/v1/localities/{siruta}Resolves a SIRUTA code to its locality. Uses the official baseline only, never OpenStreetMap. A billed lookup, like Postal lookup, cached for 1 hour (ETag, 304). Requires the postal_lookup scope.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
siruta | integer | yes | The locality SIRUTA code (1 - 2147483647). Anything else → 400 invalid_parameter. |
If-None-Match | header | no | The ETag of an earlier response. If it matches you get a 304 with no body (billed like a 200). |
Example request
curl https://api.posty.ro/v1/localities/54975 \
-H "Authorization: Bearer psk_live_xxx"Example response
{
"siruta": 54975,
"name": "Cluj-Napoca",
"type": "municipiu",
"county_code": "CJ",
"county": "Cluj",
"parent": null
}type: one of municipiu, oras, comuna, sat or sector.parent: The containing locality, for example Bucuresti for a sector; null otherwise.
Common errors
400 invalid_parameter: siruta is not an integer in range.404 locality_not_found: no locality has this SIRUTA code.403 insufficient_scope: the key lacks the postal_lookup scope.