Pexels
免费图库照片和视频
- 认证方式
- API Key
- HTTPS
- Yes
- CORS
- Yes
- 分类
- 摄影
- 文档 / URL
- https://www.pexels.com/api/
简介
Pexels API 提供对 Pexels 免费图库照片和视频库的搜索与精选访问。照片在 Pexels License 下免费使用(允许商用、无需署名)。API 支持 CORS,是照片应用、博客头图和背景选择器的热门选择。
2026-08 实测:不带任何密钥的搜索调用也返回了真实照片数据——端点容忍匿名轻量测试。正式使用请注册密钥获取自己的配额。
快速开始
搜索照片(Authorization 头是标准认证方式):
curl "https://api.pexels.com/v1/search?query=mountain&per_page=5" \
-H "Authorization: YOUR_API_KEY"
精选照片:
curl "https://api.pexels.com/v1/curated?per_page=10" \
-H "Authorization: YOUR_API_KEY"
按 ID 获取照片:
curl "https://api.pexels.com/v1/photos/32557420" \
-H "Authorization: YOUR_API_KEY"
视频搜索:
curl "https://api.pexels.com/videos/search?query=ocean" \
-H "Authorization: YOUR_API_KEY"
照片数据包含
src 对象带可调整大小的 URL(original、large2x、large、medium、small、portrait、landscape、tiny),以及 photographer、url、alt、width/height。
认证方式
- 在 pexels.com/api 注册获取免费 API 密钥。
- 通过
Authorization请求头发送(裸 key,无 “Bearer” 前缀)。 - 匿名调用可能对轻量测试可用,但共享极小配额——请使用自己的密钥。
速率限制与注意事项
- 免费层:200 次请求/小时(带密钥);更多需要付费档。
- 所有照片可免费商用——Pexels License 无需署名。
- 直接使用
srcURL(热链)——API 就是为此设计的。 - 分页用
page/per_page(最大 80)。
常见问题
Pexels 免费吗? API 有免费层(200 次/小时);照片可免费商用。
需要密钥吗? 正式使用需要——请注册;匿名调用共享极小配额。
照片可以商用吗? 可以——Pexels License 允许商业使用且无需署名。
摄影 分类更多
| API | Auth | HTTPS | CORS | |
|---|---|---|---|---|
| Bruzu Image generation with query string | API Key | Yes | Yes | ↗ |
| CheetahO Photo optimization and resize | API Key | Yes | Unknown | ↗ |
| Dagpi Image manipulation and processing | API Key | Yes | Unknown | ↗ |
| Duply Generate, Edit, Scale and Manage Images and Videos Smarter & Faster | API Key | Yes | Yes | ↗ |
| DynaPictures Generate Hundreds of Personalized Images in Minutes | API Key | Yes | Yes | ↗ |