GeoDataSource Location Search
geodatasource · Location
GeoDataSource™ Web Service is a REST API enable user to lookup for a city by using latitude and longitude coordinate. It will return the result in either JSON or XML containing the information of country, region, city, latitude and longitude. Visit https://www.geodatasource.com/web-service for further information.
Authentication
Sample Requests
Get City name by using latitude and longitude
Hover any highlighted part to learn what it does
curl -X GET "https://api.apis.guru/v2/specs/geodatasource.com/1.0/city?key=YOUR_API_KEY&lat=51.5074&lng=1&format=json"
import requests
params = {
"key": "YOUR_API_KEY",
"lat": "51.5074",
"lng": "1",
"format": "json"
}
response = requests.get(
"https://api.apis.guru/v2/specs/geodatasource.com/1.0/city",
params=params,
)
print(response.json())const url = new URL('https://api.apis.guru/v2/specs/geodatasource.com/1.0/city');
url.searchParams.set('key', 'YOUR_API_KEY');
url.searchParams.set('lat', '51.5074');
url.searchParams.set('lng', '1');
url.searchParams.set('format', 'json');
const response = await fetch(url);
const data = await response.json();
console.log(data);package main
import (
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
baseURL, _ := url.Parse("https://api.apis.guru/v2/specs/geodatasource.com/1.0/city")
q := baseURL.Query()
q.Set("key", "YOUR_API_KEY")
q.Set("lat", "51.5074")
q.Set("lng", "1")
q.Set("format", "json")
baseURL.RawQuery = q.Encode()
targetURL := baseURL.String()
req, _ := http.NewRequest("GET", targetURL, nil)
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}require "net/http"
require "json"
uri = URI("https://api.apis.guru/v2/specs/geodatasource.com/1.0/city")
uri.query = URI.encode_www_form({
"key" => "YOUR_API_KEY",
"lat" => "51.5074",
"lng" => "1",
"format" => "json"
})
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"
req = Net::HTTP::Get.new(uri)
res = http.request(req)
puts JSON.parse(res.body)<?php
$url = "https://api.apis.guru/v2/specs/geodatasource.com/1.0/city?" . http_build_query([
"key" => "YOUR_API_KEY",
"lat" => "51.5074",
"lng" => "1",
"format" => "json"
]);
$opts = ["http" => [
"method" => "GET",
]];
$ctx = stream_context_create($opts);
$res = file_get_contents($url, false, $ctx);
print_r(json_decode($res, true));Postman Setup Guide
- See official documentation for authentication and setup.
What can you build with GeoDataSource Location Search?
GeoDataSource Location Search is a Location API. Developers commonly use location APIs for:
- tracking assets and vehicles in real time
- building delivery and logistics apps
- finding nearby businesses or services
- geo-fencing and location-based notifications
- address validation and autocomplete
No authentication required. This API is open — no signup or key needed. Ideal for quick prototypes and public-facing features. GeoDataSource Location Search is free to use, making it a low-risk choice to experiment with.
New to APIs? Read our beginner's guide · Learn about API keys · What is REST?