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.
["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.
To obtain your API key, first sign in to your account and navigate to the API you want to use. From the API's Pricing section, choose a plan and complete the subscription process. Once subscribed, return to the API page and you will see your API Access Key displayed at the top of the documentation page. You can use this key 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.
The free trial lasts for 7 days and allows you to make up to 50 API requests.
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. If the API offers a free trial, you will see a "Free 7-Day Trial" option in its Pricing section. The trial lasts for 7 days and allows up to 50 API requests, enabling you to evaluate the API before subscribing to a paid plan.
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.
You can monitor your API usage through the response headers included with every request:
x-zyla-api-calls-monthly-used: Shows the total number of API requests you have used during the current billing period.
x-zyla-api-calls-monthly-remaining: Shows the number of API requests you have remaining for the current billing period.
Yes, you can cancel your subscription at any time. Simply go to the Pricing section of the API you're subscribed to and click the "Unsubscribe" button.
Please note that upgrades, downgrades, and cancellations take effect immediately. Once your subscription is canceled, access to the service will end immediately, regardless of any remaining API calls in your quota.
Please have a look at our Refund Policy: https://zylalabs.com/terms#refund
Service Level:
100%
Response Time:
467ms
Service Level:
100%
Response Time:
3,408ms
Service Level:
100%
Response Time:
240ms
Service Level:
90%
Response Time:
603ms
Service Level:
100%
Response Time:
638ms
Service Level:
100%
Response Time:
351ms
Service Level:
100%
Response Time:
819ms
Service Level:
100%
Response Time:
1,017ms
Service Level:
100%
Response Time:
97ms
Service Level:
100%
Response Time:
172ms
Service Level:
100%
Response Time:
138ms
Service Level:
100%
Response Time:
398ms
Service Level:
100%
Response Time:
276ms
Service Level:
100%
Response Time:
356ms
Service Level:
100%
Response Time:
2,378ms
Service Level:
100%
Response Time:
3,641ms
Service Level:
100%
Response Time:
1,610ms
Service Level:
100%
Response Time:
2,160ms
Service Level:
100%
Response Time:
1,552ms
Service Level:
100%
Response Time:
1,043ms