REST API integration
Unsplash REST API integration for Draftbit
Search and retrieve Unsplash photos
What is Unsplash?
Unsplash's JSON API lets apps search photos, retrieve random images, and load photo details. Use your Unsplash access key and follow Unsplash attribution and download tracking guidelines.
Use Unsplash with Draftbit
- Built-in endpoints: List photos, Search photos, Get photo, Random photo.
- Bind any Unsplash endpoint to a screen, list, form, or AI agent action.
- Authentication is configured once per app — secrets stay on the server.
- Add custom request and response transforms without forking Unsplash's client library.
Example
unsplash-example.ts // Example: fetch from Unsplash
const response = await fetch("https://api.unsplash.com/photos", {
headers: {
"Authorization": "Client-ID YOUR_UNSPLASH_TOKEN",
},
});
const data = await response.json();Use cases
- Search and embed stock photography in app content
- Generate optimized image variants for each device
- Lazy-load high-resolution media without slowing the UI
Authentication
Authentication uses the `Authorization` header. Paste your key once in Draftbit and every request to Unsplash carries it automatically — secrets stay on the server side.
Use Unsplash in a Draftbit app today
Start free, connect Unsplash in minutes, and ship with AI agents that know how to use it.
Frequently asked questions
What is the Unsplash REST integration?
Unsplash's JSON API lets apps search photos, retrieve random images, and load photo details. Use your Unsplash access key and follow Unsplash attribution and download tracking guidelines.
How do I connect Unsplash to a Draftbit app?
Go to Integrations → REST APIs in your Draftbit app and pick Unsplash from the catalog. Paste your API key or token, set any base-URL variables (project IDs, hosts), and the endpoints become available across your screens.
Does Unsplash require authentication?
Most Unsplash endpoints expect a key or token sent as a header. Built-in endpoints include: List photos, Search photos, Get photo, Random photo.
What can I build with Unsplash and Draftbit?
Use Unsplash as a media platform for your mobile or web app: Search and embed stock photography in app content; Generate optimized image variants for each device.