# Google Lens API

> Google Lens returns image identifications, visual matches, and detected text as a workflow and API.

Google Lens (Lens) identifies a picture and returns visual matches using a direct public image link. Search by image can also return text shown in Lens results; country can shape results, and max results sets the requested match count.

- Page: https://fous.com/tools/google-lens
- Handle: `@google-lens`
- Category: [Search](https://fous.com/tools/category/search)
- Source website: https://lens.google.com
- Last verified: Sep 29, 2026

## Methods

### Search by image

Operation `search_by_image`, version 1. 1 credit per completed call. Failed calls without a completed billing receipt are free; completed work can remain charged if delivery is interrupted.

Identify a picture from its public image link and find visual matches on Google Lens. Text recognition is returned only when publicly shown in Lens results; some matches may not show a price.

**Input**

| Field | Type | Required | Example | Description |
|---|---|---|---|---|
| `country` | string | no | `"United Kingdom"` | Country for results, as a name or two-letter code, for example United States or GB. |
| `image_url` | string | yes | `"https://upload.wikimedia.org/wikipedia/commons/6/6e/Golde33443.jpg"` | Direct public link to the picture, for example https://upload.wikimedia.org/wikipedia/commons/3/3a/Cat03.jpg. |
| `max_results` | integer | no | `5` | Maximum number of visual matches to return, for example 20 (up to 60). |

**Input schema**

```json
{
  "type": "object",
  "required": [
    "image_url"
  ],
  "properties": {
    "country": {
      "type": "string",
      "default": "United States",
      "description": "Country for results, as a name or two-letter code, for example United States or GB.",
      "examples": [
        "United Kingdom"
      ]
    },
    "image_url": {
      "type": "string",
      "description": "Direct public link to the picture, for example https://upload.wikimedia.org/wikipedia/commons/3/3a/Cat03.jpg.",
      "examples": [
        "https://upload.wikimedia.org/wikipedia/commons/6/6e/Golde33443.jpg",
        "https://upload.wikimedia.org/wikipedia/commons/3/3a/Cat03.jpg",
        "https://raw.githubusercontent.com/github/explore/main/topics/python/python.png"
      ]
    },
    "max_results": {
      "type": "integer",
      "default": 20,
      "maximum": 60,
      "minimum": 1,
      "description": "Maximum number of visual matches to return, for example 20 (up to 60).",
      "x-fous-developer": true,
      "examples": [
        5,
        6,
        30
      ]
    }
  },
  "additionalProperties": false,
  "examples": [
    {
      "country": "United Kingdom",
      "image_url": "https://upload.wikimedia.org/wikipedia/commons/6/6e/Golde33443.jpg",
      "max_results": 5
    },
    {
      "image_url": "https://upload.wikimedia.org/wikipedia/commons/3/3a/Cat03.jpg"
    },
    {
      "image_url": "https://raw.githubusercontent.com/github/explore/main/topics/python/python.png",
      "max_results": 6
    }
  ]
}
```

**Output**

| Field | Type | Example | Description |
|---|---|---|---|
| `best_guess` | string or null | `"a fluffy, cream-colored Golden Retriever puppy resting on a mossy log"` | Google’s best available identification of the picture. |
| `detected_text` | string or null |  | Text Google Lens reads in the picture, if shown. |
| `visual_matches` | array |  |  |
| `visual_matches[].price` | number or null |  |  |
| `visual_matches[].title` | string | `"Puppy - Wikipedia"` |  |
| `visual_matches[].currency` | string or null |  |  |
| `visual_matches[].page_link` | string | `"https://en.wikipedia.org/wiki/Puppy"` |  |
| `visual_matches[].website_name` | string | `"Wikipedia"` |  |
| `visual_matches[].thumbnail_image_link` | string or null | `"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQC7kGMj-B6Mgyjglz97WPDdqC4-rR5EL8m4tRX2-mmR44ANFNe"` |  |

**Example input**

```json
{
  "country": "United Kingdom",
  "image_url": "https://upload.wikimedia.org/wikipedia/commons/6/6e/Golde33443.jpg",
  "max_results": 5
}
```

**Example output**

```json
{
  "best_guess": "a fluffy, cream-colored Golden Retriever puppy resting on a mossy log",
  "detected_text": null,
  "visual_matches": [
    {
      "price": null,
      "title": "Puppy - Wikipedia",
      "currency": null,
      "page_link": "https://en.wikipedia.org/wiki/Puppy",
      "website_name": "Wikipedia",
      "thumbnail_image_link": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQC7kGMj-B6Mgyjglz97WPDdqC4-rR5EL8m4tRX2-mmR44ANFNe"
    },
    {
      "price": null,
      "title": "Train your own image classifier with Inception in TensorFlow",
      "currency": null,
      "page_link": "https://research.google/blog/train-your-own-image-classifier-with-inception-in-tensorflow/",
      "website_name": "Google Research",
      "thumbnail_image_link": "https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcS0u2zE1-X0IpysPYas7rtnnHYGUTu76_kSxNt5qb-b2YtNkeJu"
    },
    {
      "price": null,
      "title": "Image Recognition in Ruby Tensorflow | by Arafat Khan | Medium",
      "currency": null,
      "page_link": "https://medium.com/@Arafatkatze/image-recognition-in-ruby-tensorflow-df5d5c05389b",
      "website_name": "Medium",
      "thumbnail_image_link": "https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcTFbGi0GbXf1l-EyPpu_yXXa_wctOmDUn_6vLWiD-M0IHK8rN5g"
    }
  ]
}
```

## Quick start

Replace `YOUR_API_KEY` with a Fous API key. To create one, open Developers at the bottom of Fous Studio, turn on Developer mode, then go to API keys (https://app.fous.com/keys). Change the values in `input` to run the same tool on new data.

```bash
curl 'https://api.fous.com/v1/query' \
  --fail-with-body --silent --show-error --max-time 180 \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "api": "@google-lens",
  "visibility": "public",
  "operation": "search_by_image",
  "version": 1,
  "input": {
    "country": "United Kingdom",
    "image_url": "https://upload.wikimedia.org/wikipedia/commons/6/6e/Golde33443.jpg",
    "max_results": 5
  },
  "response": {
    "format": "json"
  }
}'
```

```python
# Save as fous.py and run with python3 fous.py. No packages needed.
import json
import urllib.error
import urllib.request

api_key = "YOUR_API_KEY"

body = json.loads("{\n  \"api\": \"@google-lens\",\n  \"visibility\": \"public\",\n  \"operation\": \"search_by_image\",\n  \"version\": 1,\n  \"input\": {\n    \"country\": \"United Kingdom\",\n    \"image_url\": \"https://upload.wikimedia.org/wikipedia/commons/6/6e/Golde33443.jpg\",\n    \"max_results\": 5\n  },\n  \"response\": {\n    \"format\": \"json\"\n  }\n}")
request = urllib.request.Request(
    "https://api.fous.com/v1/query",
    data=json.dumps(body).encode("utf-8"),
    headers={
        "Authorization": f"Bearer {api_key}",
        "Content-Type": "application/json",
    },
    method="POST",
)
try:
    with urllib.request.urlopen(request, timeout=180) as response:
        result = json.load(response)
except urllib.error.HTTPError as error:
    raise RuntimeError(f"HTTP {error.code}: {error.read().decode('utf-8', errors='replace')}") from error
if result.get("success") is False:
    raise RuntimeError(result.get("error", {}).get("message", "Request failed"))
print(json.dumps(result["data"]["output"], indent=2))
```

```typescript
// Save as fous.mts and run with npx tsx fous.mts.
const apiKey = "YOUR_API_KEY";

const response = await fetch("https://api.fous.com/v1/query", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${apiKey}`,
    "Content-Type": "application/json",
  },
  signal: AbortSignal.timeout(180_000),
  body: JSON.stringify({
  "api": "@google-lens",
  "visibility": "public",
  "operation": "search_by_image",
  "version": 1,
  "input": {
    "country": "United Kingdom",
    "image_url": "https://upload.wikimedia.org/wikipedia/commons/6/6e/Golde33443.jpg",
    "max_results": 5
  },
  "response": {
    "format": "json"
  }
}),
});
type ApiResult = { success: boolean; data?: { output: unknown }; error?: { message: string } };
const result: ApiResult = await response.json();
if (!response.ok || result.success === false) {
  throw new Error(result.error?.message ?? `HTTP ${response.status}`);
}
if (!result.data) throw new Error("Missing API response data");
console.log(result.data.output);
```

## Use from an AI assistant

Connect this tool to Claude Code, Claude Desktop, Cursor, VS Code, Codex and any MCP client as its own MCP server. Each method is a typed tool whose arguments are the method’s input.

- Server URL: `https://api.fous.com/mcp/tools/google-lens`
- Authorization: `Authorization: Bearer <Fous API key>`

