Google Images API Documenation

Google Images API uses /api/v1/search?engine=google_images API endpoint to scrape real-time results.

Google Images API provides a dynamic image search service. It collects image results from various sources globally, categorizes similar images and presents them based on each user's search query. The API provides access to multiple sources for each image, allowing users to choose their topic of interest and select from different publishers' versions of the image. The selection and ranking of images are performed by algorithms that assess factors such as the relevance and quality of the image. It also prioritizes attributes like resolution, source, and freshness. The system is impartial, enabling access to a wide range of images for any search query. Google is continuously improving Images by adding new sources and enhancing its technology, extending its reach to more visual data worldwide.

API Parameters

Search Query

  • Name
    q
    Required
    Required
    Description

    Parameter defines the query you want to search. You can use anything that you would use in a regular Google search. e.g. inurl:, site:, intitle:. We also support advanced search query parameters such as as_dt and as_eq.

Device

  • Name
    device
    Required
    Optional
    Description

    The default parameter desktop defines the search on a desktop device. The mobile parameter defines the search on a mobile device. The tablet parameter defines the search on a tablet device.

Geographic Location

  • Name
    location
    Required
    Optional
    Description

    Parameter defines from where you want the search to originate. If several locations match the location requested, we'll pick the most popular one. Head to the Locations API if you need more precise control.

  • Name
    uule
    Required
    Optional
    Description

    Parameter is the Google encoded location you want to use for the search. SearchApi automatically generated the uule parameter when you use the location parameter but we allow you to overwrite it directly. uule and location parameters can't be used together.

Localization

  • Name
    google_domain
    Required
    Optional
    Description

    The default parameter google.com defines the Google domain of the search. Check the full list of supported Google google_domain domains.

  • Name
    gl
    Required
    Optional
    Description

    The default parameter us defines the country of the search. Check the full list of supported Google gl countries.

  • Name
    hl
    Required
    Optional
    Description

    The default parameter en defines the interface language of the search. Check the full list of supported Google hl languages.

  • Name
    lr
    Required
    Optional
    Description

    The lr parameter restricts search results to documents written in a particular language or a set of languages. The accepted format for this parameter is lang_{2-letter country code}. For instance, to filter documents written in Japanese, the value should be set to lang_jp. To incorporate multiple languages, a value like lang_it|lang_de restricts the search to documents written in either Italian or German. Google identifies the document language based on the top-level domain (TLD) of the document's URL, any language meta tags present, or the language utilized within the document's body text. Check the full list of supported Google lr languages.

  • Name
    cr
    Required
    Optional
    Description

    The cr parameter restricts search results to documents originating in a particular country. Google determines the country of a document by the top-level domain (TLD) of the document's URL or by Web server's IP address geographic location. Check the full list of supported Google cr countries.

Filters

  • Name
    nfpr
    Required
    Optional
    Description

    This parameter controls whether results from queries that have been auto-corrected for spelling errors are included. To exclude these auto-corrected results, set the value to 1. By default, the value is 0, meaning auto-corrected results are included.

  • Name
    filter
    Required
    Optional
    Description

    This parameter controls whether the "Duplicate Content" and "Host Crowding" filters are enabled. Set the value to 1 to enable these filters, which is the default setting. To disable these filters, set the value to 0.

  • Name
    safe
    Required
    Optional
    Description

    This parameter toggles the SafeSearch feature for the results. SafeSearch operates by filtering out adult content from your search results. Google's filters use proprietary technology to check keywords, phrases and URLs. While no filters are 100 percent accurate, SafeSearch will remove the overwhelming majority of adult content from your search results. Set the value to active to enable SafeSearch. To disable it, set the value to off. By default, SafeSearch is disabled.

  • Name
    chips
    Required
    Optional
    Description

    This parameter is used to include additional query conditions in the images search. It corresponds to the 'chips' elements visible on the top of the images search page. The values are extracted from these elements and passed to the `chips` parameter. For example, a `chips` value like q:apple,g_1:iphone:2zMiJ8wpMmA%3D with apple query would filter the results to images that assosiates with iphone. Each chip can be used to narrow down the images search based on various parameters.

  • Name
    tbs
    Required
    Optional
    Description

    This parameter restricts results to URLS based on encoded values. Parameter is normally constructed using size, color, image_type, time_period, usage_rights values. For instance, isz:l would return only results that has large image size.

  • Name
    size
    Required
    Optional
    Description

    This parameter controls the size of your search results. There are few options available: large, medium, icon.

  • Name
    time_period
    Required
    Optional
    Description

    This parameter restricts results to URLs based on date. Supported values are:

    • last_hour - data from the past hour.
    • last_day - data from the past 24 hours.
    • last_week - data from the past week.
    • last_month - data from the past month.
    • last_year - data from the past year.

  • Name
    color
    Required
    Optional
    Description

    This parameter controls the color of your search results. These options are available: black_and_white, transparent, red, orange, yellow, green, teal, blue, purple, pink, white, gray, black, brown.

  • Name
    image_type
    Required
    Optional
    Description

    This parameter controls the type of your search results. There are only few options that are available: clipart, line_drawing, gif.

  • Name
    usage_rights
    Required
    Optional
    Description

    This parameter controls the usage rights of your search results. Options that are available: creative_commons_licenses, commercial_or_other_licenses.

