Google Lens Image Sources API

Our Google Lens Image Sources API allows you to scrape results from the Google Lens image sources page after performed an image search. The results contain title, source, link and other data.

The API is accessed through the following endpoint: /search?engine=google_lens_image_sources. A user may query the following: https://serpapi.com/search?engine=google_lens_image_sources utilizing a GET request. Head to the playground for a live and interactive demo.

API Parameters

Search Query

page_token

Required

Parameter defines the token needed to retrieve image sources in Google Lens. The token is generated by SerpApi using our Google Lens API.

Localization

hl

Optional

Parameter defines the language to use for the Google Lens Image Sources search. It's a two-letter language code. (e.g., en for English, es for Spanish, or fr for French). Head to the Google languages page for a full list of supported Google languages.

country

Optional

Parameter defines the specific country location to use for the Google Lens Image Sources search. It's a two-letter country code. (e.g., us for United States, fr for France, or de for Germany). Head to the Google Lens countries page for a full list of supported Google Lens countries.

Advanced Filters

safe

Optional

Parameter defines the level of filtering for adult content. It can be set to active or off, by default Google will blur explicit content.

Serpapi Parameters

engine

Required

Set parameter to google_lens_image_sources to use the Google Lens Image Sources API engine.

no_cache

Optional

Parameter will force SerpApi to fetch the Google Lens Image Sources results even if a cached version is already present. A cache is served only if the query and all parameters are exactly the same. Cache expires after 1h. Cached searches are free, and are not counted towards your searches per month. It can be set to false (default) to allow results from the cache, or true to disallow results from the cache. no_cache and async parameters should not be used together.

async

Optional

Parameter defines the way you want to submit your search to SerpApi. It can be set to false (default) to open an HTTP connection and keep it open until you got your search results, or true to just submit your search to SerpApi and retrieve them later. In this case, you'll need to use our Searches Archive API to retrieve your results. async and no_cache parameters should not be used together. async should not be used on accounts with Ludicrous Speed enabled.

api_key

Required

Parameter defines the SerpApi private key to use.

output

Optional

Parameter defines the final output you want. It can be set to json (default) to get a structured JSON of the results, or html to get the raw html retrieved.

API Results

JSON Results

JSON output includes structured data for "Image Sources".

A search status is accessible through search_metadata.status. It flows this way: Processing -> Success || Error. If a search has failed, error will contain an error message. search_metadata.id is the search ID inside SerpApi.

HTML Results

This API does not have the full html response. search_metadata.prettify_html_file contains prettified version of result. It is displayed in playground.
HTML output is useful to debug JSON results or support features not supported yet by SerpApi. HTML output gives you the raw HTML results from Google.

API Examples

JSON structure overview

{
  "image_sources": [
    {
      "position": "Integer - Position of the source",
      "title": "String - Title of the source",
      "source": "String - Name of the source",
      "source_logo": "String - URL of the source's logo",
      "link": "String - Link to the source",
      "thumbnail": "String - Thumbnail version of image that is present in the source's content",
      "actual_image_width": "Integer - Width of the actual image",
      "actual_image_height": "Integer - Height of the actual image",
      "date": "String - Date posted of the source",
      "price": "String - Price of the source",
      "extracted_price": "Float - Source price as a float",
      "in_stock": "Boolean - Availability of the item in the image",
      "condition": "String - Condition of the item in the image"
    },
  ]
}

Example with Giraffe

Example with Giraffe

JSON Example

