/google-maps-photos

Returns Google Maps photos from places when using search queries (e.g., restaurants, Manhattan, NY, USA) or from a single place when using IDs or names (e.g., NoMad Restaurant, NY…

↗ Open in API Explorer
GET

Google Maps Photos

Returns Google Maps photos from places when using search queries (e.g., restaurants, Manhattan, NY, USA) or from a single place when using IDs or names (e.g., NoMad Restaurant, NY, USA, 0x886916e8bc273979:0x5141fcb11460b226, ChIJu7bMNFV-54gR-lrHScvPRX4).

In case no photos were found by your search criteria, your search request will consume the usage of one photo.

Request

Endpoint: GET https://api.outscraper.cloud/google-maps-photos

Parameters

NameInTypeRequiredDescriptionExampleConstraints
query query array<string> Yes The parameter defines the query you want to search. You can use anything that you would use on a regular Google Maps site. Additionally, you can use google_id (feature_id), place_id, CID or urls to Google Maps places. The example of valid queries: Real estate agency, Rome, Italy, The NoMad Restaurant, NY, USA, restaurants, Brooklyn 11203, 0x886916e8bc273979:0x5141fcb11460b226, ChIJu7bMNFV-54gR-lrHScvPRX4, https://www.google.com/maps/search/restaurants+near+New+York,+NY, etc. It supports batching by sending arrays with up to 1000 queries (e.g., query=text1&query=text2&query=text3). It allows multiple queries to be sent in one request and save on network latency time. You might want to check out the web application to play with locations and categories that we would suggest. - -
photosLimit query integer No The parameter specifies the limit of photos to get from one place. - default 100
limit query integer No The parameter specifies the limit of places to take from one query search. - default 1
tag query string enum No Tne parameter specifies one of the filtering types. - default all, allowed all, latest, menu, by_owner
language query string enum No The parameter specifies the language to use for website. - default en, allowed en, de, es, es-419, fr, hr, it, nl, …
region query string enum No The parameter specifies the country to use for website. It's recommended to use it for a better search experience. - allowed AF, AL, DZ, AS, AD, AO, AI, AG, …
fields query string No The parameter defines which fields you want to include with each item returned in the response. By default, it returns all fields. Use &fields=query,name to return only the specific ones. - -
async query boolean Yes The parameter defines the way you want to submit your task to Outscraper. It can be set to false to open an HTTP connection and keep it open until you got your results, or true (default) to just submit your requests to Outscraper and retrieve them later (usually within 1-3 minutes) with the Request Results endpoint. Each response is available for 4 hours after a request has been completed. A good practice is to send async requests and start checking the results after the estimated execution time. Check out this Python implementation as an example. As most of the requests take some time to be executed the async=true option is preferred to avoid HTTP requests timeouts. - default true
ui query boolean No The parameter defines whether a task will be executed as a UI task. This is commonly used when you want to create a regular platform task with API. Using this parameter overwrites the async parameter to true. - default false
format query array<string enum> No The parameter defines the format of the output data. Using this parameter overwrites the ui parameter to true. - -
webhook query string No The parameter defines the URL address (callback) to which Outscraper will create a POST request with a JSON body once a task/request is finished. Using this parameter overwrites the webhook from integrations. - -

Responses

200

application/json

The response contains the status of the request and data. Data is an array where each element represents a place with its photos.

{
  "id": "your-request-id",
  "status": "Success",
  "data": [
    [
      {
        "name": "Trump Tower",
        "place_id": "ChIJrc9T9fpYwokRdvjYRHT8nI4",
        "google_id": "0x89c258faf553cfad:0x8e9cfc7444d8f876",
        "full_address": "725 5th Ave, New York, NY 10022",
        "location_link": "https://www.google.com/maps/place/Trump+Tower/@40.7624284,-73.973794,14z/data=!4m8!1m2!2m1!1sTrump+Tower!3m4!1s0x89c258faf553cfad:0x8e9cfc7444d8f876!8m2!3d40.7624284!4d-73.973794",
        "photos_data": [
          {
            "photo_id": "AF1QipOWVDj4328cybOEP6-BsLxnUY7PJL8sW2LNjC9n",
            "photo_url": "https://lh5.googleusercontent.com/p/AF1QipOWVDj4328cybOEP6-BsLxnUY7PJL8sW2LNjC9n",
            "photo_url_big": "https://lh5.googleusercontent.com/p/AF1QipOWVDj4328cybOEP6-BsLxnUY7PJL8sW2LNjC9n=w2048-h2048-k-no",
            "latitude": 40.762428410640254,
            "longitude": -73.97379403006005
          },
          {
            "photo_id": "AF1QipOBtXJqlf8tzHi8lxaEIQJVuPR_hWNnuXjqoZ3S",
            "photo_url": "https://lh5.googleusercontent.com/p/AF1QipOBtXJqlf8tzHi8lxaEIQJVuPR_hWNnuXjqoZ3S",
            "photo_url_big": "https://lh5.googleusercontent.com/p/AF1QipOBtXJqlf8tzHi8lxaEIQJVuPR_hWNnuXjqoZ3S=w2048-h2048-k-no",
            "latitude": 40.762428410640254,
            "longitude": -73.97379403006005
          },
          {
            "photo_id": "AF1QipNDAQVYbZRPCxuL9s4jfgNcEs9dJog-GAiEpsGZ",
            "photo_url": "https://lh5.googleusercontent.com/p/AF1QipNDAQVYbZRPCxuL9s4jfgNcEs9dJog-GAiEpsGZ",
            "photo_url_big": "https://lh5.googleusercontent.com/p/AF1QipNDAQVYbZRPCxuL9s4jfgNcEs9dJog-GAiEpsGZ=w2048-h2048-k-no",
            "latitude": 40.762579099999996,
            "longitude": -73.97426109999999
          }
        ]
      }
    ]
  ]
}

202

application/json

The response contains a request ID that can be used to fetch results by using Request Results endpoint. Each response is available for 4 hours after a request has been completed.

{
  "id": "your-request-id",
  "status": "Pending",
  "results_location": "https://api.outscraper.cloud/requests/your-request-id"
}

204

application/json

The request was finished with failure and has no results.

{
  "id": "your-request-id",
  "status": "Failure"
}

401

application/json

Wrong or missing API Key (token).

{
  "error": true,
  "errorMessage": "401 Unauthorized: The server could not verify that you are authorized to access the URL requested. You either supplied the wrong credentials (e.g. a bad password), or your browser doesn't understand how to supply the credentials required."
}

402

application/json

Past due invoices or a payment method not connected.

{
  "error": true,
  "errorMessage": "Please close past due invoices or verify your card information is correct."
}

422

application/json

Wrong query url parameters.

{
  "error": true,
  "errorMessage": "422 Unprocessable Entity: The request was well-formed but was unable to be followed due to semantic errors."
}

Code Samples

cURL

curl -X GET "https://api.outscraper.cloud/google-maps-photos?query=Trump%20Tower,%20NY,%20USA&photosLimit=3&async=false" -H  "X-API-KEY: YOUR-API-KEY"

cURL (async)

curl -X GET "https://api.outscraper.cloud/google-maps-photos?query=Trump%20Tower,%20NY,%20USA&photosLimit=3" -H  "X-API-KEY: YOUR-API-KEY"

Python

from outscraper import OutscraperClient

api_client = OutscraperClient(api_key='YOUR-API-KEY')
results = api_client.google_maps_photos('Trump Tower, NY, USA', photosLimit=3)

Related Endpoints

Returns Google Maps reviews from places when using search queries (e.g., restaurants, Manhattan, NY, USA) or from a single place when using Google IDs or names (e.g., NoMad Restau…

Returns places from Google Maps based on a given search query (or many queries). The results from searches are the same as you would see by visiting a regular Google Maps site. Ho…