Find Moments API

March 16, 2026

Find Moments API

The Find Moments API lets you describe the moments you want using natural language — such as "funny reactions" or "product demos" — and the API finds and extracts matching clips with timestamps, titles, descriptions, and hashtags. If export is enabled, the response also includes rendered video download links for each clip.

Supported Video Sources

The API accepts URLs from the following platforms: YouTube, Vimeo, Dailymotion, Kick, Twitch, TikTok, Facebook, Zoom, Rumble and more.

You can also use locally uploaded files. Local upload requires a Standard plan or above. See the Upload API for details.


Submit Find Moments Task

POST https://wayinvideo-api.wayin.ai/api/v2/clips/find-moments

Request Body

When rendering clips, you can enable features such as Animated Caption and AI Reframe. With AI Reframe, the system detects the main subject in the frame, optimizes the crop for the chosen aspect ratio, and selects the most suitable layout based on the structure of the scene. These features are controlled by parameters whose names start with enable_ (see the table below).

ParameterTypeRequiredDefaultDescription
video_urlstringYesThe URL of the source video. For locally uploaded files, use the file identifier returned by the Upload API.
querystringYes""Natural-language query describing the moments you want (e.g. "funny reactions", "product demos")
project_namestringNo""Custom task name
source_langstringNonullSource language of the video (see Supported Languages). When null, the system auto-detects the original language.
target_langstringNonullTarget language for output content including clip titles, descriptions, and subtitles (see Supported Languages). When null, the output language matches source_lang.
enable_exportbooleanNofalseSee below. When false, only clip time ranges, titles, and descriptions are returned (no rendering); when true, clips are rendered and each clip includes an export link.
resolutionstringNoSD_480Output resolution: SD_480, HD_720, FHD_1080. Only used when enable_export is true.
enable_captionbooleanNofalseWhether to add Animated Caption when rendering. Only used when enable_export is true. When true, caption_display and cc_style_tpl take effect; when false, the export has no Animated Caption.
caption_displaystringNooriginalCaption mode: both, original, translation. Only used when enable_export and enable_caption are both true.
cc_style_tplstringNotemp-7Caption style template ID (see Subtitle Styles). Only used when enable_export and enable_caption are both true.
enable_ai_reframebooleanNofalseEnable AI Reframe. Only used when enable_export is true. When true, ratio is required; when false, the video is exported with its original aspect ratio unchanged.
ratiostringYes when enable_ai_reframe is trueAspect ratio: RATIO_9_16, RATIO_1_1, RATIO_4_5, RATIO_16_9. Only used when enable_export is true, and required when enable_ai_reframe is true.

enable_export behavior

  • When enable_export is empty or false, the API only returns clip time ranges, titles, descriptions, and related metadata. No rendering is performed, and there are no export links in the result. The parameters ratio, resolution, caption_display, enable_caption, enable_ai_reframe, and cc_style_tpl have no effect.
  • When enable_export is true, those parameters take effect, each clip is rendered, and the result includes a download link for each clip. Because each clip is rendered, processing may take longer.

Request body sets enable_export to true. Clips are rendered; each clip includes an export_link.

Request

curl -X POST https://wayinvideo-api.wayin.ai/api/v2/clips/find-moments \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "x-wayinvideo-api-version: v2" \
  -d '{
    "video_url": "https://www.youtube.com/watch?v=example",
    "query": "sample query",
    "project_name": "sample project name",
    "enable_export": true,
    "resolution": "FHD_1080",
    "enable_caption": true,
    "enable_ai_reframe": true,
    "ratio": "RATIO_9_16"
  }'

Submit response

{
  "data": {
    "id": "proj_moment_789",
    "name": "sample project name",
    "status": "CREATED"
  }
}

Request body omits enable_export or sets it to false. Only clip time ranges, titles, descriptions, and tags are returned; no rendering, no export links.

Request

curl -X POST https://wayinvideo-api.wayin.ai/api/v2/clips/find-moments \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "x-wayinvideo-api-version: v2" \
  -d '{
    "video_url": "https://www.youtube.com/watch?v=example",
    "query": "sample query",
    "project_name": "sample project name"
  }'

Submit response

{
  "data": {
    "id": "proj_moment_456",
    "name": "sample project name",
    "status": "CREATED"
  }
}
FieldTypeDescription
idstringUnique task identifier
namestringTask name
statusstringCREATED, QUEUED, ONGOING, SUCCEEDED, FAILED

Get Find Moments Results

Poll for results until status is SUCCEEDED.

GET https://wayinvideo-api.wayin.ai/api/v2/clips/find-moments/results/{id}

Path Parameters

ParameterTypeRequiredDescription
idstringYesThe task ID returned by the submit endpoint

Example Request

curl -X GET https://wayinvideo-api.wayin.ai/api/v2/clips/find-moments/results/proj_moment_456 \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "x-wayinvideo-api-version: v2"

When the task was submitted with enable_export: true, each clip includes an export_link for the rendered video:

{
  "data": {
    "id": "proj_moment_789",
    "name": "sample project name",
    "status": "SUCCEEDED",
    "expire_at": 1775831883112,
    "cost_usage": 120.0,
    "clips": [
      {
        "idx": 0,
        "title": "sample title",
        "begin_ms": 120000,
        "end_ms": 185000,
        "thumbnail": "https://cdn.example.com/thumb/moment_001.jpg",
        "tags": ["product", "announcement"],
        "desc": "sample description",
        "score": 81,
        "export_link": "https://cdn.example.com/export/moment_001.mp4"
      }
    ]
  }
}

When the task was submitted without enable_export (or with enable_export: false), clips do not include export_link:

{
  "data": {
    "id": "proj_moment_456",
    "name": "sample project name",
    "status": "SUCCEEDED",
    "expire_at": 1775831883112,
    "cost_usage": 120.0,
    "clips": [
      {
        "idx": 0,
        "title": "sample title",
        "begin_ms": 120000,
        "end_ms": 185000,
        "thumbnail": "https://cdn.example.com/thumb/moment_001.jpg",
        "tags": ["product", "announcement"],
        "desc": "sample description",
        "score": 81
      }
    ]
  }
}

Response Fields

FieldTypeDescription
idstringUnique task identifier
namestringTask name
statusstringCREATED, QUEUED, ONGOING, SUCCEEDED, FAILED
error_messagestringError reason (only present when status is FAILED)
expire_atintegerExpiration timestamp in milliseconds (epoch). After this time, the task expires and results can no longer be retrieved via the results endpoint. The expiration period depends on your subscription plan. See the Subscription Plans page for details.
cost_usagenumberAPI units consumed for this request
clipsarrayList of clip objects (see below)

Clip Object

FieldTypeDescription
idxintegerClip index (0-based, ranked by viral potential)
titlestringAI-generated clip title
begin_msnumberStart time in milliseconds
end_msnumberEnd time in milliseconds
thumbnailstringThumbnail image URL
tagsstring[]AI-generated hashtags
descstringAI-generated description
scorenumberViral potential score (0–100, higher is better)
export_linkstringRendered video download URL (when enable_export is true). A new link is generated each time you call the results endpoint. Each link expires after 24 hours — please download the video before it expires. If the link has expired, call the results endpoint again to get a new one.