Zyte Screenshots Skill
Capture full-page screenshots of any public URL via the Zyte API using curl, save as a PNG file, and briefly describe the visual content.
Prerequisites
curlinstalled (standard on macOS/Linux)jqinstalledbase64CLI availableZYTE_API_KEYset in the environment
Workflow
Step 1 — Validate inputs
- Confirm the user has provided a valid URL (must start with
http://orhttps://). - Check for
ZYTE_API_KEYin the environment:
If empty or unset, stop and tell the user to export it before continuing:echo $ZYTE_API_KEYexport ZYTE_API_KEY="your_api_key_here"
Step 2 — Derive the output filename
The filename must be the website name with https:// and .com removed. Strip exactly as follows:
- Remove
https://orhttp:// - Remove
www.prefix if present - Remove
.com(and anything after it) - Replace any remaining dots or slashes with underscores
Examples:
| URL | Filename |
|---|---|
https://www.example.com |
example.png |
https://quotes.toscrape.com |
quotes.toscrape.png |
https://news.ycombinator.com |
news.ycombinator.png |
Step 3 — Run the curl command
Run this exact command, substituting $ZYTE_API_KEY, the target URL, and the derived filename:
curl -s https://api.zyte.com/v1/extract \
-u "$ZYTE_API_KEY": \
-H "Content-Type: application/json" \
-d '{
"url": "URL",
"screenshot": true
}' \
| jq -r '.screenshot' \
| base64 --decode > FILENAME.png
After running, verify the file was created and is non-empty:
[ -s "FILENAME.png" ] && echo "Success" || echo "Failed"
Common errors:
| Error | Cause | Fix |
|---|---|---|
401 Unauthorized |
Wrong or missing API key | Check ZYTE_API_KEY value |
jq outputs null |
API returned an error | Print raw response to debug |
| Empty file | base64 received no input | Check API response |
To debug, first print the raw API response:
curl -s https://api.zyte.com/v1/extract \
-u "$ZYTE_API_KEY": \
-H "Content-Type: application/json" \
-d '{"url": "URL", "screenshot": true}'
Step 4 — View and describe the screenshot
After a successful download:
- Use the
viewtool to open and inspect the PNG file. - Tell the user the exact file path so they can open it:
📁 Screenshot saved to: /home/claude/FILENAME.png - Write a single sentence describing what is visible in the screenshot (e.g. layout, brand, main content area).
Response format
✅ Screenshot captured!
📁 Location: /path/to/FILENAME.png
🖼️ What's in it: [One-sentence visual description]