{
   "search_metadata": {
    "id": "6530c477b68f8bddbb889fad",
    "status": "Success",
    "json_endpoint": "https://serpapi.com/searches/5b1e7607022e88ed/6530c477b68f8bddbb889fad.json",
    "created_at": "2023-10-19 05:53:59 UTC",
    "processed_at": "2023-10-19 05:54:00 UTC",
    "google_lens_image_sources_url": "https://lens.google.com",
    "raw_html_file": "https://serpapi.com/searches/5b1e7607022e88ed/6530c477b68f8bddbb889fad.html",
    "prettify_html_file": "https://serpapi.com/searches/5b1e7607022e88ed/6530c477b68f8bddbb889fad.prettify",
    "total_time_taken": 2.81
  },
  "search_parameters": {
    "engine": "google_lens_image_sources",
    "page_token": "YTIxMzExY2YtNzNkZi00ZDVkLTgyMzAtYzJiY2ZmMGViODdm"
  },
  "image_sources": [
    {
      "position": 1,
      "title": "Giraffe - Wikipedia",
      "source": "Wikipedia",
      "source_logo": "https://encrypted-tbn2.gstatic.com/favicon-tbn?q=tbn:ANd9GcRLIcgPlYxOaoBg0MnSobLYyflrgF_RLdwAY09AXHWGy2jqWQnuIBNCY5I1BuzY7jeAJga0y0b9htBHe94i3Pg4B0NhHMNDVsmS-FVRKL014d-Xf6sX",
      "link": "https://en.wikipedia.org/wiki/Giraffe",
      "thumbnail": "https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcTCuvJwW3KZ0D-FYnZM8BXAwmN3fGpNo6Z7R4ki2Ng0Qkh9sY58",
      "actual_image_width": 800,
      "actual_image_height": 1012
    },
    {
      "position": 2,
      "title": "File:Giraffe Mikumi National Park.jpg - Wikipedia",
      "source": "Wikipedia",
      "source_logo": "https://encrypted-tbn2.gstatic.com/favicon-tbn?q=tbn:ANd9GcRLIcgPlYxOaoBg0MnSobLYyflrgF_RLdwAY09AXHWGy2jqWQnuIBNCY5I1BuzY7jeAJga0y0b9htBHe94i3Pg4B0NhHMNDVsmS-FVRKL014d-Xf6sX",
      "link": "https://en.wikipedia.org/wiki/File:Giraffe_Mikumi_National_Park.jpg",
      "thumbnail": "https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcTCuvJwW3KZ0D-FYnZM8BXAwmN3fGpNo6Z7R4ki2Ng0Qkh9sY58",
      "actual_image_width": 800,
      "actual_image_height": 1012
    },
    {
      "position": 3,
      "title": "African Safari By: Maia Coen — Imprint Tours",
      "source": "Imprint Tours",
      "source_logo": "https://encrypted-tbn1.gstatic.com/favicon-tbn?q=tbn:ANd9GcSfKorFhbnijL8SjTasbPHrCSZUf9P-FRYZ81hoYbggCNgzW1WTpNa_TCnrVxenlurNWFvz0vnkIYcR5gt9HKT5qnIG_rdpXFjIHR06wvVEWc8HdWtR",
      "link": "https://imprinttours.com/blog/2019/9/14/african-safari-by-maia-coen",
      "thumbnail": "https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcQJ5HDX4x77oIXl2meGjC1IYNi1ddRA9dSdaZUL1DiBoui21gIE",
      "actual_image_width": 1200,
      "actual_image_height": 1600,
      "date": "2019 M09 14"
    },
    ...
  ]
}

Example with Desk

Example with Desk

JSON Example

