当前位置: 首页 > Skill >

Image Search

Image Search

Image Search

使用 SerpAPI 通过 Google Lens 进行视觉图像搜索。可从图像中识别物体、地标、产品、植物、动物、艺术作品、标志或任何视觉实体。

1.0.0 2026.11.11 866
获取Skill文件查看使用说明
作 者:江禾 许可证: 更新时间:2026.11.11
本文目录展开

Image Search (Google Lens)

Identify anything from an image using Google Lens via SerpAPI.

Setup

Requires SERPAPI_KEY environment variable. Get a key at https://serpapi.com/ (100 free searches/month).

No pip dependencies needed — uses only Python stdlib (urllib, json, base64).

Usage

From CLI / Agent (exec tool)

# Search by image URL
python3 {baseDir}/scripts/lens_search.py "https://example.com/photo.jpg"

# Search by local file (auto-uploads to get a URL)
python3 {baseDir}/scripts/lens_search.py /path/to/image.png

# Refine with text query (e.g., find red version of a product)
python3 {baseDir}/scripts/lens_search.py "https://example.com/bag.jpg" --query "red"

# Product search (returns prices)
python3 {baseDir}/scripts/lens_search.py "https://example.com/sneakers.jpg" --type products

# Find exact matches (where this image appears online)
python3 {baseDir}/scripts/lens_search.py "https://example.com/photo.jpg" --type exact_matches

# Raw JSON output for programmatic use
python3 {baseDir}/scripts/lens_search.py "https://example.com/photo.jpg" --json

# Localized results (e.g., Japanese products with ¥ prices)
python3 {baseDir}/scripts/lens_search.py "https://example.com/laptop.jpg" --type products --country jp

Search Types

Type Use Case Returns
all (default) General identification Entity name + visual matches + text
visual_matches Find similar images Visually similar results with sources
exact_matches Find image origin Pages containing this exact image
products Shopping / price lookup Products with prices and buy links
about_this_image Image provenance Metadata about the image's origin

Output Format

The script outputs structured markdown:

