---
title: "Search stock media (Pexels / Pixabay / Freesound / Klipy)"
method: POST
path: "/v1/resources/search"
tags: ["resources"]
---

# Search stock media (Pexels / Pixabay / Freesound / Klipy)

`POST /v1/resources/search`

## Request

- Base URL: `https://api.cueframe.ai`
- URL: `https://api.cueframe.ai/v1/resources/search`
- Auth: one of:
  - HTTP bearer
  - OAuth 2 (authorization code, authorization URL `https://api.cueframe.ai/api/auth/mcp/authorize`, token URL `https://api.cueframe.ai/api/auth/mcp/token`, scopes: `media:read`)
  - API key in header `PAYMENT-SIGNATURE`

Search licensed stock media by keyword. Pass `query` for one search, or `queries[]` (≤10) to run a batch in ONE call — the batch returns `results[]`, one entry per query in order, each with its own `candidates` (and an `error` string if that single query failed; one bad query never discards the rest). `kind` selects the corpus (video/photo default to Pexels; Pixabay is explicitly selectable; sfx → Freesound CC0-only; gif → Klipy); defaults to video. Returns ranked candidates each carrying an opaque `candidateId` — pass it to import_resource to bring the asset into a project. Free + rate-limited; results are cached for 7 days, after which a candidateId must be refreshed by searching again. For sfx, bound the result by clip length with `durationSec` — impacts/ticks ≈ 0–2s, risers/whooshes ≈ 2–8s, ambients unbounded. For video, use minWidth/minHeight to exclude smaller renditions.

## Request body

- ResourceSearchRequest: POST /resources/search body — one `query`, or a batch of `queries[]`.
  - `query` string
  - `queries` string[]
  - `kind` 'video' | 'photo' | 'sfx' | 'gif'
  - `provider` 'pexels' | 'pixabay' | 'freesound' | 'klipy'
  - `limit` integer
  - `minWidth` integer: Video-only minimum selected-rendition width in pixels; smaller results are excluded.
  - `minHeight` integer: Video-only minimum selected-rendition height in pixels; smaller results are excluded.
  - `durationSec` object: sfx-only clip-length bound in seconds → Freesound native filter.
    - `min` number
    - `max` number

## Response `200`

Ranked stock candidates.

- ResourceSearchResponse: POST /resources/search response — `candidates` for one query, `results[]` for a batch.
  - `provider` 'pexels' | 'pixabay' | 'freesound' | 'klipy'
  - `kind` 'video' | 'photo' | 'sfx' | 'gif'
  - `candidates` ResourceCandidate[]
    - `candidateId` string, required
    - `provider` 'pexels' | 'pixabay' | 'freesound' | 'klipy', required
    - `kind` 'video' | 'photo' | 'sfx' | 'gif', required
    - `thumbnail` string, required
    - `previewUrl` string, required
    - `downloadUrl` string
    - `duration` number
    - `width` number
    - `height` number
    - `author` string, required
    - `authorUrl` string
    - `assetUrl` string
    - `license` string
  - `results` ResourceSearchResult[]
    - `query` string, required
    - `provider` 'pexels' | 'pixabay' | 'freesound' | 'klipy'
    - `kind` 'video' | 'photo' | 'sfx' | 'gif'
    - `candidates` ResourceCandidate[], required
      - `candidateId` string, required
      - `provider` 'pexels' | 'pixabay' | 'freesound' | 'klipy', required
      - `kind` 'video' | 'photo' | 'sfx' | 'gif', required
      - `thumbnail` string, required
      - `previewUrl` string, required
      - `downloadUrl` string
      - `duration` number
      - `width` number
      - `height` number
      - `author` string, required
      - `authorUrl` string
      - `assetUrl` string
      - `license` string
    - `error` string

## Other responses

- `400`: Bad request — validation_error / invalid_cursor / invalid_query.
- `401`: Missing or invalid Authorization header.
- `402`: Payment required. Returned when the caller presents no API key on a priced operation: the body AND the `Payment-Required` header carry the x402 v2 challenge (accepted scheme, network, USDC asset, amount, payTo). Sign the EIP-3009 authorization and retry with a `PAYMENT-SIGNATURE` header. A KEYED caller sees this status instead when their plan lacks or has exhausted the feature (`billing_required`).
- `403`: Forbidden — permission insufficient.
- `429`: Rate limited. Retry-After header present.
- `500`: Internal error.
- `503`: Service unavailable — billing_unavailable / honest-503 for runtime deps.

---

[API](https://skmtc.dev/cueframe/apis/cueframe-api.md) · [All operations](https://skmtc.dev/cueframe/apis/cueframe-api/llms.txt) · [OpenAPI document](https://skmtc.dev/cueframe/apis/cueframe-api/revisions/8f9bfe362b4a?raw)