{
  "search_metadata": {
    "id": "65e23e2531dccc426c1eadcc",
    "status": "Success",
    "json_endpoint": "https://serpapi.com/searches/12706ca67e0fe919/65e23e2531dccc426c1eadcc.json",
    "created_at": "2024-03-01 20:44:21 UTC",
    "processed_at": "2024-03-01 20:44:21 UTC",
    "google_lens_image_sources_url": "https://lens.google.com/_/LensWebStandaloneUi/data/batchexecute?hl=en",
    "raw_html_file": "https://serpapi.com/searches/12706ca67e0fe919/65e23e2531dccc426c1eadcc.html",
    "prettify_html_file": "https://serpapi.com/searches/12706ca67e0fe919/65e23e2531dccc426c1eadcc.prettify",
    "total_time_taken": 2.04
  },
  "search_parameters": {
    "engine": "google_lens_image_sources",
    "page_token": "YTkyNWI5OGUtZTFiOS00ZmM4LTgwZDAtZGIyYjJlOTFhMGY3",
    "hl": "en",
    "country": "us"
  },
  "image_sources": [
    {
      "position": 1,
      "title": "Whetzel Desk Color: Espresso",
      "source": "jossandmain.com",
      "source_logo": "https://encrypted-tbn3.gstatic.com/favicon-tbn?q=tbn:ANd9GcRi7eIvqzFFe-UI2Tf_TzTnOuGPYSMRPQTyeLTW6tepYPdyGdtromWxW1-QnHOdYTNGfJ4siWgi9DYExe0SRB9zO24W36wSZr2FZaVAKxL5QP6JMvUBifEY",
      "link": "https://www.jossandmain.com/furniture/pdp/whetzel-desk-j000233147.html",
      "thumbnail": "https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcSxaxIMBHOCEecze_Y0ODNy_DY6oMKXkPSzUQFVVxup0vASSKkE",
      "actual_image_width": 755,
      "actual_image_height": 755,
      "price": "$290.00",
      "extracted_price": 290.0,
      "in_stock": true
    },
    {
      "position": 2,
      "title": "2 Piece Red Campaign Desk & Side Table Set Home Living Office",
      "source": "ebay.com",
      "source_logo": "https://encrypted-tbn0.gstatic.com/favicon-tbn?q=tbn:ANd9GcT5NXsW5qpQoNKtvnEC0sNL88H54opWmBBYIh2gQ3U_SGUU-yc8xV_BfeECVq4HYfwroQsx3k4lpMvjDByZM4KvONyK63j7aI6RPQrDFwRa9lo",
      "link": "https://www.ebay.com/itm/194347159705",
      "thumbnail": "https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcQL7jc7tE9QWAttxhOsphPkIG1QmT5cKkEXTTB2CWM1c55JK4gY",
      "actual_image_width": 400,
      "actual_image_height": 400,
      "price": "$585.00",
      "extracted_price": 585.0,
      "in_stock": true
    },
    ...
    {
      "position": 26,
      "title": "Annetta 80\" Wood Bookcase, Black",
      "source": "jossandmain.com",
      "source_logo": "https://encrypted-tbn3.gstatic.com/favicon-tbn?q=tbn:ANd9GcRi7eIvqzFFe-UI2Tf_TzTnOuGPYSMRPQTyeLTW6tepYPdyGdtromWxW1-QnHOdYTNGfJ4siWgi9DYExe0SRB9zO24W36wSZr2FZaVAKxL5QP6JMvUBifEY",
      "link": "https://www.jossandmain.com/furniture/pdp/annetta-80-wood-bookcase-black-byv11851.html",
      "thumbnail": "https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcQA_hwLmOk5mP8UMWWgFpNbBscl-VonquArl4q6sfzESuNXa0mJ",
      "actual_image_width": 380,
      "actual_image_height": 380,
      "price": "$2,300.00",
      "extracted_price": 2300.0,
      "in_stock": false
    },
    ...
    {
      "position": 108,
      "title": "Vintage retro red study table",
      "source": "carousell.sg",
      "source_logo": "https://encrypted-tbn3.gstatic.com/favicon-tbn?q=tbn:ANd9GcQTi3kYs_C75JaRVmPF6n9VIfQjWDB6wBBYX3BHCbeNcdyJjUJOndQ7oVhmcNprRZ57ejGOcN-X9toli4f4_Kp0Al4Xc5SjLBTJDIjIR4qTAgzHh5wV",
      "link": "https://www.carousell.sg/p/vintage-retro-red-study-table-1185056310/",
      "thumbnail": "https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcQq0UxGvIbzwDuwujFSLgVIPbgj4Sav5LkAwZoHcW3hvq6CgOxO",
      "actual_image_width": 1080,
      "actual_image_height": 810,
      "price": "$223.11",
      "extracted_price": 223.11,
      "condition": "Used"
    },
    ...
    {
      "position": 114,
      "title": "Three Quick and Easy Furniture Fixes - Scavenger Chic",
      "source": "Scavenger Chic",
      "source_logo": "https://encrypted-tbn1.gstatic.com/favicon-tbn?q=tbn:ANd9GcQb8ERHsrBgXG8aUm0rcMWGQTUXRPBl2_2RgcdNwxRRfcRXdkPD241SjSVaaHOFsKbqTL2Qi3qS1wMYFrmDzmJVE0znlj3PKi4SfmxO8hXK6h65HY217Q",
      "link": "https://scavengerchic.com/2024/01/24/three-quick-and-easy-furniture-fixes/",
      "thumbnail": "https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcSCR856vXKxOykgEPzVB_XSlYTrgu1OqwPiwuARDAyiH2Rxjb5h",
      "actual_image_width": 545,
      "actual_image_height": 336,
      "date": "Jan 24, 2024"
    },
    ...
    }
  ]
}