Image Search

👤 tobiaslee 📦 v1.0.0 ⭐ 4.5 ⬇️ 1.3K 下载
🎨 设计多媒体 免费 🔑 需 API Key

📖 技能介绍

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.

    小葱技能7w4.net有更新,你可以访问看下。

  • 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.

🤖 AI 评测

这个 Skill 质量不错,功能实用。它能通过图片识别物体、查找相似图、找商品价格等,用途很广。文档写得很清楚,使用起来简单,不需要额外安装依赖。它还有个贴心功能,就是能把本地图片自动上传到网上再搜索。不过它依赖第三方 SerpAPI,有每月100次的免费限额,图片上传服务也用的是免费平台,稳定性可能有限。总体来说是个好用的工具,适合需要处理图片识别相关任务的场景。

📊 多维度评分

适应性4.5
规范性4.5
有效性4.5
可靠性4.5
可信度4.3

📁 包含文件 (5 个)

📄 README.md 3.6 KB
📄 SKILL.md 4 KB
📄 _meta.json 131 B
📄 scripts/lens_search.py 9.2 KB
📄 skill-card.md 2.2 KB