
A Web Service is a software service used to communicate between two electronic devices over a network.
GeoDataSource Location Search Web Service is a REST API that allows the user to lookup for city information by providing the location coordinate in the latitude and longitude form. It will return the result in either JSON or XML format which contains the information of the nearest country, region, city, latitude, longitude, currency code, currency name, currency symbol, time of sunrise, time of sunset, time zone and distance of input coordinate with the city.
The plan of this Web Service consists of different packages depends on the number of credits. Paid plan of this Web Service will be auto-renewed and auto-recharged monthly. Below are the details of the Web Service package.
Package | Price |
Location Search Web Service (500 credits) | FREE |
Location Search Web Service (10,000 credits) | $50.00 USD/month |
Location Search Web Service (50,000 credits) | $125.00 USD/month |
Location Search Web Service (250,000 credits) | $300.00 USD/month |
The GeoDataSource Location Search Web Service consists of two APIs, Nearest City API and Nearest Cities API. Nearest City API will only return one result whereas the Nearest Cities API will return the list of cities within 20km. The benefit of using a Web Service is that no database is required to be downloaded, to be installed or to be upgraded on the server side. In order to get the city information, the Web Service can be called by the following syntax.
The syntax for Nearest City API:
GET https://api.geodatasource.com/v2/city
The syntax for Nearest Cities API:
GET https://api.geodatasource.com/v2/cities
Both API requests accept the following parameters:
Parameter | Type | Description |
key | string | (required) API key. |
lat | double | (required) Latitude of a location. |
lng | double | (required) Longitude of a location. |
format | string | (optional) Return the result in json (default) or xml format. Valid values: json | xml |
The example of response message:
{
"country":"US",
"region":"California",
"city":"Mountain View",
"latitude":37.3861,
"longitude":-122.084,
"currency_code":"USD",
"currency_name":"United States Dollar",
"currency_symbol":"$",
"sunrise":"06:45",
"sunset":"19:35",
"time_zone":"-08:00",
"distance_km":0.0001
}
For more details about the GeoDataSource Location Search Web Service, please check it out at:
https://www.geodatasource.com/web-service/location-search