WebScrapingAPI Docs
HomeLoginRegister
  • Introduction
    • Registration
    • Pricing
    • Free APIs
    • API Errors
    • Custom Response Headers
  • Browser API
    • Getting Started
      • Access the API
      • Authentication
      • API Parameters
    • Basic API Requests
      • GET Request
      • POST, PUT & PATCH Requests
      • Proxy Mode
    • Advanced API Features
      • Awaiting
      • Geolocation
      • Sessions
      • Forcing Timeouts
      • Custom Headers
      • Custom Cookies
      • Device Type
      • Viewport Sizing
      • Screenshot
      • Screenshot Options
      • Extraction Rules
      • JavaScript Instructions
      • Full JSON Response
      • JSON DOM Response
      • Block Resources
      • Captcha Solving
  • WebScrapingAPI
    • Getting Started
      • Access the API
      • API Parameters
    • Basic API Requests
      • GET Request
      • POST, PUT & PATCH Requests
    • Advanced API Features
      • Geolocation
      • Extraction Rules
      • Full JSON Response
      • JSON DOM Response
      • Rendering JavaScript
  • WebStealthProxy
    • Getting Started
      • Access the Proxy
      • Usage and Statistics
    • Basic Proxy Requests
    • Advanced Proxy Requests
      • Sessions
      • Geolocation
      • Custom Headers
      • Custom Cookies
      • Screenshots
  • Google Search API
    • Getting Started
      • Access the API
      • API Parameters
    • Google Search Engines
      • Google Search API
      • Google Maps API
      • Google Maps Reviews API
      • Google Reverse Image API
      • Google Trends API
        • Geo Parameter Options List
        • Google Trends Categories List
  • WB CUSTOM SEARCH API
    • Getting Started
      • Access the API
      • API Parameters
    • WB Custom Search Engines
      • Wayfair Product API
      • Best Buy Product API
      • Nordstrom Product API
  • Amazon Search API
    • Getting Started
      • API Parameters
      • Access the API
      • Supported Domains
    • Amazon Search Types
      • Amazon Search
      • Amazon Seller
        • Amazon Seller Products
        • Amazon Seller Profile
        • Amazon Seller Feedback
      • Amazon Product
      • Amazon Category
      • Amazon Bestsellers
      • Amazon New Releases
      • Amazon Deals
  • Bing Search API
    • Getting Started
      • Access the API
      • API Parameters
    • Basic API Requests
Powered by GitBook
On this page
  • Google Maps API Integration Examples
  • Ready to Use Google Maps Scraping Scripts:
  • Google Maps Specific Parameters
  1. Google Search API
  2. Google Search Engines

Google Maps API

The Google Maps Scraper API allows you to easily scrape Google Maps by simply sending an HTTP request.

PreviousGoogle Search APINextGoogle Maps Reviews API

Last updated 6 months ago

To enable this engine, set the engine=google_maps parameter.

Interacting with the Google Maps scraper is quite straightforward. As opposed to the , which can take a lot of parameters and allows more flexibility in customizing the response, the Google Maps API has fewer options, but the data it returns is still as rich and accurate.

Google Maps API Integration Examples

We will use following URL as an example for this request:

https://serpapi.webscrapingapi.com/v2?engine=google_maps&api_key=<YOUR_API_KEY>&q=pizza

Ready to Use Google Maps Scraping Scripts:

curl --request GET --url "https://serpapi.webscrapingapi.com/v2?engine=google_maps&api_key=<YOUR_API_KEY>&q=pizza"
const http = require("https");

const options = {
  "method": "GET",
  "hostname": "serpapi.webscrapingapi.com",
  "port": null,
  "path": "/v2?engine=google_maps&api_key=YOUR_API_KEY&q=pizza",
  "headers": {}
};

const req = http.request(options, function (res) {
  const chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    const body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();
import http.client

conn = http.client.HTTPSConnection("serpapi.webscrapingapi.com")

conn.request("GET", "/v2?engine=google_maps&api_key=YOUR_API_KEY&q=pizza")

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://serpapi.webscrapingapi.com/v2?engine=google_maps&api_key=YOUR_API_KEY&q=pizza",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
]);

