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.

zero_trace

Optional

Enterprise only. Parameter enables ZeroTrace mode. It can be set to false (default) or true. Enable this mode to skip storing search parameters, search files, and search metadata on our servers. This may make debugging more difficult.

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": "66fd8ce6c33936ef383a6ced",
    "status": "Success",
    "json_endpoint": "https://serpapi.com/searches/5d8c815468295db2/66fd8ce6c33936ef383a6ced.json",
    "created_at": "2024-10-02 18:11:50 UTC",
    "processed_at": "2024-10-02 18:11:50 UTC",
    "google_lens_image_sources_url": "https://lens.google.com/_/LensWebStandaloneUi/data/batchexecute?",
    "raw_html_file": "https://serpapi.com/searches/5d8c815468295db2/66fd8ce6c33936ef383a6ced.html",
    "prettify_html_file": "https://serpapi.com/searches/5d8c815468295db2/66fd8ce6c33936ef383a6ced.prettify",
    "total_time_taken": 0.94
  },
  "search_parameters": {
    "engine": "google_lens_image_sources",
    "page_token": "MDJkOTVmNDQtMDkzNi00NDcyLTgzYzctZTZmNDU1YzQwNTE0"
  },
  "image_sources": [
    {
      "position": 1,
      "title": "25 Best Photos of Cute Baby Giraffes - 500px",
      "source": "500px",
      "source_logo": "https://encrypted-tbn1.gstatic.com/favicon-tbn?q=tbn:ANd9GcQaFq3LcR5mpmJG0hXtRwEd3LH1buU29I-kDCbiGCIjcF5_nwvYGr8oGg16ZCzVe4rYJn38RexWxQzbIuO2JkNvORrmuv6kR-SwubFfrEjgi1EC",
      "link": "https://iso.500px.com/baby-giraffe-photos/",
      "thumbnail": "https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcSMu6G6y-whpaTk4E8IUrJ3MPrFSU9YSIHJrW9X8kKTkZ5Py-Se",
      "actual_image_width": 2048,
      "actual_image_height": 1361
    },
    {
      "position": 2,
      "title": "Wild Earth",
      "source": "Pinterest",
      "source_logo": "https://encrypted-tbn0.gstatic.com/favicon-tbn?q=tbn:ANd9GcTQdhYKRbbqgCC_hUKbg1LBwalc5hFvDef04aKtEm4ymk1UmePKJrPlt_LjHvB7Aq1dYoIBbiIJ1NlsjKc5XTus20V-QeQkUPl9ea4gZzUE1nhIYNB2UA",
      "link": "https://www.pinterest.com/pin/187603140706009966/",
      "thumbnail": "https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcSjACkkmV5BZjtGEr9bbUItTF2o1fqZTpZ7o-eyqLysV1XKLbFe",
      "actual_image_width": 500,
      "actual_image_height": 750,
      "date": "Jan 12, 2016"
    },
    {
      "position": 3,
      "title": "LuckyLaceyKS (u/LuckyLaceyKS) - Reddit",
      "source": "Reddit",
      "source_logo": "https://encrypted-tbn2.gstatic.com/favicon-tbn?q=tbn:ANd9GcRFeJS-IhfJCysoVmCqJ1d-1lzbIHTsbcy4DrBsZJpxQ31zznhym7THnNEKCEnngpvdl4aupEFtEblIPBEMJY7_biy055d40m6TYfVg7CpFOrWOXw",
      "link": "https://www.reddit.com/user/LuckyLaceyKS/",
      "thumbnail": "https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcTNV22-UIPQzBDzLSMzUNFQAzCC52GA0uEu_D9IVrHjbiG_rsqx",
      "actual_image_width": 2048,
      "actual_image_height": 1361
    },
    ...
  ]
}

Example with Desk

Example with Desk

JSON Example

{
  "search_metadata": {
    "id": "66fd8ce8c33936ef340f2c6c",
    "status": "Success",
    "json_endpoint": "https://serpapi.com/searches/5d8c815468295db2/66fd8ce8c33936ef340f2c6c.json",
    "created_at": "2024-10-02 18:11:52 UTC",
    "processed_at": "2024-10-02 18:11:52 UTC",
    "google_lens_image_sources_url": "https://lens.google.com/_/LensWebStandaloneUi/data/batchexecute?",
    "raw_html_file": "https://serpapi.com/searches/5d8c815468295db2/66fd8ce8c33936ef340f2c6c.html",
    "prettify_html_file": "https://serpapi.com/searches/5d8c815468295db2/66fd8ce8c33936ef340f2c6c.prettify",
    "total_time_taken": 0.99
  },
  "search_parameters": {
    "engine": "google_lens_image_sources",
    "page_token": "MjAwYjM2NzMtNTNmYi00NjZiLWE1OTgtNjIyMzkwMWVmZmNh"
  },
  "image_sources": [
    {
      "position": 1,
      "title": "Industrial reclaimed solid wood desk with side drawers",
      "source": "etsy.com",
      "source_logo": "https://encrypted-tbn2.gstatic.com/favicon-tbn?q=tbn:ANd9GcSBC4oQ3bkBuevoH8XpxAl0ri8XiuLd4I543l3vUizk2p7JnS_Kl1aJTVxs9nt4vEC2m0siqwjI-o3Mysd9TaJqSrdOdkseIKFJA66bIfBIaDs",
      "link": "https://www.etsy.com/listing/1009071216/industrial-reclaimed-solid-wood-desk",
      "thumbnail": "https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcTXGNPJLe1qOInijIp4amoINCqJB4I7WRV7rIX02QywS-dgzCBj",
      "actual_image_width": 570,
      "actual_image_height": 570,
      "price": "$139.46",
      "extracted_price": 139.46,
      "in_stock": true
    },
    {
      "position": 2,
      "title": "Industrial Reclaimed Solid Wood Desk With Side Drawers - Etsy UK",
      "source": "Etsy",
      "source_logo": "https://encrypted-tbn2.gstatic.com/favicon-tbn?q=tbn:ANd9GcSBC4oQ3bkBuevoH8XpxAl0ri8XiuLd4I543l3vUizk2p7JnS_Kl1aJTVxs9nt4vEC2m0siqwjI-o3Mysd9TaJqSrdOdkseIKFJA66bIfBIaDs",
      "link": "https://www.etsy.com/uk/listing/1009071216/industrial-reclaimed-solid-wood-desk",
      "thumbnail": "https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcTXGNPJLe1qOInijIp4amoINCqJB4I7WRV7rIX02QywS-dgzCBj",
      "actual_image_width": 570,
      "actual_image_height": 570
    },
    {
      "position": 3,
      "title": "Industrial reclaimed solid wood desk with side drawers",
      "source": "Cabournscarpentry",
      "source_logo": "https://encrypted-tbn3.gstatic.com/favicon-tbn?q=tbn:ANd9GcSQiDPPEg-bxOh6LYVC7tReHLKqjdIXpAek4sxsVZ4BZxShd52cOOxCfYoMLyBFU-YUB5anU8zWZ9vJe3BeZhfOg2pcgazv07hEyMvxEsGwdYtFV69nff5TDSD4Dg",
      "link": "https://cabournscarpentry.co.uk/ols/products/industrial-reclaimed-solid-wood-desk-with-side-drawers",
      "thumbnail": "https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcToDWWDbyJ2d8vBaJRuyt69SpIM2XhygZ8cCXp30NTd16Tc6jDS",
      "actual_image_width": 1200,
      "actual_image_height": 1200
    },
    ...
  ]
}