# 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/workflows/google-lens
- Handle: `@google-lens`
- Category: [Search](https://fous.com/workflows/category/search)
- Source website: https://lens.google.com
- Last verified: Sep 29, 2026
- Fous is not affiliated with Google Lens.

## Methods

### Search by image

Operation `search_by_image`, version 1. 1 credit per call.

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

Call the API with a Fous API key (`FOUS_API_KEY`). To create one, turn on Developer mode in Fous Studio, then open Keys & connections → API keys (https://app.fous.com/keys).

```bash
# First set your key: export FOUS_API_KEY='YOUR_FOUS_API_KEY'
: "${FOUS_API_KEY:?Set FOUS_API_KEY before running this example}"

curl 'https://api.fous.com/v1/query' \
  --fail-with-body --silent --show-error --max-time 120 \
  -H "Authorization: Bearer $FOUS_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.
# First set your key: export FOUS_API_KEY='YOUR_FOUS_API_KEY'
import json
import os
import urllib.error
import urllib.request

api_key = os.environ.get("FOUS_API_KEY")
if not api_key:
    raise RuntimeError("Set FOUS_API_KEY before running this example")

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=120) 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.
// First set your key: export FOUS_API_KEY='YOUR_FOUS_API_KEY'
const apiKey = process.env.FOUS_API_KEY;
if (!apiKey) throw new Error("Set FOUS_API_KEY before running this example");

const response = await fetch("https://api.fous.com/v1/query", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${apiKey}`,
    "Content-Type": "application/json",
  },
  signal: AbortSignal.timeout(120_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);
```

Or describe the data in plain language: send `{"api":"@google-lens","prompt":"Describe the data you need, with every detail"}` to the same URL. Fous fills in the input, runs the method that fits and returns only the fields you asked for; `data.route.calls[].request` is the exact call it made. Routing is free; the run costs the same.

## 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

### Is Fous affiliated with Google Lens?

No. Fous is not affiliated with Google Lens. This workflow reads the public lens.google.com website and returns its data.

### How much does it cost?

Each run costs 1 credit. 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; repeating the same request within a day may return the saved result. Fous checks this workflow automatically; it last passed a check 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/workflows/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/workflows/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/workflows/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/workflows/unsplash.md): Discover photos shared on Unsplash.
- [Google Books API](https://fous.com/workflows/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/workflows/wikimedia-commons.md): Discover freely licensed photos and other images from Wikimedia Commons.
- [Google Hotels API](https://fous.com/workflows/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/workflows/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 workflows](https://fous.com/workflows/category/search)
