Integrates the Unsplash, Pexels, and Pixabay APIs in code - auth, search endpoints, rate limits, attribution, hotlinking versus caching rules, and the compliance obligations that get apps deactivated when skipped. Use when someone says "integrate the Unsplash API", "pull images from Pexels in my app", "build an image picker on a stock photo API", "how do I trigger the Unsplash download endpoint", or is wiring stock imagery into a CMS, blog pipeline, or placeholder service. Do NOT use to choose a source by hand or write a search brief - use stock-photo-finder instead; do NOT use to decide whether a license permits a use or a release is needed - use image-license-rights instead; do NOT use to art-direct results - use visual-asset-curation instead.
---
name: Stock Photo APIs
description: Integrates the Unsplash, Pexels, and Pixabay APIs in code - auth, search endpoints, rate limits, attribution, hotlinking versus caching rules, and the compliance obligations that get apps deactivated when skipped. Use when someone says "integrate the Unsplash API", "pull images from Pexels in my app", "build an image picker on a stock photo API", "how do I trigger the Unsplash download endpoint", or is wiring stock imagery into a CMS, blog pipeline, or placeholder service. Do NOT use to choose a source by hand or write a search brief - use stock-photo-finder instead; do NOT use to decide whether a license permits a use or a release is needed - use image-license-rights instead; do NOT use to art-direct results - use visual-asset-curation instead.
---
# Stock Photo APIs
Wire stock imagery into a product through the three main free APIs - Unsplash, Pexels, Pixabay - without tripping the compliance rules that get API keys revoked. The fetch is trivial; the contractual obligations (Unsplash's download-endpoint trigger, Pixabay's mandatory caching, attribution everywhere) are the actual work, and skipping them is the #1 reason apps get deactivated.
## Operating procedure
### Step 1: Gather inputs
- Is the need dynamic, repeated, or in-product? For a one-off hero image, download it by hand - an API key is overkill.
- Which provider(s), or should the integration abstract over all three? (Choosing a source for a specific image is stock-photo-finder's job.)
- Expected request volume, to check against the rate-limit table.
- Where images will render (client hotlink vs server cache) - this decides between Unsplash's hotlink rule and Pixabay's cache rule.
- Whether anything commercial ships - a human owns that license call via image-license-rights.
### Step 2: Pick against the provider quick reference
| Provider | Auth | Search endpoint | Default rate limit | The gotcha most people miss |
|---|---|---|---|---|
| Unsplash | Authorization: Client-ID ACCESS_KEY | GET /search/photos | Demo 50 req/hr; Production 5000 req/hr after app review | MUST trigger the per-photo download endpoint on use, attribute photographer + Unsplash with UTM links, and hotlink the returned urls (do not rehost) |
| Pexels | Authorization: API_KEY | GET /v1/search | 200 req/hr, 20,000 req/mo default | Show Pexels + photographer attribution; do not build a Pexels clone; respect the X-Ratelimit-* response headers |
| Pixabay | ?key=API_KEY query param | GET /api/ | ~100 req/min | Must cache/download images to your own server per their terms rather than permanently hotlinking; cache API responses ~24h |