GET https://external-api.lia.com.br/external_api/v1/cities
Query params
| Name | Description | Required | Type |
|---|---|---|---|
| state_id | Only cities of this state. An unknown ID returns an empty list | false | String |
| search | Only cities whose name contains this text. Case is ignored but accents are not: porto matches Porto Alegre, sao does not match São Paulo | false | String |
The two filters can be combined.
This endpoint has no pagination. A call without filters returns every city in a single response, so filter by state_id or search whenever you can. The list is not sorted.
Example request
curl --location 'https://external-api-sandbox.lia.com.br/external_api/v1/cities?search=porto%20alegre' \
--header 'Authorization: Bearer YOUR_API_TOKEN'
Example response
[
{
"ibge_code": "5106778",
"id": "e1b75c77-afde-5d91-9a8f-30703b048811",
"name": "Porto Alegre do Norte",
"state": {
"acronym": "MT",
"id": "66c9dce7-58c8-546e-bb35-a359b19cfc23",
"name": "Mato Grosso"
},
"state_id": "66c9dce7-58c8-546e-bb35-a359b19cfc23"
},
{
"ibge_code": "2208551",
"id": "a2cf7073-e118-5847-8da4-df88c8f42a9d",
"name": "Porto Alegre do Piauí",
"state": {
"acronym": "PI",
"id": "5aa03006-b83e-520a-8c84-d2f300872477",
"name": "Piauí"
},
"state_id": "5aa03006-b83e-520a-8c84-d2f300872477"
},
{
"ibge_code": "4314902",
"id": "f100660d-738a-5893-8763-6e281591aff1",
"name": "Porto Alegre",
"state": {
"acronym": "RS",
"id": "4fd53b54-3c2c-5f39-95b7-903091ea96cf",
"name": "Rio Grande do Sul"
},
"state_id": "4fd53b54-3c2c-5f39-95b7-903091ea96cf"
},
{
"ibge_code": "1718006",
"id": "61c4acdb-7fb3-566e-8ab1-20008bd31799",
"name": "Porto Alegre do Tocantins",
"state": {
"acronym": "TO",
"id": "7acb0b29-fb1b-58f2-8f2b-80acd1f7f913",
"name": "Tocantins"
},
"state_id": "7acb0b29-fb1b-58f2-8f2b-80acd1f7f913"
}
]
Example request filtered by state
curl --location 'https://external-api-sandbox.lia.com.br/external_api/v1/cities?state_id=4fd53b54-3c2c-5f39-95b7-903091ea96cf&search=porto%20alegre' \
--header 'Authorization: Bearer YOUR_API_TOKEN'
Example response filtered by state
[
{
"ibge_code": "4314902",
"id": "f100660d-738a-5893-8763-6e281591aff1",
"name": "Porto Alegre",
"state": {
"acronym": "RS",
"id": "4fd53b54-3c2c-5f39-95b7-903091ea96cf",
"name": "Rio Grande do Sul"
},
"state_id": "4fd53b54-3c2c-5f39-95b7-903091ea96cf"
}
]