GET /google-maps/query_locate

Query Locate

Geocode a search query to latitude and longitude coordinates using Google Maps.

Google Maps Scraper API

Geocode a text query into geographic coordinates. This endpoint resolves a location name, address, or place description into precise latitude and longitude values, which can then be used with other endpoints like Search Nearby.

HTTP Request

1
GET /google-maps/query_locate

Parameters

ParameterTypeRequiredDefaultDescription
querystringYesThe location query to geocode (e.g., “New York City”, “1600 Amphitheatre Parkway”)
languagestringNo"en"Language code for the response
countrystringNo"us"Country code for regional bias
latnumberNoLatitude hint to bias results toward a specific area
lngnumberNoLongitude hint to bias results toward a specific area
zoomintegerNo7Map zoom level (3-21). Higher values give more precise local results

Response

1
2
3
4
5
6
7
{
  "status": "OK",
  "location": {
    "latitude": 40.7127753,
    "longitude": -74.0059728
  }
}

Response Fields

FieldTypeDescription
statusstringRequest status (OK or error code)
location.latitudenumberLatitude of the resolved location
location.longitudenumberLongitude of the resolved location

Code Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
import requests

url = "https://google-maps-extractor2.p.rapidapi.com/google-maps/query_locate"

querystring = {
    "query": "New York City",
    "language": "en",
    "country": "us",
    "zoom": "7"
}

headers = {
    "X-RapidAPI-Key": "YOUR_API_KEY",
    "X-RapidAPI-Host": "google-maps-extractor2.p.rapidapi.com"
}

response = requests.get(url, headers=headers, params=querystring)
data = response.json()

print(f"Latitude: {data['location']['latitude']}")
print(f"Longitude: {data['location']['longitude']}")
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
const url = "https://google-maps-extractor2.p.rapidapi.com/google-maps/query_locate";

const params = new URLSearchParams({
  query: "New York City",
  language: "en",
  country: "us",
  zoom: "7",
});

const response = await fetch(`${url}?${params}`, {
  method: "GET",
  headers: {
    "X-RapidAPI-Key": "YOUR_API_KEY",
    "X-RapidAPI-Host": "google-maps-extractor2.p.rapidapi.com",
  },
});

const data = await response.json();
console.log(`Latitude: ${data.location.latitude}`);
console.log(`Longitude: ${data.location.longitude}`);
1
2
3
4
5
6
7
curl -G "https://google-maps-extractor2.p.rapidapi.com/google-maps/query_locate" \
  --data-urlencode "query=New York City" \
  --data-urlencode "language=en" \
  --data-urlencode "country=us" \
  --data-urlencode "zoom=7" \
  -H "X-RapidAPI-Key: YOUR_API_KEY" \
  -H "X-RapidAPI-Host: google-maps-extractor2.p.rapidapi.com"
  • Search Nearby — Search for businesses using the coordinates returned by this endpoint
  • Locate and Search — Combine geocoding and business search in a single call
Start building today

Get your API key and make your first request in under a minute.

Get Your API Key on RapidAPI