John Cole

Aug 15, 2026 • 4 min read

Visual Product Search: Identify Products From a Photo With the Google Lens API

Use the Google Lens API to run visual product search, match a photo to live listings, and pull prices and stock as structured JSON.

I do a lot of e-commerce data work, and I kept hitting the same wall: a product photo with no SKU, no title, and no source page. Matching that image to a real listing by hand does not scale past a handful of items.

What visual product search actually is

Visual product search takes an image and returns the products that match it, with the source page, price, and stock, as structured data instead of a screen full of thumbnails. The Google Lens API does exactly that: send a public image URL, set the search type to products, and it returns match rows you can parse.

What it returns

Each match row is one JSON object with these fields:

  • title and source: the product and the page that lists it

  • url and thumbnail, plus the full image with imageWidth and imageHeight

  • price, currency, and inStock for shopping results

  • date the source was last seen

Two honest limits: the full image field is null on exact-match searches, and rating and reviewCount are rarely published by the source, so do not build a pipeline that depends on them.

Run it in three steps

1. Point it at a public image URL and set the search type to products.
2. Run the Actor; each match comes back as one JSON row.
3. Read the JSON directly or export the run to CSV.

Use it as a REST API

Call the run-sync endpoint and read the dataset in one request:

POST api.apify.com/v2/acts/johnvc~google-lens-api/run-sync-get-dataset-items?token=YOUR_TOKEN
Content-Type: application/json

{
 "image_url": "IMAGE_URL_HERE",
 "search_type": "products"
}

You get back an array of match rows, ready to load into a catalog or a spreadsheet.

Wire it into Claude with MCP

The Actor also runs over MCP, so an AI agent can call it as a tool with no scraping code. Point your client at the Apify MCP server (mcp.apify.com) and ask it something concrete:

Identify the product in this photo and list any shopping
results with prices: https://example.com/sneaker.jpg

Claude, Cursor, or ChatGPT then runs the search and hands you the structured rows.

What people build with it

A few patterns from real use: catalog enrichment that turns a supplier photo into a titled, priced listing; resale and dropshipping price checks; and brand monitoring to spot where product images get reused. The examples gallery has runnable versions, including bulk reverse image search from a URL list and visual search from Claude via MCP.

For the reverse-image side of the same Actor, there is a full walkthrough on Medium and a local-file how-to on Dev.to.

FAQ About Visual Product Search

How do I get prices and stock from a product photo?

Set the search type to products and read the price, currency, and inStock fields on each match row. Shopping results carry them; general visual matches usually do not.

Where does the product data come from and how fresh is it?

Results come from live visual search at request time, so each run reflects what is visible right then. There is no cached index, you get current matches.

How much does a visual product search cost via the API?

Pricing is pay per result, so a single-image lookup costs cents and a bulk job scales in a straight line. You are billed for the match rows you get back, not for a monthly seat.

Can I run visual product search from Claude or another AI agent with MCP?

Yes. The Actor is exposed over MCP, so Claude, Cursor, or ChatGPT can call it as a tool and read the JSON directly. No client code, just a prompt with an image URL.

Can an AI agent pay for this scraper in USDC with x402?

Yes. The Google Lens API supports agentic payments via the x402 protocol, so AI agents and MCP clients can pay for runs in USDC on Base with no Apify account or API token. Point your agent at the Apify MCP server (mcp.apify.com) and it can discover, pay for, and run the scraper autonomously; the Apify x402 announcement has the details.

If you hit a bad result or a field you did not expect, open an issue on the Actor and I usually reply within a day.

Join John on Peerlist!

Join amazing folks like John and thousands of other builders on Peerlist.

peerlist.io/

It’s available... this username is available! 😃

Claim your username before it's too late!

This username is already taken, you’re a little late.😐

0

0

0