Sand AISand AI MAGI-2MAGI-2 jest teraz na SandBase: wideo 1080p z natywnym dźwiękiemWypróbuj teraz

Unsplash Photo Search

https://api.sandbase.ai/v1/api/unsplash/search-photos

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.

Cena
Od $0.0033USD / wywołanie
Metoda
POST
Odpowiedź
JSON
Parametry
1 wymaganych · 4 opcjonalnych

Playground

Wejście
Keyword or phrase to search Unsplash photos for, e.g. "coffee" or "minimal workspace".
Only return photos with this dominant color tone. Omit for any color.
120
Maximum number of photos to return (1-20, default 20). You are billed per photo returned, so a lower limit costs less. Zakres: od 1 do 20.
Order results by best match (relevant, the default) or newest first (recent).
Only return photos with this orientation. Omit for any orientation.
WyjścieGotowe

Twój wynik pojawi się tutaj

Uzupełnij dane wejściowe, a następnie kliknij Uruchom.

README API

Unsplash Photo Search API

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.

Request

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.

Parameters

NameTypeRequiredDescription
querystringYesKeyword or phrase to search Unsplash photos for, e.g. "coffee" or "minimal workspace".
colorstringNoOnly 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.
limitintegerNoMaximum number of photos to return (1-20, default 20). You are billed per photo returned, so a lower limit costs less.
orientationstringNoOnly return photos with this orientation. Omit for any orientation. One of: landscape, portrait, square.
sortBystringNoOrder results by best match (relevant, the default) or newest first (recent). One of: relevant, recent.

Pricing

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.

Odkryj więcej

Powiązane APIs

Wszystkie APIs
APICenaOdpowiedź
UnsplashOd $0.0033 za wywołanieJSON

Pytania

FAQ

Jak używać API Unsplash Photo Search?

Wyślij żądanie POST do https://api.sandbase.ai/v1/api/unsplash/search-photos z kluczem API SandBase w nagłówku Authorization (Bearer) oraz parametrami w treści JSON. Możesz też wypróbować je w Playground na tej stronie bez pisania kodu.

Ile kosztuje API Unsplash Photo Search?

Od $0.0033 za wywołanie, rozliczane z salda SandBase. Płacisz tylko za wykonane wywołania; nie ma subskrypcji.

Jakie parametry przyjmuje API Unsplash Photo Search?

Wymagane: query (string). Opcjonalne: color (jedna z opcji: black_and_white, black, white, yellow, orange, red, purple, magenta, green, teal, blue), limit (integer), sortBy (jedna z opcji: relevant, recent) i orientation (jedna z opcji: landscape, portrait, square). Tabela Parameters oraz Playground na tej stronie zawierają wszystkie pola.

Co zwraca API Unsplash Photo Search?

Odpowiedź JSON zwrócona w tym samym żądaniu HTTP (synchronicznie).

Czy potrzebuję konta deweloperskiego Unsplash lub klucza API?

Nie. Unsplash Photo Search działa przez SandBase, więc jeden klucz API SandBase obejmuje ten endpoint i każde inne API oraz model w katalogu. Nie musisz osobno ubiegać się o dostęp do API Unsplash.