General Material Search

Search the copyrighted material library with a single natural-language description or keywords across three modalities — video / image / audio — and get back direct download URLs for the full original assets, plus previews, specs and tags. Returns synchronously, no polling required. For finding material by keyword and downloading it directly. Video and image searches can also pull in free-to-use material from Pexels in the same call via stock_sources; those results come back in a separate pexels_results field.

Difference from Video Material Search (for Smart Editing): smart editing returns the best-matching in-clip time ranges (segments) for timeline assembly; general search returns a download link for the whole asset.

Search Endpoint

Basic Info

ItemValue
MethodPOST
Path/task/material_search
Content-Typeapplication/json
AuthAuthorization header (pass the API Key directly)
ResponseSynchronous search results (not an async task)
Billing1 credit per search (auto-refunded on failure; the response carries a task_id for task lookup. Every material a search returns is permanently granted to you — from then on, re-sign fresh download links for free and without limit via material re-sign; the Pexels supplement is not billed separately, and Pexels items are neither granted nor re-signable)

Request Body

FieldTypeRequiredDefaultDescription
scopestringYes—Material type: clip (video) / image / audio; one type per request
querystringYes—Natural-language description or keywords
top_kintegerNo20Number of results, max 50
diversitybooleanNofalseDe-duplicate near-identical material
request_idstringNo—uuid, echoed back, for idempotency / tracing
stock_sourcesarray<string>No—External stock sources; only ["pexels"] for now. With scope clip / image, Pexels is searched in the same call; its results come back in a separate pexels_results field together with pexels_status, and results is unchanged (see Pexels supplementary results); not applicable to scope=audio. Omit to skip

Request Example

curl -X POST https://api.ai-mcn.tv:10000/task/material_search \
  -H "Authorization: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "scope": "clip",
    "query": "aerial view of a city at night",
    "top_k": 20,
    "diversity": true,
    "request_id": "550e8400-e29b-41d4-a716-446655440000"
  }'

Success Response Example (scope=clip)

{
  "code": 200,
  "msg": "success",
  "data": {
    "request_id": "550e8400-e29b-41d4-a716-446655440000",
    "recalled": 64,
    "total": 20,
    "results": [
      {
        "id": 2693564728807342,
        "score": 0.87,
        "download_url": "https://cdn.example.com/nmcn/material/video_clip/raw/2693564728807342.mp4?expires=1750086000&sign=Xa1b2C3d4E5f6G7h8I9j0k",
        "cover_url": "https://cdn.example.com/nmcn/material/video_clip/keyframe/2693564728807342/cover.jpg",
        "preview_url": "https://cdn.example.com/nmcn/material/video_clip/preview/2693564728807342.mp4",
        "duration": 12.4,
        "width": 3840,
        "height": 2160,
        "fps": 25,
        "orientation": "landscape",
        "note": "Aerial city night view with dense towers and light trails.",
        "tags": ["city", "night", "aerial", "traffic"]
      }
    ]
  }
}

Example with the Pexels supplement

Request:

curl -X POST https://api.ai-mcn.tv:10000/task/material_search \
  -H "Authorization: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "scope": "clip",
    "query": "aerial view of a city at night",
    "top_k": 20,
    "stock_sources": ["pexels"]
  }'

Response (excerpt: one item each from results and pexels_results):

{
  "code": 200,
  "msg": "success",
  "data": {
    "request_id": null,
    "recalled": 64,
    "total": 20,
    "results": [
      {
        "id": 2693564728807342,
        "score": 0.87,
        "download_url": "https://cdn.example.com/nmcn/material/video_clip/raw/2693564728807342.mp4?expires=1750086000&sign=Xa1b2C3d4E5f6G7h8I9j0k",
        "cover_url": "https://cdn.example.com/nmcn/material/video_clip/keyframe/2693564728807342/cover.jpg",
        "preview_url": "https://cdn.example.com/nmcn/material/video_clip/preview/2693564728807342.mp4",
        "duration": 12.4,
        "width": 3840,
        "height": 2160,
        "fps": 25,
        "orientation": "landscape",
        "note": "Aerial city night view with dense towers and light trails.",
        "tags": ["city", "night", "aerial", "traffic"]
      }
    ],
    "pexels_status": "ok",
    "pexels_results": [
      {
        "id": "pexels:video:36590293",
        "source_id": "36590293",
        "rank": 1,
        "page_url": "https://www.pexels.com/video/36590293/",
        "author": "Photographer Name",
        "author_url": "https://www.pexels.com/@photographer",
        "download_url": "https://videos.pexels.com/video-files/36590293/example_3840_2160_30fps.mp4",
        "preview_url": "https://videos.pexels.com/video-files/36590293/example_640_360_30fps.mp4",
        "cover_url": "https://images.pexels.com/videos/36590293/example.jpeg",
        "duration": 19,
        "width": 3840,
        "height": 2160,
        "fps": 29.97,
        "orientation": "landscape",
        "tags": []
      }
    ],
    "task_id": "123456789012345678"
  }
}

Response Fields

Top level:

FieldTypeDescription
request_idstringEchoes the request request_id
recalledintegerTotal recalled (before filtering), for observability
totalintegerNumber of results returned
resultsarrayResult list, sorted by score; fields vary by scope (see below)
pexels_status / pexels_results—Only when the request carries stock_sources; see Pexels supplementary results

💡 Interpreting score: score is a fused recall score (0–1). Scales differ by modality and are not comparable across modalities — video/image use cross-modal text-to-visual embeddings (naturally lower values), while audio uses same-modal text embeddings (naturally higher values). Rule of thumb: video/image results with score > 0.2 are good matches; audio results with score > 0.45 are good matches. Results below these thresholds are mostly weak-relevance fallbacks — consider filtering or truncating accordingly.

Video (scope=clip) result fields:

FieldTypeDescription
idintegerMaterial id
scorenumberRelevance score (after rerank, descending)
download_urlstringTemporary full-clip download URL (mp4, expires in 24h via ?expires=&sign=)
cover_urlstringCover image (does not expire)
preview_urlstringLow-bitrate preview proxy (does not expire)
durationnumberDuration (seconds)
width / heightintegerResolution (pixels)
fpsnumberFrame rate
orientationstringlandscape / portrait / square
notestringMaterial text description
tagsarray<string>AI attribute tags

Image (scope=image) result fields:

FieldTypeDescription
idintegerMaterial id
scorenumberRelevance score
download_urlstringTemporary original-image download URL (expires in 24h)
thumb_urlstringThumbnail (does not expire)
width / heightintegerResolution (pixels)
notestringMaterial text description
tagsarray<string>AI attribute tags

Audio (scope=audio) result fields:

FieldTypeDescription
idintegerMaterial id
scorenumberRelevance score
download_urlstringTemporary original-track download URL (mp3, expires in 24h)
accompaniment_urlstringAccompaniment (off-vocal) download URL (signed, only when audio_type=song)
cover_urlstringCover image (does not expire)
titlestringTrack title
authorstringArtist / creator
durationnumberDuration (seconds)
audio_typestringsong / pure (instrumental)
notestringMaterial text description
tagsarray<string>AI attribute tags

Pexels supplementary results

When the request carries stock_sources: ["pexels"], the response gains two top-level fields; results, total and recalled stay exactly the same as without the parameter.

FieldTypeDescription
pexels_statusstringok results returned / empty no match / unavailable temporarily unavailable (retry later; library results are still returned and billed as usual) / not_applicable (scope=audio) / disabled turned off on the server
pexels_resultsarrayPexels results, in Pexels' order; an empty array whenever pexels_status is not ok

Fields of each pexels_results item:

FieldTypeDescription
idstringpexels:video:<number> / pexels:image:<number> (a string, never the same shape as a numeric library id)
source_idstringThe asset id on Pexels
rankintegerPosition among the Pexels results, starting at 1 (no score — not comparable with library scores)
page_urlstringThe asset's page on Pexels
author / author_urlstringPhotographer name and profile
download_urlstringVideo: the highest-resolution mp4; image: the original. Points straight to the Pexels CDN, no expiring signature
preview_urlstringVideo only: an mp4 preview around 360p
cover_urlstringVideo only: cover image
thumb_urlstringImage only: medium-size image
duration / fps / orientation—Video only: duration (seconds), frame rate, orientation
width / heightintegerResolution (pixels)
notestringImage only: Pexels' image description
tagsarray<string>Pexels tags (often empty)

⚠️ Credit Pexels when you use these assets: show a prominent link to Pexels wherever you use them (for example "Photos and videos provided by Pexels"), and credit the photographer when possible (author / author_url). Do not resell Pexels assets unaltered, and do not redistribute them on other stock-photo or wallpaper platforms. See the Pexels License.

Error Codes

CodeHTTPDescriptionResolution
400400Invalid params / body (bad scope, empty query, top_k out of range, invalid stock_sources)Check request params
6502401Authentication failedCheck the API Key in the Authorization header
64016401Upstream search service unavailableRetry later
64026402Upstream search service timeoutRetry later

Limits

  • top_k is capped at 50 (clamped automatically).
  • A single request takes a single scope (no cross-modality mixing); call separately for multiple modalities.
  • Download URLs download_url (and audio accompaniment_url) expire in 24h. For video materials, use Material Link Re-signing to get fresh links free and unlimited after expiry (once searched, always granted — no paid re-search needed); for image / audio, re-search for now. Previews cover_url / thumb_url / preview_url do not expire.
  • This endpoint takes a single query; call concurrently for batch needs.
  • The Pexels supplement applies to clip / image only; pexels_results holds at most top_k items.
  • If Pexels is temporarily unavailable (rate limit, timeout, and so on), the request still succeeds: library results are returned and billed as usual, and pexels_status is unavailable.

🤝 Join the Tonghe New Media Network to unlock internal member benefits: network members (internal) get custom-scope full-library material search (video / image / audio, including concept and non-commercial materials, with a commercial-only filter) and exclusive internal voices. Apply at the Creator Network; once approved, an administrator will enable internal access for you.