# Google Lens: Search by image

`google_lens/matches/search` · version 1.0.0 · pilot · 1 credits a call

The pages Google Lens matches an image with, about 60, with their title, site, photo and price, as Lens lists them.

Categories: E-commerce

## When to use

You have a photo (a piece of furniture, a garment, a product) and want the pages that show it or something like it: stores selling it, with their price and stock, and any page with a similar image. Pass the image's public address. `type` picks Lens's tab: visual matches (similar images, default) or exact matches (the same image elsewhere). Add words with `query` to narrow it ("velvet", "black"). `country` sets the stores and the currency.

## Call

```bash
curl https://api.lobstr.io/v2/run \
  -H "Authorization: Bearer $LOBSTR_API_KEY" \
  -H "content-type: application/json" \
  -d '{"source": "google_lens", "operation": "matches/search", "options": {"image_url": "https://encrypted-tbn1.gstatic.com/shopping?q=tbn:ANd9GcRtwvnhth3bbPZp8cYnVYym3L787a2w_WCoc_Law7PKs97RFrKqSXG59okHwit9PfkPE4GVoSAfvvlMujwhuovSeImTivbjaZkz1kfb2UCC"}}'
```

It answers:

```json
{"object": "run", "status": "succeeded", "count": 60, "has_more": true, "next": {"source": "google_lens", "operation": "matches/search", "options": {...}},
 "cost": {"credits": 1}, "balance": {"credits": 9990}, "results": [...]}
```

`cost` and `balance` are objects: a call's credits are `cost.credits`. `results` holds the records (below). `next` is the whole call for the following page: send it as it is; `null` on the last page.

Beside `options`, the call takes:

| Parameter | Type | Description |
|---|---|---|
| `fields` | array of string | The record fields to keep, by path (`title`, `address.city`); `object`, `id` and `position` always come. Left out: every field. |
| `limit` | integer | Only the first N records of this call (1 to 1000), in the call's order; the call costs the same, and `next` keeps the limit. Left out: every record. |

## Options

| Option | Type | Required | Default | Description |
|---|---|---|---|---|
| `image_url` | string (uri) | yes |  | The image's public address, which Google downloads (no sign-in, no cookie): a photo on a store, a copy on your own storage. Lens searches the part of the image it finds most salient (a sofa in a living room). |
| `type` | `visual`, `exact` |  | `"visual"` | Lens's tab: visual, the pages with a similar image (about 60, the stores among them with a price); exact, the pages with this very image (up to a few hundred, with its size on each). |
| `query` | string |  |  | Words Lens adds to the image ("velvet", "Togo armchair"): the matches are those of both. |
| `language` | string |  | `"en"` | The language of Google's words (titles Google writes, stock, dates), as Google's `hl`. |
| `country` | string |  | `"us"` | The country whose stores and prices Lens lists, as Google's `gl` (ISO 3166-1 alpha-2, lower case): with fr, French stores in euros. |

## Record

Each item of `results`. Every field is always present, `null` when the site gives nothing.

