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 and then REST APIs in your Draftbit app and pick Unsplash from the catalog. Paste your API key or token and fill in any base URL variables, such as a project ID or host. The endpoints are then available across your screens and to the AI agents while you build.
Does Unsplash require authentication?
Most Unsplash endpoints expect a key or token sent as a header. The preconfigured endpoints include List photos, Search photos, Get photo, Random photo.
What can I build with Unsplash and Draftbit?
Most teams use Unsplash as a media platform for a mobile or web app. You might use Unsplash to search and embed stock photography in app content, or to generate optimized image variants for each device.