Get Geolocation
curl --request GET \
--url https://api.lobstr.io/v1/googlemaps/locations \
--header 'Authorization: <authorization>'import requests
url = "https://api.lobstr.io/v1/googlemaps/locations"
headers = {"Authorization": "<authorization>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<authorization>'}};
fetch('https://api.lobstr.io/v1/googlemaps/locations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.lobstr.io/v1/googlemaps/locations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.lobstr.io/v1/googlemaps/locations"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<authorization>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.lobstr.io/v1/googlemaps/locations")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lobstr.io/v1/googlemaps/locations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<authorization>'
response = http.request(request)
puts response.read_bodyGoogle Maps Leads Scraper
Get Geolocation
Fetch valid regions, districts, and cities for parameter-based tasks
GET
/
v1
/
googlemaps
/
locations
Get Geolocation
curl --request GET \
--url https://api.lobstr.io/v1/googlemaps/locations \
--header 'Authorization: <authorization>'import requests
url = "https://api.lobstr.io/v1/googlemaps/locations"
headers = {"Authorization": "<authorization>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<authorization>'}};
fetch('https://api.lobstr.io/v1/googlemaps/locations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.lobstr.io/v1/googlemaps/locations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.lobstr.io/v1/googlemaps/locations"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<authorization>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.lobstr.io/v1/googlemaps/locations")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lobstr.io/v1/googlemaps/locations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<authorization>'
response = http.request(request)
puts response.read_bodyUse this endpoint to fetch valid regions, districts, and cities used in parameter-based tasks for the Google Maps Search Export crawler. This is essential when constructing structured tasks where accurate location inputs are required.
Headers
string
required
Your API authentication token. Value:
Token YOUR_API_KEYQuery Parameters
string
required
ISO 2-letter country code. Example:
USstring
State or province name. Example:
Californiastring
County or local district. Example:
San Diegostring
City name filter
How It Works
The value you leave empty determines what the API returns:- Leave
regionempty to get regions for a country - Provide
region, leavecityempty to get cities in that region - Provide
districtto narrow down the city list further
Query Parameters
| Parameter | Required | Description |
|---|---|---|
| country_code | Yes | ISO 2-letter country code (e.g., US, FR, PK) |
| region | Conditional | Required when querying districts or cities. Leave empty to get regions. |
| district | No | Narrows the city list within a region |
| city | No | Used when retrieving a refined list of locations |
Use the returned values for
region, district, and city in parameter-based tasks.Combine location values with
category to generate accurate search inputs.Code Examples
curl -X GET "https://api.lobstr.io/v1/googlemaps/locations?country_code=US®ion=California&city" \
-H "Authorization: Token YOUR_API_KEY"
import requests
API_KEY = "YOUR_API_KEY"
BASE_URL = "https://api.lobstr.io/v1"
headers = {"Authorization": f"Token {API_KEY}"}
# Get cities in California, US
response = requests.get(f"{BASE_URL}/googlemaps/locations",
headers=headers,
params={
"country_code": "US",
"region": "California",
"city": ""
}
)
cities = response.json()
print(f"Found {len(cities)} cities")
for city in cities[:10]:
print(f" {city}")
Response
200
[
"Acampo 95220",
"Acton 93510",
"Adelanto 92301",
"Adin 96006",
"Agoura Hills 91301",
"Agoura Hills 91376",
"Aguanga 92536",
"Ahwahnee 93601",
"Alameda 94501",
"Alameda 94502",
"Alamo 94507",
"Albany 94706",
"Albion 95410",
"Alderpoint 95511",
"Alhambra 91801",
"Alhambra 91802",
"Alhambra 91803"
]