> ## Documentation Index
> Fetch the complete documentation index at: https://docs.brightdata.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 媒体数据 API

> Bright Data 媒体数据 API 的输入字段参考。从 YouTube、Vimeo、TikTok 和 Bilibili 下载视频、音频、字幕、缩略图和故事板。

<Warning>
  媒体数据 API 默认未启用。请联系 [support@brightdata.com](mailto:support@brightdata.com) 以在您的账户中启用该功能。
</Warning>

<Note>
  每个请求都需要一个交付目标。在发送第一个请求之前，请配置交付目标。请参阅 [交付选项](/products/scrapers/scrapers-library/delivery-options#delivery-options)。
</Note>

## 输入字段

请求主体是一个 JSON 数组。数组中的每个对象都是一个单独的下载任务。

<ParamField body="url" type="string" required>
  要下载的视频的完整 URL。支持的平台：YouTube、Vimeo、TikTok、Bilibili。
</ParamField>

<ParamField body="format" type="string" default="full">
  指定要下载的内容类型。

  | 值                        | 描述                        |
  | ------------------------ | ------------------------- |
  | `full`                   | 下载包含默认音轨的视频               |
  | `video_only`             | 下载不含音频的视频流                |
  | `audio_only`             | 仅下载默认音轨                   |
  | `all_audio_tracks`       | 下载所有可用的音轨（例如多种语言），不包含视频   |
  | `all_audio_tracks+video` | 下载视频以及所有可用的音轨             |
  | `none`                   | 跳过媒体下载。当您仅需要字幕、缩略图或故事板时使用 |
</ParamField>

<ParamField body="captions" type="boolean" default="false">
  是否下载视频的可用字幕或副标题。
</ParamField>

<ParamField body="captions_format" type="string" default="vtt">
  下载字幕的文件格式。仅当 `captions` 为 `true` 时适用。

  | 值       | 描述        |
  | ------- | --------- |
  | `vtt`   | WebVTT 格式 |
  | `srt`   | SubRip 格式 |
  | `json3` | JSON 格式   |
</ParamField>

<ParamField body="min_height" type="integer">
  接受的最低视频分辨率，以垂直像素数表示。仅当存在等于或高于该高度的分辨率时，下载才会进行。

  常见值：`360`、`480`、`720`、`1080`、`1440`、`2160`
</ParamField>

<ParamField body="max_height" type="integer">
  接受的最高视频分辨率，以垂直像素数表示。仅当存在等于或低于该高度的分辨率时，下载才会进行。

  常见值：`360`、`480`、`720`、`1080`、`1440`、`2160`
</ParamField>

<ParamField body="thumbnail" type="boolean" default="false">
  是否在结果中包含视频的缩略图。
</ParamField>

<ParamField body="storyboards" type="boolean" default="false">
  是否在结果中包含视频的故事板图像（用于时间线预览滚动的精灵图）。
</ParamField>

<ParamField body="extra_path" type="string">
  用于文件上传的自定义路径。覆盖交付设置中配置的路径。支持模板变量：`{{datetime}}`、`{{video_id}}`、`{{job}}`。

  **示例：** `"my-videos/{{video_id}}/{{datetime}}"`
</ParamField>

<ParamField body="filename" type="string">
  已上传文件的自定义文件名。该值作为所有输出文件的基础名称使用（例如 `<filename>.mp4`、`<filename>.metadata.json`、`<filename>.sub.0`）。支持模板变量：`{{datetime}}`、`{{video_id}}`、`{{job}}`。

  **示例：** `"{{video_id}}_{{datetime}}"`
</ParamField>

```
```


## OpenAPI

````yaml api-reference/media-data-api/media-data-api POST /dca/trigger_hp
openapi: 3.1.0
info:
  title: Media Data API
  version: 1.0.0
  description: >-
    Extract video, audio, captions, thumbnails and storyboards from YouTube,
    Vimeo, TikTok and Bilibili and deliver them to your configured storage
    destination.
servers:
  - url: https://api.brightdata.com
security:
  - bearerAuth: []
paths:
  /dca/trigger_hp:
    post:
      summary: Trigger a media extraction job
      description: >-
        Submits one or more media extraction jobs. Results are delivered to your
        configured storage destination when each job completes.


        > **Access required:** The Media Extraction API is not enabled by
        default. Contact [support@brightdata.com](mailto:support@brightdata.com)
        to enable it for your account.


        > **Delivery required:** A delivery destination must be configured
        before sending requests. See [Delivery
        options](https://docs.brightdata.com/datasets/scrapers/scrapers-library/delivery-options#delivery-options).
      operationId: triggerMediaExtraction
      parameters:
        - name: collector
          in: query
          required: true
          description: >-
            Your Media Extraction collector ID. This is a fixed value assigned
            when the feature is enabled on your account.
          schema:
            type: string
            example: YOUR_COLLECTOR_ID
      requestBody:
        required: true
        description: >-
          A JSON array of extraction job objects. Each object represents one
          media extraction job. Multiple jobs can be submitted in a single
          request.
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/MediaExtractionJob'
              minItems: 1
            example:
              - url: https://www.video-page-example.com/v=89438398439
                format: all_audio_tracks+video
                captions: true
                captions_format: vtt
                min_height: 720
                max_height: 1440
                thumbnail: true
                storyboards: true
      responses:
        '200':
          description: Job accepted successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TriggerResponse'
              example:
                success: true
                inputs: 1
                job_id: hp_mn1l61rn1p94ynijur
        '401':
          description: Unauthorized. Invalid or missing API key.
        '403':
          description: >-
            Forbidden. The Media Extraction API is not enabled for this account.
            Contact support@brightdata.com.
components:
  schemas:
    MediaExtractionJob:
      type: object
      required:
        - url
      properties:
        url:
          type: string
          description: >-
            The full URL of the video to download. Supported platforms: YouTube,
            Vimeo, TikTok, Bilibili.
          example: https://www.video-page-example.com/v=89438398439
        format:
          type: string
          description: Specifies what content type to download.
          default: full
          enum:
            - full
            - video_only
            - audio_only
            - all_audio_tracks
            - all_audio_tracks+video
            - none
          x-enumDescriptions:
            full: Downloads the video with the default audio track.
            video_only: Downloads the video stream without audio.
            audio_only: Downloads the default audio track only.
            all_audio_tracks: >-
              Downloads all available audio tracks (for example, multiple
              languages) without video.
            all_audio_tracks+video: Downloads the video together with all available audio tracks.
            none: >-
              Skips media download. Use when you only need captions, thumbnails,
              or storyboards.
        captions:
          type: boolean
          description: Whether to download available captions or subtitles for the video.
          default: false
        captions_format:
          type: string
          description: >-
            The file format for downloaded captions. Only applies when
            `captions` is `true`. Supported formats: `vtt`, `srt`, `json3`.
          default: vtt
          enum:
            - vtt
            - srt
            - json3
        min_height:
          type: integer
          description: >-
            Minimum accepted video resolution, expressed as a vertical pixel
            count. The download proceeds only if a resolution at or above this
            height is available. Common values: 360, 480, 720, 1080, 1440, 2160.
          example: 720
        max_height:
          type: integer
          description: >-
            Maximum accepted video resolution, expressed as a vertical pixel
            count. The download proceeds only if a resolution at or below this
            height is available. Common values: 360, 480, 720, 1080, 1440, 2160.
          example: 1440
        thumbnail:
          type: boolean
          description: Whether to include the video's thumbnail image in the results.
          default: false
        storyboards:
          type: boolean
          description: >-
            Whether to include the video's storyboard images (sprite sheets used
            for timeline preview scrubbing) in the results.
          default: false
    TriggerResponse:
      type: object
      properties:
        success:
          type: boolean
          description: '`true` when the job was accepted.'
        inputs:
          type: integer
          description: Number of download jobs submitted.
        job_id:
          type: string
          description: Unique identifier for the submitted job.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Your Bright Data API key. Find it in the [Bright Data Control
        Panel](https://brightdata.com/cp/api_keys).

````