The Location Database API is a dependable tool crafted to deliver precise city listings based on any country name. Whether you're developing a travel application, managing logistics, or building location-aware features, this API offers a core building block for incorporating geographic information into your solutions.
Businesses and developers alike can leverage this API to enrich user interactions through location-based functionality. For example, when a user selects their country, a real-time list of cities can be presented—streamlining onboarding, enhancing personalization, or enabling advanced filtering. Ideal for smart form completion, geographic segmentation, regional data insights, and responsive UI elements like dynamic dropdowns.
To use this endpoint you must indicate the name of a country in the parameter.
Cities by Country - Endpoint Features
| Object | Description |
|---|---|
country |
[Required] Indicates a country |
["Belišće","Bjelovar","Buzet","Cakovec","Crikvenica","Daruvar","Dubrovnik","Gospic","Gradac","Jastrebarsko","Karlovac","Kaštela","Koprivnica","Krk","Kutina","Makarska","Metkovic","Nova Gradiska","Ogulin","Opatija","Osijek","Petrinja","Porec","Pula","Rijeka","Rovinj","Samobor","Sesvete","Sibenik","Sisak","Slavonski Brod","Solin","Split","Umag","Varazdin","Velika Gorica","Vinkovci","Virovitica","Vukovar","Zadar","Zagreb","Zapresic","Zupanja","Đakovo"]
curl --location --request GET 'https://zylalabs.com/api/6424/location+database+api/9223/cities+by+country?country=Croatia' --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.
This endpoint returns a list of cities associated with a specified country. Each city entry typically includes details such as the city name, population, and geographical coordinates, providing comprehensive geographic information for integration into applications.
The response data includes key fields such as "city_name," "population," and "coordinates." These fields provide essential information for developers to utilize in location-based features and applications.
The response data is structured in a JSON format, with an array of city objects. Each object contains fields for city details, making it easy to parse and integrate into applications for dynamic user experiences.
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, ensuring accurate data retrieval.
Typical use cases include travel applications displaying city options for users, logistics platforms optimizing routes based on city locations, and forms that require users to select their city for personalized experiences.
Data accuracy is maintained through regular updates and validation against reliable geographic databases. Quality checks are implemented to ensure that city listings are current and reflect real-world changes.
Users can utilize the returned data by integrating it into dropdown menus for city selection, enhancing user onboarding processes, or employing it for geographic segmentation in marketing strategies.
If users receive partial or empty results, they should verify the country name for accuracy. Additionally, they can implement fallback mechanisms in their applications, such as suggesting nearby countries or cities based on user input.
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:
351ms
Service Level:
100%
Response Time:
454ms
Service Level:
100%
Response Time:
105ms
Service Level:
100%
Response Time:
127ms
Service Level:
100%
Response Time:
123ms
Service Level:
100%
Response Time:
4,407ms
Service Level:
100%
Response Time:
455ms
Service Level:
100%
Response Time:
1,614ms
Service Level:
100%
Response Time:
80ms
Service Level:
100%
Response Time:
223ms