Copied to clipboard!

Google Images API

To scrape Google Images results with SerpApi, create a search with these parameters:

tbm

Required

Parameter must be set to isch. (I.e., tbm=isch)

ijn

Optional

Parameter defines the page number to get. It must be an integer greater than or equal to 0.

chips

Optional

Parameter enables to filter image search. It's a string provided by Google as suggested search, like: red apple. Chips are provided under the section: suggested_searches when ijn = 0. Both chips value and link to SerpApi is provided for each suggested search.

The images are fetched by batch of 100 images per searches. In order to retrieve the first 300 images, 3 searches would be needed.
As an example, to get the first 300 images for the search "Apple":

SerpApi Google Images JSON

{
  ...
   "images_results": [
    {
      "position": "Integer - Image index",
      "thumbnail": "String - Google Thumbnail URL (cache)",
      "original": "String - Original Image URL (full resolution)",
      "title": "String - Short Image Description",
      "link": "String - Link to the page providing the image",
      "source": "String - Original Domain Name"
    },
    "suggested_searches": [
    {
      "name": "String - suggested searches name",
      "link": "String - Google search link original",
      "chips": "String - Google chips parameter value",
      "serpapi_link": "String - Link to SerpApi to fetch the suggested searches",
      "thumbnail": "String - URL or base64 encoded image thumbnail displayed by Google"
     },
    ...
  ]
  ...
}

Images Results for "Apple"

GET https://serpapi.com/search?q=Apple&tbm=isch&ijn=0 Playground
{
  ...
  "images_results": [
    {
      "position": 1,
      "thumbnail": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSMzLN9iUjPiaNdA8w7NtzSTuJI0UPbDFOQKh3IXF6buUYmkaNr",
      "original": "https://as-images.apple.com/is/image/AppleInc/aos/published/images/o/g/og/default/og-default?wid=1200&hei=630&fmt=jpeg&qlt=95&op_usm=0.5,0.5&.v=1525370171638",
      "source": "apple.com",
      "title": "Apple Accessories for Apple Watch, iPhone, iPad, iPod, and Mac - Apple",
      "link": "https://www.apple.com/shop/accessories/all-accessories"
    },
    {
      "position": 2,
      "thumbnail": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSYfgh6R22EUz-8EUwh-e68sSEFOHWXeZHuysRW_DPkhahMgdwJ",
      "original": "https://www.apple.com/ac/structured-data/images/knowledge_graph_logo.png?201606271147",
      "source": "apple.com",
      "title": "Buy AirPods with Wireless Charging Case - Apple",
      "link": "https://www.apple.com/shop/product/MRXJ2AM/A/airpods-with-wireless-charging-case"
    },
    {
      "position": 3,
      "thumbnail": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSrdINKE0Mf9NtmvZqt8GWSwDXjvtFGrRyy1SsO9l-zFyFLoMWg",
      "original": "https://www.apple.com/ac/structured-data/images/open_graph_logo.png?201809210816",
      "source": "apple.com",
      "title": "Apple",
      "link": "https://www.apple.com/"
    },
  ...
  ],
  "suggested_searches": [
    {
      "name": "iphone",
      "link": "/search?gl=us&hl=en&tbm=isch&q=Apple&chips=q:apple,g_1:iphone:ZQ7UrAOKpgI%3D&usg=AI4_-kTuMNyVIgli_mZusNp6-WVAiWolRA&sa=X&ved=0ahUKEwjz_L3Y7sfhAhXOtVkKHal3CBEQ4lYIJigA",
      "chips": "q:apple,g_1:iphone:ZQ7UrAOKpgI%3D",
      "serpapi_link": "https://serpapi.com/search.json?&location=Austin,Texas,United%20States&q=Apple&domain=google.com&hl=en&gl=us&device=desktop&tbm=isch&chips=q:apple,g_1:iphone:ZQ7UrAOKpgI%253D",
      "thumbnail": null
    },
    {
      "name": "logo",
      "link": "/search?gl=us&hl=en&tbm=isch&q=Apple&chips=q:apple,g_1:logo:jevwK_PM7vk%3D&usg=AI4_-kS5cZPs_-OGHZv4ce-qm7lDCYGIhA&sa=X&ved=0ahUKEwjz_L3Y7sfhAhXOtVkKHal3CBEQ4lYIKCgB",
      "chips": "q:apple,g_1:logo:jevwK_PM7vk%3D",
      "serpapi_link": "https://serpapi.com/search.json?&location=Austin,Texas,United%20States&q=Apple&domain=google.com&hl=en&gl=us&device=desktop&tbm=isch&chips=q:apple,g_1:logo:jevwK_PM7vk%253D",
      "thumbnail": null
    },
  ...
}

Images Advanced Filter Search

Google Images provides a way to filter by size, image type, and more. This information is encoded in the tbs parameter. E.g., tbs=itp:photos,isz:l selects only large photos.

SerpApi search examples:

To build your own tbs parameter, you can use the regular Google Images and copy the value of the field tbs from the url:

Tbs Image Filter Example
  1. Enable Tools dropdown on the right
  2. Select the image filters you want to use

Your browser URL should contains somthing like: ...&tbs=itp:photos,isz:l.... You can use this value directly on SerpApi.