Pagination

  • Name
    page
    Required
    Optional
    Description

    This parameter indicates which page of results to return. By default, it is set to 1.

Engine

  • Name
    engine
    Required
    Required
    Description

    Parameter defines an engine that will be used to retrieve real-time data. It must be set to google_images.

API key

  • Name
    api_key
    Required
    Required
    Description

    The api_key authenticates your requests. Use it as a query parameter (https://www.searchapi.io/api/v1/search?api_key=YOUR_API_KEY) or in the Authorization header (Bearer YOUR_API_KEY).

API Examples

Full Response

Full Response
GET
https://www.searchapi.io/api/v1/search?engine=google_images&q=apple
Request
import requests

url = "https://www.searchapi.io/api/v1/search"
params = {
  "engine": "google_images",
  "q": "apple"
}

response = requests.get(url, params = params)
print(response.text)
Response
{
  "search_metadata": {
    "id": "search_875nmM02pVWXimeNgwE4z1Yx",
    "status": "Success",
    "created_at": "2023-06-26T12:25:21Z",
    "request_time_taken": 1.82,
    "parsing_time_taken": 0.27,
    "total_time_taken": 2.08,
    "request_url": "https://www.google.com/search?q=apple&oq=apple&gl=us&hl=en&uule=w+CAIQICIWTmV3IFlvcmssVW5pdGVkIFN0YXRlcw&tbm=isch&ie=UTF-8",
    "html_url": "https://www.searchapi.io/api/v1/searches/search_875nmM02pVWXimeNgwE4z1Yx.html",
    "json_url": "https://www.searchapi.io/api/v1/searches/search_875nmM02pVWXimeNgwE4z1Yx"
  },
  "search_parameters": {
    "engine": "google",
    "q": "apple",
    "uule": "w+CAIQICIWTmV3IFlvcmssVW5pdGVkIFN0YXRlcw",
    "location": "New York",
    "location_used": "New York,United States",
    "google_domain": "google.com",
    "hl": "en",
    "gl": "us"
  },
  "search_information": {
    "query_displayed": "apple"
  },
  "suggestions": [
    {
      "title": "iphone",
      "chips": "q:apple,g_1:iphone:iL53IaNEiZY%3D",
      "link": "https://www.google.com/search?q=apple&tbm=isch&hl=en&gl=us&chips=q:apple,g_1:iphone:2zMiJ8wpMmA%3D&sa=X&ved=2ahUKEwju07-O9-D_AhVHBDQIHVv6AX8Q4lYoAHoECAEQKw",
      "thumbnail": "data:image/jpeg;base64,.. or URL"
    },
    ...
  ],
  "images": [
    {
      "position": 1,
      "title": "Varieties Archive - New York Apple Association",
      "source": {
        "name": "New York Apple Association",
        "link": "https://www.applesfromny.com/varieties/"
      },
      "original": {
        "link": "https://www.applesfromny.com/wp-content/uploads/2020/05/20Ounce_NYAS-Apples2.png",
        "width": 2400,
        "height": 1889
      },
      "thumbnail": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcR60NuHdYGAcZOxjizaMLBADcfDH_54saDmJlgFFlLNqFa0pX6s5M-H13sOkrYc51bfxJA&usqp=CAU"
    },
    ...
  ],
  "shopping_ads": [
    {
      "position": 1,
      "title": "Apple iPhone 14 Pro Max 128 GB in Deep Purple with installment",
      "price": "$0.00",
      "extracted_price": 0,
      "link": "https://www.verizon.com/smartphones/apple-iphone-14-pro-max/?sku=sku5600288",
      "seller": "Verizon",
      "delivery": "Pick up today",
      "installment": {
        "down_payment": "$0.00",
        "extracted_down_payment": 0,
        "months": "36",
        "extracted_months": 36,
        "cost_per_month": "$30.55/mo",
        "extracted_cost_per_moth": 30.55
      },
      "thumbnail":"data:image/jpeg;base64,.. or URL"
    },
    ...
  ],
  "related_searches": [
    {
      "link": "https://www.google.com/search?q=fruit+apple&tbm=isch&hl=en&gl=us&sa=X&ved=2ahUKEwju07-O9-D_AhVHBDQIHVv6AX8QrNwCKAB6BQgBEJ0D",
      "query": "fruit apple",
      "highlighted": [
        "fruit"
      ],
      "thumbnail": "data:image/jpeg;base64,.. or URL"
    },
    ...
  ]
}

Images

Images
GET
https://www.searchapi.io/api/v1/search?engine=google_images&q=panda
Request
import requests

url = "https://www.searchapi.io/api/v1/search"
params = {
  "engine": "google_images",
  "q": "panda"
}

response = requests.get(url, params = params)
print(response.text)
Response
{
  "images": [
    {
      "position": 1,
      "title": "Giant panda - Wikipedia",
      "source": {
        "name": "Wikipedia",
        "link": "https://en.wikipedia.org/wiki/Giant_panda"
      },
      "original": {
        "link": "https://upload.wikimedia.org/wikipedia/commons/thumb/0/0f/Grosser_Panda.JPG/1200px-Grosser_Panda.JPG",
        "width": 1200,
        "height": 885
      },
      "thumbnail": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQwgH9EatBRnPoX6Nv5GJHUgbDdz3xmHsfM5Kuj-CEqVwUVuz1WfUj1X8OF_9HZ765fTco&usqp=CAU"
    },
    ...
  ]
}

Shopping Ads

Shopping Ads
GET
https://www.searchapi.io/api/v1/search?engine=google_images&location=New+York%2CUnited+States&q=android
Request
import requests

url = "https://www.searchapi.io/api/v1/search"
params = {
  "engine": "google_images",
  "q": "android",
  "location": "New York,United States"
}

response = requests.get(url, params = params)
print(response.text)
Response
{
  "shopping_ads": [
    {
      "position": 1,
      "title": "TCL FLIP Go (with 24 monthly payments)",
      "price": "$0.00",
      "extracted_price": 0,
      "link": "https://www.t-mobile.com/cell-phone/tcl-flip-go?sku=610214674685",
      "seller": "T-Mobile",
      "installment": {
        "down_payment": "$0.00",
        "extracted_down_payment": 0,
        "months": "24",
        "extracted_months": 24,
        "cost_per_month": "$4.00/mo",
        "extracted_cost_per_moth": 4
      },
      "thumbnail": "data:image/jpeg;base64,.. or URL"
    },
    ...
  ]
}

Suggestions

Suggestions
GET
https://www.searchapi.io/api/v1/search?engine=google_images&q=Programming+languages
Request
import requests

url = "https://www.searchapi.io/api/v1/search"
params = {
  "engine": "google_images",
  "q": "Programming languages"
}

response = requests.get(url, params = params)
print(response.text)
Response
{
  "suggestions": [
    {
      "title": "python",
      "chips": "q:programming+language,g_1:python:nh9zUftFmew%3D",
      "link": "https://www.google.com/search?q=Programming+languages&tbm=isch&hl=en&gl=us&chips=q:programming+language,g_1:python:nh9zUftFmew%3D&sa=X&ved=2ahUKEwj5yqWmpbqFAxW60ckDHUWUCnAQ4lYoAHoECAEQMA",
      "thumbnail": "data:image/png;base64,..."
    },
    {
      "title": "c++",
      "chips": "q:programming+language,g_1:c%2B%2B:0VihO4A6eBI%3D",
      "link": "https://www.google.com/search?q=Programming+languages&tbm=isch&hl=en&gl=us&chips=q:programming+language,g_1:c%2B%2B:0VihO4A6eBI%3D&sa=X&ved=2ahUKEwj5yqWmpbqFAxW60ckDHUWUCnAQ4lYoAXoECAEQMg",
      "thumbnail": "data:image/png;base64,..."
    },
    ...
  ],
  ...
}