npx skills add https://github.com/cevatkerim/skills --skill unsplash搜索并获取来自 Unsplash 的高质量照片,并自动添加归属信息。
# 搜索照片
./scripts/search.sh "sunset beach"
# 获取随机照片
./scripts/random.sh "nature" 3
# 追踪下载(当用户下载时)
./scripts/track.sh PHOTO_ID
重要提示: 如果脚本返回 UNSPLASH_ACCESS_KEY not set,请按以下交互方式处理:
询问用户:"我需要一个 Unsplash API 密钥来搜索照片。您可以在 https://unsplash.com/developers 获取一个免费密钥 - 您有吗?"
等待用户提供他们的密钥
将密钥保存到项目根目录的 .env 文件中:
echo "UNSPLASH_ACCESS_KEY=<user_provided_key>" >> .env
重新运行原始的搜索/随机命令
该技能每次运行时都会自动从项目根目录加载 .env 文件。
通过关键词查找照片,并可选择过滤器。
Search and fetch high-quality photos from Unsplash with automatic attribution.
# Search for photos
./scripts/search.sh "sunset beach"
# Get random photos
./scripts/random.sh "nature" 3
# Track download (when user downloads)
./scripts/track.sh PHOTO_ID
IMPORTANT: If the script returns UNSPLASH_ACCESS_KEY not set, handle it interactively:
Ask the user: "I need an Unsplash API key to search for photos. You can get a free key at https://unsplash.com/developers - do you have one?"
Wait for the user to provide their key
Save the key to .env in the project root:
echo "UNSPLASH_ACCESS_KEY=<user_provided_key>" >> .env
Re-run the original search/random command
The skill automatically loads from the project root on each run.
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
./scripts/search.sh QUERY [PAGE] [PER_PAGE] [ORDER_BY] [ORIENTATION] [COLOR]
参数:
QUERY(必需):搜索关键词PAGE(可选,默认:1):分页的页码PER_PAGE(可选,默认:10):每页结果数(1-30)ORDER_BY(可选,默认:"relevant"):排序方式("relevant" 或 "latest")ORIENTATION(可选):按方向过滤("landscape"、"portrait"、"squarish")COLOR(可选):按颜色过滤("black_and_white"、"black"、"white"、"yellow"、"orange"、"red"、"purple"、"magenta"、"green"、"teal"、"blue")示例:
# 基本搜索
./scripts/search.sh "mountain landscape"
# 带过滤器的搜索
./scripts/search.sh "sunset" 1 5 latest landscape
# 按颜色搜索
./scripts/search.sh "flower" 1 10 relevant portrait red
获取随机照片,可选择过滤。
./scripts/random.sh [QUERY] [COUNT] [ORIENTATION]
参数:
QUERY(可选):用于过滤随机照片的主题/关键词COUNT(可选,默认:1):照片数量(1-30)ORIENTATION(可选):按方向过滤("landscape"、"portrait"、"squarish")示例:
# 单张随机照片
./scripts/random.sh
# 按主题的随机照片
./scripts/random.sh "architecture" 5
# 随机风景照片
./scripts/random.sh "nature" 3 landscape
追踪用户何时下载照片(Unsplash API 指南要求)。
./scripts/track.sh PHOTO_ID
调用时机:
示例:
./scripts/track.sh "abc123xyz"
所有操作都返回包含完整照片信息的 JSON:
{
"id": "abc123xyz",
"description": "A beautiful sunset over mountains",
"alt_description": "orange sunset behind mountain range",
"urls": {
"raw": "https://...",
"full": "https://...",
"regular": "https://...",
"small": "https://...",
"thumb": "https://..."
},
"width": 6000,
"height": 4000,
"color": "#f3a460",
"blur_hash": "L8H2#8-;00~q4n",
"photographer_name": "Jane Smith",
"photographer_username": "janesmith",
"photographer_url": "https://unsplash.com/@janesmith?utm_source=claude_skill&utm_medium=referral",
"photo_url": "https://unsplash.com/photos/abc123xyz?utm_source=claude_skill&utm_medium=referral",
"attribution_text": "Photo by Jane Smith on Unsplash",
"attribution_html": "Photo by <a href=\"https://unsplash.com/@janesmith?utm_source=claude_skill&utm_medium=referral\">Jane Smith</a> on <a href=\"https://unsplash.com/?utm_source=claude_skill&utm_medium=referral\">Unsplash</a>"
}
urls 对象包含不同尺寸:
推荐: 对于大多数网页内容,使用 urls.regular(最佳质量/大小平衡)。
关键: Unsplash 要求所有图像使用都必须注明归属。
向用户展示照片时,您必须包含以下之一:
attribution_text(用于纯文本环境):
Photo by Jane Smith on Unsplash
attribution_html(用于 HTML/网页环境):
Photo by <a href="...">Jane Smith</a> on <a href="...">Unsplash</a>
# 搜索相关图像
./scripts/search.sh "technology workspace" 1 3 latest landscape
# 向用户展示带归属信息的选项
# 用户选择一个
# 在博客文章中显示图像及 attribution_html
# 获取各种图像
./scripts/random.sh "travel" 10
# 显示所有图像及其归属信息
# 搜索匹配品牌颜色的图像
./scripts/search.sh "abstract" 1 5 latest "" blue
缺少 API 密钥:
ERROR: UNSPLASH_ACCESS_KEY not set
→ 请参阅上面的“设置(交互式)”部分。向用户询问密钥,保存到 .env,然后重试。
超出速率限制:
ERROR: Rate limit exceeded (50/hour in demo mode)
等待一小时,或使用具有更高限制的生产环境凭证。
无效的 API 密钥:
ERROR: Invalid API key
检查您的 API 密钥是否正确。
无结果:
[]
如果没有照片匹配搜索条件,则返回空数组。
所需工具(macOS/Linux 上标准安装):
bash - Shell 解释器curl - HTTP 客户端jq - JSON 处理器如果缺少 jq,请安装:
# macOS
brew install jq
# Ubuntu/Debian
sudo apt-get install jq
生产模式需要:
请参阅详细的使用模式:examples/usage-examples.md
脚本不可执行:
chmod +x scripts/*.sh
找不到 jq:
brew install jq # macOS
API 错误:
每周安装次数
157
代码仓库
首次出现
2026年1月25日
安全审计
安装于
codex148
opencode147
gemini-cli146
github-copilot141
kimi-cli139
cursor138
.envFind photos by keyword with optional filters.
./scripts/search.sh QUERY [PAGE] [PER_PAGE] [ORDER_BY] [ORIENTATION] [COLOR]
Parameters:
QUERY (required): Search keyword(s)PAGE (optional, default: 1): Page number for paginationPER_PAGE (optional, default: 10): Results per page (1-30)ORDER_BY (optional, default: "relevant"): Sort order ("relevant" or "latest")ORIENTATION (optional): Filter by orientation ("landscape", "portrait", "squarish")COLOR (optional): Filter by color ("black_and_white", "black", "white", "yellow", "orange", "red", "purple", "magenta", "green", "teal", "blue")Examples:
# Basic search
./scripts/search.sh "mountain landscape"
# Search with filters
./scripts/search.sh "sunset" 1 5 latest landscape
# Search by color
./scripts/search.sh "flower" 1 10 relevant portrait red
Get random photos with optional filtering.
./scripts/random.sh [QUERY] [COUNT] [ORIENTATION]
Parameters:
QUERY (optional): Topic/keyword to filter random photosCOUNT (optional, default: 1): Number of photos (1-30)ORIENTATION (optional): Filter by orientation ("landscape", "portrait", "squarish")Examples:
# Single random photo
./scripts/random.sh
# Random photos by topic
./scripts/random.sh "architecture" 5
# Random landscape photos
./scripts/random.sh "nature" 3 landscape
Track when a user downloads a photo (required by Unsplash API guidelines).
./scripts/track.sh PHOTO_ID
When to call:
Example:
./scripts/track.sh "abc123xyz"
All operations return JSON with complete photo information:
{
"id": "abc123xyz",
"description": "A beautiful sunset over mountains",
"alt_description": "orange sunset behind mountain range",
"urls": {
"raw": "https://...",
"full": "https://...",
"regular": "https://...",
"small": "https://...",
"thumb": "https://..."
},
"width": 6000,
"height": 4000,
"color": "#f3a460",
"blur_hash": "L8H2#8-;00~q4n",
"photographer_name": "Jane Smith",
"photographer_username": "janesmith",
"photographer_url": "https://unsplash.com/@janesmith?utm_source=claude_skill&utm_medium=referral",
"photo_url": "https://unsplash.com/photos/abc123xyz?utm_source=claude_skill&utm_medium=referral",
"attribution_text": "Photo by Jane Smith on Unsplash",
"attribution_html": "Photo by <a href=\"https://unsplash.com/@janesmith?utm_source=claude_skill&utm_medium=referral\">Jane Smith</a> on <a href=\"https://unsplash.com/?utm_source=claude_skill&utm_medium=referral\">Unsplash</a>"
}
The urls object contains different sizes:
Recommended: Use urls.regular for most web content (best quality/size balance).
CRITICAL: Unsplash requires attribution for all image usage.
When presenting photos to users, you MUST include one of:
attribution_text (for plain text contexts):
Photo by Jane Smith on Unsplash
attribution_html (for HTML/web contexts):
Photo by <a href="...">Jane Smith</a> on <a href="...">Unsplash</a>
# Search for relevant image
./scripts/search.sh "technology workspace" 1 3 latest landscape
# Present options to user with attribution
# User selects one
# Display image with attribution_html in blog post
# Get variety of images
./scripts/random.sh "travel" 10
# Display all images with their attributions
# Search for images matching brand colors
./scripts/search.sh "abstract" 1 5 latest "" blue
Missing API Key:
ERROR: UNSPLASH_ACCESS_KEY not set
→ See "Setup (Interactive)" section above. Ask user for key, save to .env, and retry.
Rate Limit Exceeded:
ERROR: Rate limit exceeded (50/hour in demo mode)
Wait an hour or use production credentials with higher limits.
Invalid API Key:
ERROR: Invalid API key
Check that your API key is correct.
No Results:
[]
Empty array returned if no photos match search criteria.
Required tools (standard on macOS/Linux):
bash - Shell interpretercurl - HTTP clientjq - JSON processorInstall jq if missing:
# macOS
brew install jq
# Ubuntu/Debian
sudo apt-get install jq
Production mode requires:
See detailed usage patterns in: examples/usage-examples.md
Scripts not executable:
chmod +x scripts/*.sh
jq not found:
brew install jq # macOS
API errors:
Weekly Installs
157
Repository
First Seen
Jan 25, 2026
Security Audits
Installed on
codex148
opencode147
gemini-cli146
github-copilot141
kimi-cli139
cursor138
lark-cli 共享规则:飞书资源操作指南与权限配置详解
32,800 周安装
Firecrawl CLI 网站爬取工具 - 批量提取网页内容,支持深度限制和路径过滤
13,300 周安装
通用发布工作流技能 - 支持多语言更新日志,自动检测项目配置
12,900 周安装
Firecrawl Search:支持内容抓取的网络搜索工具,JSON格式返回结果
13,400 周安装
Python测试模式指南:pytest、fixtures、模拟与TDD实战教程
13,300 周安装
Firecrawl Scrape:智能网页抓取工具,一键提取LLM优化Markdown内容
13,700 周安装
Gemini Web API 客户端:文本与图像生成工具,支持多轮对话和逆向工程API
13,400 周安装