Sand AISand AI MAGI-2MAGI-2 ya está en SandBase: video en 1080p con audio nativoPruébalo ahora

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.

Precio
Desde $0.0033USD / llamada
Método
POST
Respuesta
JSON
Parámetros
1 obligatorios · 4 opcionales

Entorno de pruebas

Entrada
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. Rango: de 1 a 20.
Order results by best match (relevant, the default) or newest first (recent).
Only return photos with this orientation. Omit for any orientation.
SalidaListo

Su salida aparecerá aquí

Complete las entradas y luego haga clic en Ejecutar.

README de la 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.

Explorar más

APIs relacionadas

Todas las APIs
APIPrecioRespuesta
UnsplashDesde $0.0033 por llamadaJSON

Preguntas

FAQ

¿Cómo uso la API de Unsplash Photo Search?

Envía una solicitud POST a https://api.sandbase.ai/v1/api/unsplash/search-photos con tu clave API de SandBase en el encabezado Authorization (Bearer) y los parámetros como un cuerpo JSON. También puedes probarlo en el Playground de esta página sin escribir código.

¿Cuánto cuesta la API de Unsplash Photo Search?

Desde $0.0033 por llamada, facturado desde tu saldo de SandBase. Solo se te cobra por las llamadas que haces; no hay suscripción.

¿Qué parámetros acepta la API de Unsplash Photo Search?

Requeridos: query (string). Opcionales: color (una de black_and_white, black, white, yellow, orange, red, purple, magenta, green, teal, blue), limit (integer), sortBy (una de relevant, recent) y orientation (una de landscape, portrait, square). La tabla de Parámetros y el Playground de esta página enumeran todos los campos.

¿Qué devuelve la API de Unsplash Photo Search?

Una respuesta JSON devuelta en la misma solicitud HTTP (sincrónica).

¿Necesito una cuenta de desarrollador o una clave API de Unsplash?

No. Unsplash Photo Search funciona a través de SandBase, así que una sola clave API de SandBase cubre este endpoint y todas las demás APIs y modelos del catálogo. No necesitas solicitar acceso a la API de Unsplash por separado.