Google Lens API Python Client

Extract Google Lens data with our Google Lens API Python client. Get programmatic access to visual matching, structured data extraction, object recognition, reverse image search, OCR text extraction, and more using simple Python code. Start free, no credit card required.

Trusted by industry leaders all over the world

Integrate our Google Lens API

The Apify API client for Python is the official library that allows you to use Google Lens API in Python, providing convenience functions and automatic retries on errors. Get started with simple pip installation and robust error handling built-in.

Python

Python

JavaScript

JavaScript

HTTP

HTTP

MCP

MCP

1from apify_client import ApifyClient
2
3# Initialize the ApifyClient with your Apify API token
4# Replace '<YOUR_API_TOKEN>' with your token.
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7# Prepare the Actor input
8run_input = {
9 "type": "all",
10 "imageUrls": [{ "url": "https://console.apify.com/img/logos_apify/logo_apify_full_white_text.svg" }],
11}
12
13# Run the Actor and wait for it to finish
14run = client.actor("borderline/google-lens").call(run_input=run_input)
15
16# Fetch and print Actor results from the run's dataset (if there are any)
17print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
18for item in client.dataset(run["defaultDatasetId"]).iterate_items():
19 print(item)
20
21# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

Get data with Google Lens API Python client

Use our Python API client to extract Google Lens data by providing image URLs and operation type (translate, exact-match, visual-match, all, products, or homework). The API returns structured data, including OCR text segments, similar images with thumbnails and sources, object classifications, detailed metadata with bounding boxes and confidence scores, and JSON-formatted responses.

Input

{
"type": "all",
"imageUrls": [
{
"url": "<https://console.apify.com/img/logos_apify/logo_apify_full_white_text.svg>"
}
]
}

Output

[
{
"site": {
"url": "https://aselahhome.com/the-power-of-giving-raising-generous-kids/",
"name": "aselahhome.com",
"favicon": [
"https://encrypted-tbn0.gstatic.com/favicon-tbn?q=tbn:ANd9GcRYJ_aMUCZdBu7vW8jSzk57cUDU_mxz_Ez4iKw5sLNYcXOic6KlEMEnqzZQODLO_cS82RCF1irDU5MPr_uaFOAQNbQNUf43ukwDSAcT26st3gcUlg"
]
},
"title": "The Power of Giving: Raising Generous Kids - Selah Home",
"thumbnail": {
"url": "https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcRnwAEqKNTA9OBnhxGWeyPVkoXUT11TOWh3ySf8pqK2yd6eH3Bf",
"width": 1024,
"height": 768
}
},
{
"site": {
"url": "https://www.renestance.com/blog/muguet-de-mai-a-french-tradition/",
"name": "Renestance",
"favicon": [
"https://encrypted-tbn0.gstatic.com/favicon-tbn?q=tbn:ANd9GcTz8E-EUG55uY8K04JyHy2ZIBtIxHUCE17zNPUZOC-oKeP7jhFLQjGJYFDPjMh1weyWJYHGcJx3EzPNcenNOZjzSCCZcsbQcoHAmC5nzbIWt4HvLZH4ImY"
]
},
"title": "Muguet de Mai - A French Tradition - Renestance",
"thumbnail": {
"url": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSuOm9d1E1X7e2Jp5Rt27KbNjuNUmpDYstBhC8hDgQTi1N3Dslg",
"width": 1200,
"height": 800
}
}
]

How to use Google Lens API

Sign up for Apify account01

Creating an account is quick and free — no credit card required. Your account gives you access to more than 5,000 scrapers and APIs.

Get started for free
Install Apify Python client02

Install the Apify Python client using pip: pip install apify-client. This package provides a simple interface to interact with Google Lens API from your Python applications.

Get your Apify API token03

Go to settings in the Apify console and navigate to the “API & Integrations” tab. There, create a new token and save it for later.

Integrate Google Lens API04

Navigate to the Google Lens API page and click on the API dropdown menu in the top right corner. In the dropdown menu, you can see API clients, API endpoints, and more. Use the provided Python code examples to integrate Google Lens API into your Python application.

Open Google Lens Python API
Get your Google Lens data via API05

The Google Lens API returns structured JSON data that works perfectly with pandas, NumPy, and other Python data analysis libraries.

Why use Apify?

Never get blocked

Every plan (free included) comes with Apify Proxy, which is great for avoiding blocking and giving you access to geo-specific content.

Customers love us

We truly care about the satisfaction of our users and thanks to that we're one of the best-rated data extraction platforms on both G2 and Capterra.

Monitor your runs

With our latest monitoring features, you always have immediate access to valuable insights on the status of your web scraping tasks.

Export to various formats

Your datasets can be exported to any format that suits your data workflow, including Excel, CSV, JSON, XML, HTML table, JSONL, and RSS.

Integrate Apify to your workflow

You can integrate your Apify runs with platforms such as Zapier, Make, Keboola, Google Drive, or GitHub. Connect with practically any cloud service or web app.

Large developer community

Apify is built by developers, so you'll be in good hands if you have any technical questions. Our Discord server is always here to help!

Frequently asked questions

No, there is no official Google Lens Python API client available for developers. Google does not provide a public Python API client for Google Lens functionality. However, this Apify Actor serves as an unofficial Google Lens Python API client that replicates the core features of Google Lens, allowing you to programmatically analyze images for text recognition, reverse image search, and object identification through a reliable web scraping solution.

Yes, you can try the Google Lens Python API client for free! Apify offers a free tier that includes $5 of platform credits each month, which is typically enough for testing and small-scale usage. Simply create a free Apify account, navigate to the Google Lens Actor, and click "Try for free" to start processing images with the Python API client without any upfront payment.

With the Google Lens API Python client, you can extract OCR text with language detection and bounding box coordinates, find similar images through reverse image search with source URLs and thumbnails, identify and classify objects in images, discover exact image matches with hosting site information, translate extracted text into different languages, and obtain structured metadata including image dimensions, confidence scores, and pixel coordinates for all detected elements.

Getting started with our Google Lens Python API is easy — simply create a free Apify account, get your API token, and start using the Google Lens API in Python, JavaScript, CLI, cURL, OpenAPI, or MCP.

Get started with Google Lens API Python client today

Get your first Google Lens data in Python in less than 5 minutes. No credit card required. No commitment. Cancel anytime.