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.
Returns detailed geographic information such as country, region, and coordinates based on the name of a city provided as a parameter.
[{"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/10887/city+location+capture+api/20592/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.
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:
1,614ms
Service Level:
100%
Response Time:
635ms
Service Level:
100%
Response Time:
6,817ms
Service Level:
100%
Response Time:
0ms
Service Level:
100%
Response Time:
62ms
Service Level:
100%
Response Time:
80ms
Service Level:
100%
Response Time:
747ms
Service Level:
100%
Response Time:
264ms
Service Level:
100%
Response Time:
105ms
Service Level:
100%
Response Time:
123ms
Service Level:
100%
Response Time:
9,182ms
Service Level:
100%
Response Time:
12,696ms
Service Level:
100%
Response Time:
15,318ms
Service Level:
100%
Response Time:
10,129ms
Service Level:
100%
Response Time:
0ms
Service Level:
100%
Response Time:
1,397ms
Service Level:
100%
Response Time:
684ms
Service Level:
100%
Response Time:
284ms
Service Level:
100%
Response Time:
1,310ms
Service Level:
100%
Response Time:
2,009ms