21
I’ve been searching for some json API that lists the states of a particular country, or cities of a particular state, I’ve searched for this feature for several Google Maps Apis but I couldn’t find anything that was exactly for this.
I don’t want to use a DB with a list of states and cities because I believe it lacks flexibility and is something quite heavy.
Note: the need is to create a combobox of countries, states and cities, but I can use a list of countries straight from the database without any problem, but if there is an API that provides this list is also better.
There’s a good option?
There are already good answers here about this, in particular for cities PT & BR. That suits you or want cities from all over the world?
– Sergio
Yes, I’m going to need a list of all the countries, and then I’m going to request a list of states, and cities for each state.
– Rafael Alexandre
I’ve been looking for something similar and found this JSON on Github that may be useful.
– Carlos Bazilio
I know it’s a bit old, but it can help others Use the IBGE API for this, more reliable source is impossible. Follow documentation: https://servicodados.ibge.gov.br/api/docs/localities
– Bozohrj
just for the record, da para usar a api do google maps também.
– Leandro RR
Not using BD is complicated by being dependent on third party API, I already have a migrate to cities and states I use in Laravel. For your case the IBGE solution mentioned above would be the best option.
– Matheus Marques
I found another API with states and municipalities in Brazil that has been very useful to me, this one is: https://www.back4app.com/database/back4app/api-estados-cidades-brasil
– Charles