# Google Maps Photos API

{% hint style="success" %}
To enable this engine, set the **`engine=google_maps_photos`** parameter.
{% endhint %}

If you only want to scrape the Google Maps Photos, you can do so by simply interacting with the Google Maps Photos API. This engine will return a JSON object of all the photos available, based on your query.

<figure><img src="https://1192456954-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9wbsYOleiAqS785aMtPp%2Fuploads%2F7qiL0xIC3HLT41dFLOxS%2Fimage_2022-10-28_161255470.png?alt=media&#x26;token=b2e75976-f103-4ab8-bf26-0c9986c41416" alt=""><figcaption><p>Scrape Google Maps Photos</p></figcaption></figure>

### Google Maps Photos API Integration Examples

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

```
https://serpapi.webscrapingapi.com/v1?engine=google_maps_photos&api_key=<YOUR_API_KEY>&data_id=0x4786c6ace45fe3bd:0x126d84580eedebe5
```

### Ready to Use Google Maps Photos Scraping Scripts:

{% tabs %}
{% tab title="cURL" %}

```bash
curl --request GET --url "https://serpapi.webscrapingapi.com/v1?engine=google_maps_photos&api_key=YOUR_API_KEY&data_id=0x4786c6ace45fe3bd:0x126d84580eedebe5"
```

{% endtab %}

{% tab title="NodeJS" %}

```javascript
const http = require("https");

const options = {
  "method": "GET",
  "hostname": "serpapi.webscrapingapi.com",
  "port": null,
  "path": "/v1?engine=google_maps_photos&api_key=YOUR_API_KEY&data_id=0x4786c6ace45fe3bd:0x126d84580eedebe5",
  "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();
```

{% endtab %}

{% tab title="Python" %}

```python
import http.client

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

conn.request("GET", "/v1?engine=google_maps_photos&api_key=YOUR_API_KEY&data_id=0x4786c6ace45fe3bd:0x126d84580eedebe5")

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

print(data.decode("utf-8"))
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://serpapi.webscrapingapi.com/v1?engine=google_maps_photos&api_key=YOUR_API_KEY&data_id=0x4786c6ace45fe3bd:0x126d84580eedebe5",
  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;
}
```

{% endtab %}

{% tab title="Go" %}

```go
package main

import (
	"fmt"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://serpapi.webscrapingapi.com/v1?engine=google_maps_photos&api_key=YOUR_API_KEY&data_id=0x4786c6ace45fe3bd:0x126d84580eedebe5"

	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))

}
```

{% endtab %}

{% tab title="Java" %}

```java
HttpResponse<String> response = Unirest.get("https://serpapi.webscrapingapi.com/v1?engine=google_maps_photos&api_key=YOUR_API_KEY&data_id=0x4786c6ace45fe3bd:0x126d84580eedebe5")
  .asString();
```

{% endtab %}

{% tab title=".NET" %}

```csharp
var client = new RestClient("https://serpapi.webscrapingapi.com/v1?engine=google_maps_photos&api_key=YOUR_API_KEY&data_id=0x4786c6ace45fe3bd:0x126d84580eedebe5");
var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);
```

{% endtab %}

{% tab title="Ruby" %}

```ruby
require 'uri'
require 'net/http'
require 'openssl'

url = URI("https://serpapi.webscrapingapi.com/v1?engine=google_maps_photos&api_key=YOUR_API_KEY&data_id=0x4786c6ace45fe3bd:0x126d84580eedebe5")

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
```

{% endtab %}
{% endtabs %}

### Google Maps Photos Parameters

#### #1: Query Parameter

<table><thead><tr><th width="187">Parameter</th><th width="107" align="center">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>data_id</code><br><mark style="color:red;background-color:red;">Required</mark></td><td align="center"><code>string</code></td><td>Google Maps data ID that you are searching.</td></tr></tbody></table>

#### #2: Request Customisation Parameters

<table><thead><tr><th width="184">Parameter</th><th width="106" align="center">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>category_id</code></td><td align="center"><code>string</code></td><td>The ID of the category you want to filter your request by.</td></tr></tbody></table>

#### #3: Geolocation Parameters

<table><thead><tr><th width="184">Parameter</th><th width="106" align="center">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>hl</code></td><td align="center"><code>string</code></td><td>The language you want to use for your Google search. <a href="https://developers.google.com/custom-search/docs/xml_results_appendices#interfaceLanguages">List of supported languages</a></td></tr></tbody></table>

#### #4: Pagination Parameters