## Identified Entity
- **Danny DeVito** — [link](https://...)

## Visual Matches (top 5)
- **Danny DeVito — Wikipedia** (Wikipedia) ✅ exact match
  https://en.wikipedia.org/wiki/Danny_DeVito
- ...

Use --json for raw SerpAPI response when you need thumbnails, image dimensions, or other metadata.

Agent Decision Guide

When a user sends an image:

  1. Already identified by vision model? If the main model confidently recognizes the entity, skip reverse search.
  2. Uncertain identification? Run lens_search.py to verify. Compare model's guess with Lens results.
  3. Need details beyond identification? First identify with Lens, then web_search for deeper info.
  4. Shopping intent? Use --type products to get prices and buy links directly.
  5. Local file from user? The script handles local files by auto-uploading to get a searchable URL.

Combining with Other Tools

Typical multi-tool workflow:

1. User sends image → "What building is this?"
2. reverse_image_search → identifies "Cologne Cathedral"
3. web_search("Cologne Cathedral history architecture") → detailed info
4. Compose answer combining visual match + web knowledge

Limitations

  • SerpAPI free tier: 100 searches/month. Paid plans from $50/month.
  • Local file upload uses freeimage.host (free) or imgbb (needs IMGBB_API_KEY).
  • Google Lens results vary by region; use --country for localized results.
  • Some niche/long-tail entities may not return useful visual matches.

推荐文章

更多
PHP时间戳与日期字符串相互转换方法详解

本文介绍PHP中时间数值(Unix时间戳)与日期字符串之间的相互转换方法。通过strtotime和date函数,实现将当前时间、指定日期转换为时间戳,以及将时间戳格式化为可读的日期时间字符串,并提供相关在线计算工具推荐。

2025.11.30 1,037
PHP日期转时间戳时区偏差怎么解决

在 PHP 中将日期字符串转换为时间戳时,若未显式指定时区,默认使用脚本配置的 date.timezone 或系统时区。当服务器时区与业务逻辑预期(如 UTC )不一致时,会产生偏差。解决核心是确保输入字符串携带明确时区信息,或在转换前统一设置时区上下文。

2026.10.24 1,031
JavaScript中利用replace结合正则实现replaceAll效果

JavaScript原生仅支持replace()进行单次或全局替换,缺乏类似Java的replaceAll()便捷方法。本文总结四种在JS中实现全量替换的方案:使用带g标志的正则、带gm标志的正则、扩展String原型以及split后join。通过对比代码示例,展示各方法的实现细节与适用场景,帮助开发者根据需求选择最优解。

2025.04.29 1,020
PHP跨域配置:怎么安全地允许指定域名而非使用通配符

在 PHP 中安全地允许指定域名跨域,核心是解析请求头中的 Origin ,验证其是否在白名单内,然后动态设置 Access-Control-Allow-Origin 响应头。不要使用通配符 * ,也不要硬编码单一域名。

2025.03.29 1,019
PHP实现基础文件上传:HTML表单与$_FILES处理流程

在 HTML 表单中设置 enctype="multipart/form-data" ,并在 PHP 后端通过 $_FILES 数组接收文件,调用 move_uploaded_file() 将临时文件移动到目标目录即可完成上传。

2026.09.07 1,016
OpenAI的Jalapeno芯片未落地,教你分辨300兆瓦算力消息

OpenAI计划在SB Energy租赁的数据中心部署约300兆瓦自研Jalapeno推理芯片,但目前双方仍处于洽谈阶段,交易细节与上线时间表均未公布。本文带你按报道原文核实项目所处阶段,厘清芯片发布、电力功率与实际推理算力的边界,并将融资意向与签约、开工、投运节点分开追踪,避免误将规划容量计入现有算力。

2026.12.02 1,015
Skill 文件
  • SKILL.md
    • Image Search (Google Lens)
    • Setup
    • Usage
      • From CLI / Agent (exec tool)
    • Search Types
    • Output Format
    • Agent Decision Guide
    • Combining with Other Tools
    • Limitations
  • 项目或源文件

相关 Skill

更多
Alibabacloud Pds Multimodal Search Alibabacloud Pds Multimodal Search 实现精确文件名搜索、模糊文件名搜索、语义文件搜索以及基于图像的图像搜索。触发词:“PDS drive file search”、“PDS image search”。
Eureka-专利图像搜索 Eureka-专利图像搜索 在Eureka专利平台进行专利图像检索(以图搜图),上传图片URL即可查找外观设计或实用新型的相似专利。用户提及专利图像检索、以图搜专利、外观设计搜索、图片相似专利、设计专利检索、图像搜索专利、专利视觉搜索、patent image search、search patent by image、design patent search等需求时,提供此功能。
1688-以图搜图 1688-以图搜图 1688平台以图搜图,通过商品图片精准检索相似或同款货源,返回标题、价格、起批量、月销量、复购率、交易评分等核心数据,适用于以图找货源、以图找同款、跨境找工厂、image search 1688等场景。
智慧芽-外观专利以图搜图 智慧芽-外观专利以图搜图 基于智慧芽的专利图片相似度搜索,支持通过图片URL检索外观设计专利,适用于专利图片搜索、外观设计专利侵权检查、以图搜专利、专利相似度检测、洛迦诺分类搜索、检查产品设计是否侵权、patent image search、design patent search等场景。
firecrawl 搜索(无需apikey版本) firecrawl 搜索(无需apikey版本) Search the web and scrape pages using Firecrawl v2 API in keyless mode (no API key required). Use when the user asks to search the web, look up information, research topics, find current news, scrape a URL, or extract web page content. Supports web/news/image search with optional page scraping, and single-page scraping to clean markdown. Triggers: search, look up, find, research, web search, scrape, crawl, firecrawl, extract, read page.