**Tools**

- `search_by_image`: Search by image. 1 credit per completed call. Failed calls without a completed billing receipt are free; completed work can remain charged if delivery is interrupted.
- `fous_get_run`: the result of a run that was still going, by its `request_id`. Free.

Claude Code:

```bash
claude mcp add --scope user --transport http fous-google-lens https://api.fous.com/mcp/tools/google-lens --header "Authorization: Bearer ${FOUS_API_KEY:?Set FOUS_API_KEY to your Fous API key}"
```

To give the assistant every tool, connect `https://api.fous.com/mcp`: it finds one with `fous_search_tools` and runs it with `fous_run_tool`. Setup for other clients: https://fous.com/llms-full.txt.

## Use cases

- Identify products or objects in publicly linked pictures
- Find visually similar images and their source websites
- Review prices shown for visual matches
- Extract text shown in image search results

## FAQ

### Can I run it with my own inputs?

Yes. Change the inputs in Studio and press Run, or send new inputs from your code, or ask a connected AI assistant.

### Can I call this Google Lens tool as an API?

Yes. Send a POST request to /v1/query with your Fous API key and the inputs, and get JSON back.

### How much does it cost?

Each completed run costs 1 credit. Failed runs without a completed receipt are free; completed work can remain charged if delivery is interrupted. With pay as you go, a credit costs 1¢. Monthly plans cost less per credit.