| Field | Type | Description |
|---|---|---|
| `object` | `"match"` | The kind of record: a page matching an image. |
| `id` | string | Google's id of the page's document for a visual match (3l11OeqcfrA-SM); the page's address for an exact one, which Google gives no id. |
| `position` | integer | Its rank in Lens's tab. |
| `type` | `visual`, `exact` | The tab it comes from. |
| `title` | string | The page's title, as Lens shows it. |
| `url` | string (uri) | The page. |
| `source` | object | The site the page is on. |
| `source.name` | string | null | Its name as Lens writes it: Amazon, Maisons du Monde. |
| `source.domain` | string | null | Its host: www.amazon.fr. |
| `source.icon_url` | string | null | Its icon as Lens shows it (often the image itself, data:...). |
| `price` | object | null | The price Lens shows for the page (a store selling it): `amount`, `currency` (ISO 4217) and `text` as Google wrote it ("1 175 €*": * is Google's "check the site"); null otherwise. |
| `price.amount` | number | null |  |
| `price.currency` | string | null |  |
| `price.text` | string |  |
| `in_stock` | boolean | null | true when Lens says it is in stock, false when out of stock, null when it says neither. |
| `rating` | object | null | The product's rating on the page and its reviews count, when Lens shows them. |
| `rating.value` | number |  |
| `rating.scale` | `5` |  |
| `rating.count` | integer | null |  |
| `date_text` | string | null | The date Lens gives an exact match's page, as it writes it in `language` ("13 Jan 2021"); null for a visual match. |
| `thumbnail` | object | null | The image as Lens shows it, its size in pixels when Lens says it. |
| `thumbnail.url` | string | null |  |
| `thumbnail.width` | integer | null |  |
| `thumbnail.height` | integer | null |  |
| `image` | object | null | The image on the page: its address (visual matches) and its size in pixels. |
| `image.url` | string | null |  |
| `image.width` | integer | null |  |
| `image.height` | integer | null |  |
| `ids` | object | Google's ids of a visual match: its image's and its page's. |
| `ids.image_id` | string | null |  |
| `ids.document_id` | string | null |  |
| `source_url` | string (uri) | The image's search on Lens. |
| `observed_at` | string (date-time) | When it was read |

Example:

```json
{
  "object": "match",
  "id": "3l11OeqcfrA-SM",
  "position": 1,
  "type": "visual",
  "title": "Acme corner sofa in grey velvet",
  "url": "https://www.acme-furniture.example/products/corner-sofa",
  "source": {
    "name": "Acme Furniture",
    "domain": "www.acme-furniture.example",
    "icon_url": null
  },
  "price": {
    "amount": 1175,
    "currency": "USD",
    "text": "$1,175*"
  },
  "in_stock": true,
  "rating": {
    "value": 4.5,
    "scale": 5,
    "count": 12
  },
  "date_text": null,
  "thumbnail": {
    "url": "https://encrypted-tbn0.gstatic.com/images?q=tbn:example",
    "width": 188,
    "height": 268
  },
  "image": {
    "url": "https://www.acme-furniture.example/images/corner-sofa.jpg",
    "width": 1400,
    "height": 2000
  },
  "ids": {
    "image_id": "_A58_Sfqj08pVM",
    "document_id": "3l11OeqcfrA-SM"
  },
  "source_url": "https://lens.google.com/uploadbyurl?url=https%3A%2F%2Fwww.example.com%2Fsofa.jpg&hl=en&gl=us",
  "observed_at": "2026-11-24T17:21:00Z"
}
```

## Price

1 credit a call, whatever the tab holds. An image Google cannot read, a search with no match and a failed call are free.

## Errors

| Code | Status | Retry | Message |
|---|---|---|---|
| `invalid_image` | 422 | no | `image_url` is not an image's address (http or https); not charged. |
| `invalid_type` | 422 | no | `type` is visual or exact; not charged. |
| `image_unreadable` | 422 | no | Google could not download the image at `image_url` (not public, or not an image); not charged. |
| `site_unavailable` | 503 | yes | Google did not answer in time or answered its check instead of the search; retry later (not charged). |
| `unexpected_answer` | 424 | no | Google answered in a shape we do not read yet; we are told and fix it, and it is not charged. Retrying now gives the same. |
| `missing_api_key` | 401 | no | No API key: send it as `Authorization: Bearer <key>`. |
| `invalid_api_key` | 401 | no | The key is not valid, or not anymore. |
| `insufficient_credits` | 402 | no | The call costs more credits than are left. |
| `unknown_operation` | 404 | no | No such source and operation in the catalog. |
| `timeout` | 408 | yes | The call did not finish within its deadline (not charged). |
| `invalid_body` | 422 | no | The body is not a call: source, operation, options. |
| `invalid_options` | 422 | no | An option is missing or out of its contract; `param` names it. |
| `invalid_idempotency_key` | 400 | no | The Idempotency-Key header is not printable ASCII, or too long. |
| `concurrency_limit` | 429 | yes | The plan's calls at a time are all in progress (Free 1, Starter 2, Pro 10, Team 50); retry when one has finished (not charged, never queued). |
| `service_busy` | 503 | yes | Too many calls at once on the account; retry in a few seconds. |
| `balance_unavailable` | 503 | yes | The balance could not be read; retry in a few seconds. |

## Changelog

- **1.0.0** (2026-11-24): First version on the API v2.

Schema: https://api.lobstr.io/v2/catalog/google_lens/matches/search · All operations: https://api.lobstr.io/v2/catalog.md
