querystringwajib
Keyword or phrase to search Unsplash photos for, e.g. "coffee" or "minimal workspace".
https://api.sandbase.ai/v1/api/unsplash/search-photosSearch Unsplash for free stock photos by keyword. Returns image URLs in several sizes, dimensions, alt text, the photographer's name and profile, and the photo's Unsplash page.
Output Anda akan muncul di sini
Lengkapi input, lalu klik Run.
Search Unsplash for free stock photos by keyword. Returns image URLs in several sizes, dimensions, alt text, the photographer's name and profile, and the photo's Unsplash page.
curl -X POST "https://api.sandbase.ai/v1/run" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "unsplash/search-photos", "limit": 2, "query": "coffee"}'
The result is returned in outputs[0].data. Lookups that find nothing fail with a not-found error.
| Name | Type | Required | Description |
|---|---|---|---|
query | string | Yes | Keyword or phrase to search Unsplash photos for, e.g. "coffee" or "minimal workspace". |
color | string | No | Only return photos with this dominant color tone. Omit for any color. One of: black_and_white, black, white, yellow, orange, red, purple, magenta, green, teal, blue. |
limit | integer | No | Maximum number of photos to return (1-20, default 20). You are billed per photo returned, so a lower limit costs less. |
orientation | string | No | Only return photos with this orientation. Omit for any orientation. One of: landscape, portrait, square. |
sortBy | string | No | Order results by best match (relevant, the default) or newest first (recent). One of: relevant, recent. |
Billed at the actual cost of each call: about $0.00165 per result returned, up to $0.0336 per request (about $0.0033 for the request above). A call can cost more when the first data source fails and another one answers. Failed calls and lookups that find nothing are not charged.
Mulai membangun
Endpoint API platform dengan autentikasi dan pelacakan penggunaan terpadu.
curl -X POST "https://api.sandbase.ai/v1/api/unsplash/search-photos" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"limit": 2,
"query": "coffee",
"sortBy": "relevant"
}'Atur SandBase API key Anda di environment server Anda. Permintaan menggunakan autentikasi Bearer.
export SANDBASE_API_KEY="YOUR_API_KEY"Simpan key Anda di server. Jangan tampilkan di kode browser.
querystringwajibKeyword or phrase to search Unsplash photos for, e.g. "coffee" or "minimal workspace".
colorstringOnly return photos with this dominant color tone. Omit for any color.
Nilai yang mungkin: black_and_white, black, white, yellow, orange, red, purple, magenta, green, teal, blue
limitintegerMaximum number of photos to return (1-20, default 20). You are billed per photo returned, so a lower limit costs less.
sortBystringOrder results by best match (relevant, the default) or newest first (recent).
Default: "relevant"
Nilai yang mungkin: relevant, recent
orientationstringOnly return photos with this orientation. Omit for any orientation.
Nilai yang mungkin: landscape, portrait, square
Contoh respons yang disimpan untuk API ini; tidak ada permintaan langsung yang dibuat saat melihatnya.
Belum ada respons tersimpan yang dipublikasikan. Jalankan API di Playground untuk melihat responsnya.
Jelajahi lebih lanjut
| API | Harga | Respons |
|---|---|---|
Unsplash Photo SearchAPI ini Unsplash | Dari $0.0033 per panggilan | JSON |
Pertanyaan
Kirim permintaan POST ke https://api.sandbase.ai/v1/api/unsplash/search-photos dengan kunci API SandBase Anda di header Authorization (Bearer) dan parameter sebagai body JSON. Anda juga dapat mencobanya di Playground di halaman ini tanpa menulis kode.
Mulai dari $0.0033 per panggilan, ditagihkan dari saldo SandBase Anda. Anda hanya dikenai biaya untuk panggilan yang Anda lakukan; tidak ada langganan.
Wajib: query (string). Opsional: color (salah satu dari black_and_white, black, white, yellow, orange, red, purple, magenta, green, teal, blue), limit (integer), sortBy (salah satu dari relevant, recent) dan orientation (salah satu dari landscape, portrait, square). Tabel Parameters dan Playground di halaman ini mencantumkan setiap field.
Respons JSON yang dikembalikan dalam permintaan HTTP yang sama (sinkron).
Tidak. Unsplash Photo Search berjalan melalui SandBase, jadi satu kunci API SandBase mencakup endpoint ini dan setiap API serta model lain di katalog. Anda tidak perlu mendaftar akses API Unsplash secara terpisah.