### Do I need a Google Lens account?

No. You only need a Fous account.

### How current is the data?

Fous gets the data from lens.google.com when you run it. Some results are reused for up to 24 hours, and results that use your account or key are never reused. It was last verified on Sep 29, 2026.

### What does this picture show?

Search by image returns Google’s best available identification of the picture.

### Which websites show visually similar pictures?

Search by image returns visual matches with their titles, page links, website names, and thumbnail image links.

### What text appears in the picture?

Search by image returns detected text when it is shown in Lens results.

## Related

- [Google Search API](https://fous.com/tools/google-search.md): Google Search returns public web, image, job, event, related-question, and autocomplete results in Google’s order, with answers and details when available; results may be fewer, omit information, or be empty.
- [Pexels API](https://fous.com/tools/pexels.md): Pexels offers free stock photos and videos, with searches returning up to 80 results in Pexels search order.
- [Google Shopping API](https://fous.com/tools/google-shopping.md): Google Shopping shows product offers, prices, ratings, delivery and store links; results vary by country and listings, totals need shown shipping, and typical ranges may be missing.
- [Unsplash API](https://fous.com/tools/unsplash.md): Discover photos shared on Unsplash.
- [Google Books API](https://fous.com/tools/google-books.md): Google Books searches books and provides book details, reader ratings, and local ebook prices when available; newest results sort by publication date.
- [Wikimedia Commons API](https://fous.com/tools/wikimedia-commons.md): Discover freely licensed photos and other images from Wikimedia Commons.
- [Google Hotels API](https://fous.com/tools/google-hotels.md): Google Hotels finds stays, guest details and reviews, and compares booking-site totals, cancellation and links for up to six adults; prices and availability can change, and some prices or topic ratings may be unavailable.
- [Google Maps API](https://fous.com/tools/google-maps.md): Google Maps returns nearby places, public place details, up to 100 public reviews, and up to three routes; transit options vary by departure time.
- [All Search tools](https://fous.com/tools/category/search)
