# Image Search

> Search the web for images (photos, logos, graphics) and download them with Typst embedding code. Use when the user needs real-world images, company logos, or existing graphics for documents.

- Skill: `clearsmog/image-search` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add clearsmog/image-search`
- Raw SKILL.md: https://api.skillmd.com/api/skills/clearsmog/image-search/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- Author: clearsmog (https://skillmd.com/u/clearsmog)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/clearsmog/image-search

---


Parse `$ARGUMENTS` into flags for the bundled script and run it in **one** Bash call. The script handles search, download, filename generation, and Typst code output.

Flags: `query` (positional), `--logo`, `--stock`, `--url <url>`, `-d` dir, `-o` output, `-n` count, `--size`, `--type`, `--width`, `--caption "..."`

Pass `--typst` when generating images for Typst documents (the typical case). If `--output`/`-o` is not given, omit it (script auto-generates from query + dir).

Run exactly one command:

```bash
SERPAPI_KEY="$SERPAPI_KEY" uv run --script {baseDir}/scripts/image_search.py "<query>" --typst [other flags...]
```

If SERPAPI_KEY is empty in this shell, read it directly from fish universal variables (avoids shell greeting pollution): `` `printf '%b' "$(sed -n 's/.*SERPAPI_KEY://p' ~/.config/fish/fish_variables)"` ``.

For `--stock` mode, also forward Unsplash/Pexels keys if available:
```bash
SERPAPI_KEY="$SERPAPI_KEY" UNSPLASH_ACCESS_KEY="$UNSPLASH_ACCESS_KEY" PEXELS_API_KEY="$PEXELS_API_KEY" uv run --script {baseDir}/scripts/image_search.py "<query>" --stock --typst [other flags...]
```

Print the script's stdout to the user. Done.

## Modes

| Mode | Flag | Behavior |
|------|------|----------|
| Image search (default) | none | SerpAPI -> DuckDuckGo fallback -> download best match |
| Logo lookup | `--logo` | Logo.dev -> image search fallback |
| Stock photos | `--stock` | Unsplash -> Pexels -> image search fallback (license-clear) |
| Direct URL | `--url <url>` | Download image directly from URL |

## Environment

Zero API keys required — works via DuckDuckGo by default. Each key unlocks a better tier:

| Key | Purpose |
|-----|---------|
| `SERPAPI_KEY` | Google Images (best quality) |
| `UNSPLASH_ACCESS_KEY` | Stock photos via Unsplash |
| `PEXELS_API_KEY` | Stock photos via Pexels |

