The Geographic Data API is a robust and dependable tool that delivers an accurate list of cities based on a given country name. Ideal for travel apps, logistics platforms, and location-based services, it provides a solid foundation for integrating geographic data into your systems.
Developers and businesses can leverage this API to enrich user experiences with location-aware features. For example, when a user selects their country, the API can instantly populate a list of cities, streamlining onboarding and enabling personalized interactions. It's particularly effective for form autocompletion, filtering options, regional insights, and dynamic dropdown menus.
To use this endpoint you must indicate the name of a country in the parameter.
Obtain Cities - Endpoint Features
| Object | Description |
|---|---|
country |
[Required] Indicates a country |
["Acapulco","Acuna","Aguascalientes","Ajijic","Alamos, Sonora","Atotonilco el Alto","Azcapotzalco","Boca del Rio","Bucerias","Cabo San Lucas, Baja California Sur","Campeche","Cancun","Celaya","Champotón","Chapala","Chihuahua","Chilpancingo De Los Bravo","Cholula","Ciudad Juarez","Ciudad Lerdo","Ciudad Obregon","Ciudad Rio Bravo","Ciudad Victoria","Ciudad del Carmen","Coatzacoalcos","Colima","Cozumel","Cuajimalpa","Cuauhtémoc","Cuautitlan Izcalli","Cuautla","Cuernavaca","Culiacan","Durango","Ecatepec","Ensenada","Guadalajara","Guadalupe","Guadelupe","Guanajuato","Hermosillo","Irapuato","La Paz","Lazaro Cardenas","Leon","León de los Aldama","Loc Cabo","Los Cabos","Los Mochis","Manzanillo","Matamoros","Mazatlan","Merida","Mexicali","Mexico City","Miguel Hidalgo","Monclova","Monterrey","Morelia","Naucalpan de Juárez","Nogales","Nuevo Laredo","Oaxaca","Oaxaca de Juarez","Pachuca","Parral","Piedras Negras","Playa del Carmen","Puebla","Puerto Escondido","Puerto Penasco","Puerto Vallarta","Queretaro (Santiago de Querétaro)","Reynosa","Rosarito","Salamanca","Saltillo","San Andres Tuxtla","San Cristobal de las Casas","San Felipe","San Fernando","San Luis Potosi","San Luis Rio Colorado","San Miguel de Allende","San Pedro Garza Garcia","Santa Clara de Valladares","Tampico","Tapachula","Tehuacan","Tepic","Texcoco de Mora","Tianguistenco de Galeana","Tijuana","Tlajomulco de Zúñiga","Tlalnepantla","Tlalpan","Tlaxcala","Todos Santos","Toluca","Torreon","Tulum","Tuxtla Gutierrez","Uruapan del Progreso","Veracruz","Villahermosa","Xalapa, Veracruz","Xilitla","Zacapoaxtla","Zacatecas","Zamora de Hidalgo","Zapopan","Zihuatanejo"]
curl --location --request GET 'https://zylalabs.com/api/6426/geographic+data+api/9225/obtain+cities?country=Mexico' --header 'Authorization: Bearer YOUR_API_KEY'
| Header | Description |
|---|---|
Authorization
|
[Required] Should be Bearer access_key. See "Your API Access Key" above when you are subscribed. |
No long-term commitment. Upgrade, downgrade, or cancel anytime. Free Trial includes up to 50 requests.
The Obtain Cities endpoint returns a list of cities within a specified country. Each city entry typically includes key details such as city name, population, and geographical coordinates.
The response data includes fields such as "city_name," "population," and "coordinates" (latitude and longitude). These fields provide essential information for location-based applications.
The response data is structured as a JSON array, where each city is represented as an object containing its respective fields. This allows for easy parsing and integration into applications.
The primary parameter for this endpoint is the "country" name. Users must specify the exact name of the country to retrieve the corresponding list of cities.
Users can customize requests by specifying the country name accurately. Future enhancements may include additional parameters for filtering results, such as population size or region.
The data is sourced from reliable geographic databases and government records, ensuring a high level of accuracy and comprehensiveness for the cities listed.
Typical use cases include travel applications that need to display city options, logistics platforms requiring city data for routing, and any app that benefits from location-aware features like form autocompletion.
If the response returns empty or partial results, users should verify the country name for accuracy. Implementing fallback options, such as suggesting nearby countries or cities, can enhance user experience.
Please have a look at our Refund Policy: https://zylalabs.com/terms#refund
To obtain your API key, you first need to sign in to your account and subscribe to the API you want to use. Once subscribed, go to your Profile, open the Subscription section, and select the specific API. Your API key will be available there and can be used to authenticate your requests.
You can’t switch APIs during the free trial. If you subscribe to a different API, your trial will end and the new subscription will start as a paid plan.
If you don’t cancel before the 7th day, your free trial will end automatically and your subscription will switch to a paid plan under the same plan you originally subscribed to, meaning you will be charged and gain access to the API calls included in that plan.
The free trial ends when you reach 50 API requests or after 7 days, whichever comes first.
No, the free trial is available only once, so we recommend using it on the API that interests you the most. Most of our APIs offer a free trial, but some may not include this option.
Yes, we offer a 7-day free trial that allows you to make up to 50 API calls at no cost, so you can test our APIs without any commitment.
Zyla API Hub is like a big store for APIs, where you can find thousands of them all in one place. We also offer dedicated support and real-time monitoring of all APIs. Once you sign up, you can pick and choose which APIs you want to use. Just remember, each API needs its own subscription. But if you subscribe to multiple ones, you'll use the same key for all of them, making things easier for you.
Service Level:
100%
Response Time:
467ms
Service Level:
100%
Response Time:
3,408ms
Service Level:
90%
Response Time:
616ms
Service Level:
100%
Response Time:
819ms
Service Level:
100%
Response Time:
351ms
Service Level:
100%
Response Time:
638ms
Service Level:
100%
Response Time:
1,017ms
Service Level:
100%
Response Time:
251ms
Service Level:
100%
Response Time:
97ms
Service Level:
100%
Response Time:
172ms
Service Level:
100%
Response Time:
1,635ms
Service Level:
100%
Response Time:
2,004ms
Service Level:
100%
Response Time:
2,010ms
Service Level:
100%
Response Time:
1,377ms
Service Level:
100%
Response Time:
1,187ms
Service Level:
100%
Response Time:
1,344ms
Service Level:
100%
Response Time:
1,384ms
Service Level:
100%
Response Time:
1,479ms
Service Level:
100%
Response Time:
1,307ms
Service Level:
100%
Response Time:
1,383ms