$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/ioutil"
)

func main() {

	url := "https://serpapi.webscrapingapi.com/v2?engine=google_maps&api_key=YOUR_API_KEY&q=pizza"

	req, _ := http.NewRequest("GET", url, nil)

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://serpapi.webscrapingapi.com/v2?engine=google_maps&api_key=YOUR_API_KEY&q=pizza")
  .asString();
var client = new RestClient("https://serpapi.webscrapingapi.com/v2?engine=google_maps&api_key=YOUR_API_KEY&q=pizza");
var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);
require 'uri'
require 'net/http'
require 'openssl'

url = URI("https://serpapi.webscrapingapi.com/v2?engine=google_maps&api_key=YOUR_API_KEY&q=pizza")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body

Google Maps Specific Parameters

#1: Query Parameter

Parameter
Type
Description

q Required

string

The keywords that you are searching for on Google (the query).

#2: Request Customization Parameters

Parameter
Type
Description

type

string

The type of search. It can be hotels or vacation_rentals.

data

string

This parameter is required only if q is not provided. It has to be constructed in the next sequence: !4m5!3m4!1s + data_id + !8m2!3d + latitude + !4d + longitude

#3: Device and Geolocation Parameters

Parameter
Type
Description

device

string

The device used for your Google Maps search. Can be set to desktop, mobile or tablet.

hl

string

gl

string

ll

string

Parameter defines GPS coordinates of location where you want your q (query) to be applied. It has to be constructed in the next sequence: @ + latitude + , + longitude + , + zoom.

#4: Pagination Parameters

Parameter
Type
Description

start

int

The offset of the Google Maps results. Represents the number of results that you want to skip.

num

int

The number of results returned on each page.

Response Example
{
    "general": {
        "query": "coffee",
        "language": "en",
        "country": "United States",
        "country_code": "US",
        "gl": "US"
    },
    "organic": [
        {
            "title": "Fika Fika",
            "display_link": "fikafikacoffee.com",
            "link": "http://fikafikacoffee.com/",
            "address": "1731 E Colorado Blvd, Pasadena, CA 91106",
            "phone": "+16263142081",
            "open_hours": {
                "Monday": "7 AM–6 PM",
                "Tuesday": "7 AM–6 PM",
                "Wednesday": "7 AM–6 PM",
                "Thursday": "7 AM–6 PM",
                "Friday": "7 AM–6 PM",
                "Saturday": "7 AM–6 PM",
                "Sunday": "7 AM–6 PM"
            },
            "category": [
                {
                    "id": "coffee_shop",
                    "title": "Coffee shop"
                },
                {
                    "id": "cafe",
                    "title": "Cafe"
                },
                {
                    "id": "dessert_shop",
                    "title": "Dessert shop"
                }
            ],
            "tags": [
                {
                    "group_id": "service_options",
                    "group_title": "Service options",
                    "key_id": "/geo/type/establishment_poi/has_seating_outdoors",
                    "key_title": "Outdoor seating",
                    "value": 1,
                    "value_title": "Has outdoor seating",
                    "value_title_short": "Outdoor seating"
                },
                {
                    "group_id": "service_options",
                    "group_title": "Service options",
                    "key_id": "/geo/type/establishment_poi/has_delivery",
                    "key_title": "Delivery",
                    "value": 1,
                    "value_title": "Offers delivery",
                    "value_title_short": "Delivery"
                },
                {
                    "group_id": "service_options",
                    "group_title": "Service options",
                    "key_id": "/geo/type/establishment_poi/has_takeout",
                    "key_title": "Takeout",
                    "value": 1,
                    "value_title": "Offers takeout",
                    "value_title_short": "Takeout"
                },
...

The language you want to use for your Google Maps search.

The country you want to use for your Google Maps search.

List of supported languages
List of supported countries
Google Search API
Scrape Google Maps Results