Google Maps Search API (Async)
The Google Maps Search API endpoint returns Google Maps Search result page and transform it into usable JSON.
Single Query Request
curl -X POST \
-H "Content-Type: application/json" \
-d '{
"apiKey": "API_KEY",
"query": "QUERY",
"latitude": LATITUDE,
"longitude": LONGITUDE,
"callback": {
"type": "webhook",
"url": "YYYYYY"
}
}' \
"https://async.scraperapi.com/structured/google/mapssearch"import requests
url = "https://async.scraperapi.com/structured/google/mapssearch"
headers = {
"Content-Type": "application/json"
}
data = {
"apiKey": "API_KEY",
"query": "QUERY",
"latitude": LATITUDE,
"longitude": LONGITUDE,
"callback": {
"type": "webhook",
"url": "YYYYY"
}
}
response = requests.post(url, json=data, headers=headers)
print(response.text)Multiple Queries Request
curl -X POST \
-H "Content-Type: application/json" \
-d '{
"apiKey": "API_KEY",
"jobs": [
{
"query": "QUERY1",
"latitude": LATITUDE_1,
"longitude": LONGITUDE_1,
"callback": {
"type": "webhook",
"url": "YYYYYY"
}
},
{
"query": "QUERY2",
"latitude": LATITUDE_2,
"longitude": LONGITUDE_2,
"callback": {
"type": "webhook",
"url": "YYYYYY"
}
}
]
}' \
"https://async.scraperapi.com/structured/google/mapssearch"You can easily get the latitude and longitude for any location directly from Google Maps by right-clicking on the desired point and copying the coordinates.
Supported Parameters
API_KEY(required)
Your API Key.
QUERY(required)
Query string for example: vegan restaurant
LATITUDE(required)
Latitude value, for example: 21.029738077531196
LONGITUDE(required)
Longitude value, for example: 105.85222341863856
Sample Response
Single Query Request
Multiple Queries Request
After the job(s) finish, you will find the result under the response key in the response JSON object. The structure is the same as in the corresponding SYNC data endpoint.
Last updated

