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/10889/city+location+data+extractor+api/20593/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.
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:
80ms
Service Level:
100%
Response Time:
351ms
Service Level:
100%
Response Time:
503ms
Service Level:
100%
Response Time:
1,614ms
Service Level:
100%
Response Time:
223ms
Service Level:
100%
Response Time:
74ms
Service Level:
100%
Response Time:
58ms
Service Level:
100%
Response Time:
4,352ms
Service Level:
100%
Response Time:
79ms
Service Level:
100%
Response Time:
268ms