This API allows you to obtain structured geographic information based on the name of a city provided as input. When a request is made with the name of a city, the API responds with a detailed data set in JSON format. The response structure includes an object representing the city queried and contains various attributes useful for geolocation or geographic analysis.
The main object contains a unique identifier called geo_id, which uniquely represents that city in the system. It also includes the name of the city (name), along with the corresponding administrative subdivision, which can be a state, region, or district, and is represented in the state_or_region field. In addition, detailed information about the country to which the city belongs is provided through a nested object within the country property, which includes the country code in ISO format (code) and the full name of the country (name).
Geographically, the response contains the exact coordinates of the city, expressed in two fields: latitude and longitude. These values allow the city to be accurately located on maps or integrated with geographic information systems (GIS), map services, mobile applications with geolocation, among others.
The structure of the response is designed to be easy to interpret and consume by web applications, mobile applications, or backend services that need to translate a city name into coordinates or standardized geographic information. It is also useful for tasks such as location validation, coverage analysis, data visualization on maps, or simply to obtain basic data about a location.
In short, this API facilitates the conversion of city names into complete, standardized, and accurate geographic information that can be easily integrated into different types of applications or data flows that depend on geographic locations.
[{"geo_id": 2968496, "name": "Villeparisis", "state_or_region": "\u00cele-de-France", "country": {"code": "FR", "name": "France"}, "latitude": 48.942081, "longitude": 2.61463}, {"geo_id": 2988507, "name": "Paris", "state_or_region": "\u00cele-de-France", "country": {"code": "FR", "name": "France"}, "latitude": 48.853409, "longitude": 2.3488}, {"geo_id": 3023645, "name": "Cormeilles-en-Parisis", "state_or_region": "\u00cele-de-France", "country": {"code": "FR", "name": "France"}, "latitude": 48.971111, "longitude": 2.20491}, {"geo_id": 3725276, "name": "Fond Parisien", "state_or_region": "Ouest", "country": {"code": "HT", "name": "Haiti"}, "latitude": 18.505831, "longitude": -71.976669}]
curl --location --request GET 'https://zylalabs.com/api/10890/city+location+data+retrieval+api/20595/city+information&city_name=Required' --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 API returns structured geographic information for a specified city, including its name, administrative region, country details, and precise coordinates (latitude and longitude) in JSON format.
Key fields in the response include `geo_id` (unique city identifier), `name` (city name), `state_or_region` (administrative subdivision), `country` (nested object with `code` and `name`), `latitude`, and `longitude`.
The response is structured as an array of objects, each representing a city. Each object contains fields for geographic and administrative details, making it easy to parse and utilize in applications.
The API provides information on city names, geographic coordinates, administrative regions, and country details, enabling users to obtain comprehensive location data for various applications.
Users can customize requests by specifying the city name as a parameter in the GET request. The API will return data for the exact city name provided, allowing for targeted queries.
Typical use cases include geolocation services, mapping applications, location validation, data visualization, and geographic analysis, where accurate city information is essential.
Data accuracy is maintained through regular updates and validation against reliable geographic databases, ensuring that the information provided is current and precise.
If the API returns partial or empty results, users should verify the city name for accuracy or consider alternative names or spellings. Implementing error handling in applications can also manage such scenarios effectively.
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:
62ms
Service Level:
100%
Response Time:
503ms
Service Level:
100%
Response Time:
58ms
Service Level:
100%
Response Time:
351ms
Service Level:
100%
Response Time:
1,614ms
Service Level:
100%
Response Time:
223ms
Service Level:
100%
Response Time:
240ms
Service Level:
100%
Response Time:
105ms
Service Level:
100%
Response Time:
79ms
Service Level:
100%
Response Time:
74ms