<table><thead><tr><th width="202">Parameter</th><th width="106" align="center">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>next_page_token</code></td><td align="center"><code>string</code></td><td>Token of the next page, used to retrieve results from the next page.</td></tr></tbody></table>

<details>

<summary>Response Example</summary>

```javascript
{
    "search_parameters": {
        "google_maps_reviews_url": "https://www.google.com/maps/preview/photo?hl=en&pb=!1e2!3m3!1s0x4786c6ace45fe3bd:0x126d84580eedebe5!9e0!11s!5m58!2m2!1i203!2i100!3m2!2i20!5b1!7m50!1m3!1e1!2b0!3e3!1m3!1e2!2b1!3e2!1m3!1e2!2b0!3e3!1m3!1e3!2b0!3e3!1m3!1e8!2b0!3e3!1m3!1e3!2b1!3e2!1m3!1e10!2b0!3e3!1m3!1e10!2b1!3e2!1m3!1e9!2b1!3e2!1m3!1e10!2b0!3e3!1m3!1e10!2b1!3e2!1m3!1e10!2b0!3e4!2b1!4b1!9b0!6m3!1s!2z!7e81!16m4!1m1!1BCgIgAQ!2b1!4e1",
        "engine": "google_maps_photos",
        "google_domain": "google.com",
        "device": "desktop",
        "data_id": "0x4786c6ace45fe3bd:0x126d84580eedebe5"
    },
    "categories": [
        {
            "id": "CgIgAQ==",
            "title": "All"
        },
        {
            "id": "CgIgARICGAI=",
            "title": "Latest"
        },
        {
            "id": "CgIYIQ==",
            "title": "Menu"
        },
        {
            "id": "CgIYIA==",
            "title": "Food & drink"
        },
        {
            "id": "CgIYIg==",
            "title": "Vibe"
        },
        {
            "id": "CgwqCC9tLzBobnl4MAs=",
            "title": "Pastry"
        },
        {
            "id": "Cg0qCS9tLzAxNXdnYzAL",
            "title": "Croissant"
        },
        {
            "id": "Cg0qCS9tLzAydnFmbTAL",
            "title": "Coffee"
        },
        {
            "id": "Cg0qCS9tLzAxbnI1NjAL",
            "title": "Latte"
        },
        {
            "id": "CgwqCC9tLzA2NjN2MAs=",
            "title": "Pizza"
        },
        {
            "id": "CgwqCC9tLzA3bDRnMAs=",
            "title": "Tiramisu"
        },
        {
            "id": "Cg0qCS9tLzA5dG1nNjAL",
            "title": "Coffee cake"
        },
        {
            "id": "CgIgARICEAE=",
            "title": "By owner"
        },
        {
            "id": "CgIgARICCAI=",
            "title": "Street View & 360°"
        },
        {
            "id": "CgIgARICCAQ=",
            "title": "Videos"
        }
    ],
    "photos": [
        {
            "thumbnail": "https://lh5.googleusercontent.com/p/AF1QipNY6skUti7Ce8pDPW47XIDqUNr5Ago-5zXSZBnG=w203-h135-k-no",
            "image": "https://lh5.googleusercontent.com/p/AF1QipNY6skUti7Ce8pDPW47XIDqUNr5Ago-5zXSZBnG=w6652-h4435-k-no"
        },
        {
            "thumbnail": "https://lh5.googleusercontent.com/p/AF1QipMZjSS-JF8ewZTHohi4wHq73WvVC1dwMGXWJ8KU=w203-h270-k-no",
            "image": "https://lh5.googleusercontent.com/p/AF1QipMZjSS-JF8ewZTHohi4wHq73WvVC1dwMGXWJ8KU=w3024-h4032-k-no"
        },
        {
            "thumbnail": "https://lh5.googleusercontent.com/p/AF1QipMAQfs500GFwzfVBwqXjelfIQWYTCvqmz5XHqyI=w203-h135-k-no",
            "image": "https://lh5.googleusercontent.com/p/AF1QipMAQfs500GFwzfVBwqXjelfIQWYTCvqmz5XHqyI=w1620-h1080-k-no"
        },
        {
            "thumbnail": "https://lh5.googleusercontent.com/p/AF1QipO3Ov4mCLppboCZCYafM1TL54rYMKG6NkxVMuB7=w203-h114-k-no",
            "image": "https://lh5.googleusercontent.com/p/AF1QipO3Ov4mCLppboCZCYafM1TL54rYMKG6NkxVMuB7=w4000-h2252-k-no"
        },
        {
            "thumbnail": "https://lh5.googleusercontent.com/p/AF1QipNysV36qhkmDUeNaAcOubTr-_51OI8Ld8pfXGnj=w203-h152-k-no",
            "image": "https://lh5.googleusercontent.com/p/AF1QipNysV36qhkmDUeNaAcOubTr-_51OI8Ld8pfXGnj=w4032-h3024-k-no"
        },
        {
            "thumbnail": "https://lh5.googleusercontent.com/p/AF1QipPueNW7yq78UET0KDRp3eaARTT1ydvxai57BrO8=w203-h152-k-no",
            "image": "https://lh5.googleusercontent.com/p/AF1QipPueNW7yq78UET0KDRp3eaARTT1ydvxai57BrO8=w12000-h9000-k-no"
        },
        {
            "thumbnail": "https://lh5.googleusercontent.com/p/AF1QipP4er13qYY4zoXYX1zIr5VRbCR9z6LYeSWA9wiM=w203-h270-k-no",
            "image": "https://lh5.googleusercontent.com/p/AF1QipP4er13qYY4zoXYX1zIr5VRbCR9z6LYeSWA9wiM=w9000-h12000-k-no"
        },
        {
            "thumbnail": "https://lh5.googleusercontent.com/p/AF1QipOJj8dxC7HF4AhcQhJhs5d6jlEDTWQh6XtGrPQu=w203-h135-k-no",
            "image": "https://lh5.googleusercontent.com/p/AF1QipOJj8dxC7HF4AhcQhJhs5d6jlEDTWQh6XtGrPQu=w1712-h1141-k-no"
        },
        {
            "thumbnail": "https://lh5.googleusercontent.com/p/AF1QipMg-7iTXt-SILgvRHribgAIJu_bKIk6tWowpvBp=w203-h270-k-no",
            "image": "https://lh5.googleusercontent.com/p/AF1QipMg-7iTXt-SILgvRHribgAIJu_bKIk6tWowpvBp=w1924-h2565-k-no"
        },
        {
            "thumbnail": "https://lh5.googleusercontent.com/p/AF1QipMG128_SEX4KzhtN-jhRzSgus-pK5K713PNAxU6=w203-h152-k-no",
            "image": "https://lh5.googleusercontent.com/p/AF1QipMG128_SEX4KzhtN-jhRzSgus-pK5K713PNAxU6=w9248-h6936-k-no"
        },
        {
            "thumbnail": "https://lh5.googleusercontent.com/p/AF1QipP6eA1U_d4J2lY30VdN4QW_Ve2iemhSuL5TOyKZ=w203-h114-k-no",
            "image": "https://lh5.googleusercontent.com/p/AF1QipP6eA1U_d4J2lY30VdN4QW_Ve2iemhSuL5TOyKZ=w800-h451-k-no"
        },
        {
            "thumbnail": "https://lh5.googleusercontent.com/p/AF1QipM9Wdh-Yw_aCAF1XxNMMn1Wz30otd1-knl1DppK=w203-h152-k-no",
            "image": "https://lh5.googleusercontent.com/p/AF1QipM9Wdh-Yw_aCAF1XxNMMn1Wz30otd1-knl1DppK=w4000-h3000-k-no"
        },
        {
            "thumbnail": "https://lh5.googleusercontent.com/p/AF1QipPNsraTfbrQ36fxxltKk8BARi9KNRql9I4875fX=w203-h146-k-no",
            "image": "https://lh5.googleusercontent.com/p/AF1QipPNsraTfbrQ36fxxltKk8BARi9KNRql9I4875fX=w1440-h1040-k-no"
        },
        {
            "thumbnail": "https://lh5.googleusercontent.com/p/AF1QipO0jQSu93NMYKNzI4vjqISFmjqhR_ZGEL9FvIqN=w203-h152-k-no",
            "image": "https://lh5.googleusercontent.com/p/AF1QipO0jQSu93NMYKNzI4vjqISFmjqhR_ZGEL9FvIqN=w4032-h3024-k-no"
        },
        {
            "thumbnail": "https://lh5.googleusercontent.com/p/AF1QipPP0EOWqAqb_Fk2i6dr3b3Cbsea8cufqVlMtAYu=w203-h270-k-no",
            "image": "https://lh5.googleusercontent.com/p/AF1QipPP0EOWqAqb_Fk2i6dr3b3Cbsea8cufqVlMtAYu=w3024-h4032-k-no"
        },
        {
            "thumbnail": "https://lh5.googleusercontent.com/p/AF1QipPDkvCHpm7eTcMX1-0GGHKIl9CWF13mFkW85D7a=w203-h152-k-no",
            "image": "https://lh5.googleusercontent.com/p/AF1QipPDkvCHpm7eTcMX1-0GGHKIl9CWF13mFkW85D7a=w3648-h2736-k-no"
        },
        {
            "thumbnail": "https://lh5.googleusercontent.com/p/AF1QipOokeGvyX_ty9SLQ3kqZ3boDQgFXup76VMYQfcK=w203-h270-k-no",
            "image": "https://lh5.googleusercontent.com/p/AF1QipOokeGvyX_ty9SLQ3kqZ3boDQgFXup76VMYQfcK=w3000-h4000-k-no"
        },
        {
            "thumbnail": "https://lh5.googleusercontent.com/p/AF1QipOAXxSDtQrcrnQA3B1zyKZy2Me0Cwn_AXXBWw0H=w203-h283-k-no",
            "image": "https://lh5.googleusercontent.com/p/AF1QipOAXxSDtQrcrnQA3B1zyKZy2Me0Cwn_AXXBWw0H=w1170-h1634-k-no"
        },
        {
            "thumbnail": "https://lh5.googleusercontent.com/p/AF1QipMEPnBI4YklmM1Uwsi1l5AjSC3PxUlTYg7Ysmog=w203-h152-k-no",
            "image": "https://lh5.googleusercontent.com/p/AF1QipMEPnBI4YklmM1Uwsi1l5AjSC3PxUlTYg7Ysmog=w4032-h3024-k-no"
        },
        {
            "thumbnail": "https://lh5.googleusercontent.com/p/AF1QipNGVwfmPut_VuQtYxfl3MaPvwT_nkVtJvv3IASG=w203-h270-k-no",
            "image": "https://lh5.googleusercontent.com/p/AF1QipNGVwfmPut_VuQtYxfl3MaPvwT_nkVtJvv3IASG=w3456-h4608-k-no"
        }
    ],
    "searchdata_pagination": {
        "next_page_token": "EvgDKYQi49-NlUMIDwAAAAEAAAMAAAAACAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAgAAAAAIAAAAAAAAAAAAAAAAAACQAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAIAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAIAAAAAABAAAgAAAAAAAAAAAgCAAAAAAAgAAAAgAAAAAAAIAAAAAACAABAAQAAAAAAAAAgAAAAAABAAAAAAAAAAAAAAAAAACGAgIAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAEAAAAAABAAAABAAAAAAAAAAAAAQAAAAAAQAAAAAAgAAAAAAAAAAAAACAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAgBAAAAAAAAAAAABAAAAAAACAAAAAAABAAAAgCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAEAAABAAAAAAAAAAAAAAAAQJAAAAAAAAAAAAAAAAAAQAQAAgAAAAAAAAAAQAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAGBRCVCmEIuPfjZVD6AEAACAAAAADAAAAgAEACoBCQSAIgAkAgBIIRAERAAACAAEUAAAEUACAoQDIAABIAgABAIAABDQACAAgAAACBAAAkAAEiBIgEAAAAA",
        "next": "https://serpapi.webscrapingapi.com/v1?engine=google_maps_photos&data_id=0x4786c6ace45fe3bd%3A0x126d84580eedebe5&next_page_token=EvgDKYQi49-NlUMIDwAAAAEAAAMAAAAACAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAgAAAAAIAAAAAAAAAAAAAAAAAACQAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAIAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAIAAAAAABAAAgAAAAAAAAAAAgCAAAAAAAgAAAAgAAAAAAAIAAAAAACAABAAQAAAAAAAAAgAAAAAABAAAAAAAAAAAAAAAAAACGAgIAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAEAAAAAABAAAABAAAAAAAAAAAAAQAAAAAAQAAAAAAgAAAAAAAAAAAAACAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAgBAAAAAAAAAAAABAAAAAAACAAAAAAABAAAAgCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAEAAABAAAAAAAAAAAAAAAAQJAAAAAAAAAAAAAAAAAAQAQAAgAAAAAAAAAAQAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAGBRCVCmEIuPfjZVD6AEAACAAAAADAAAAgAEACoBCQSAIgAkAgBIIRAERAAACAAEUAAAEUACAoQDIAABIAgABAIAABDQACAAgAAACBAAAkAAEiBIgEAAAAA"
    }
}
```

</details>
