> ## 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) 以在您的账户中启用该功能。

> [!NOTE]
>
> 每个请求都需要一个交付目标。在发送第一个请求之前，请配置交付目标。请参阅 [交付选项](https://docs.brightdata.com/products/scrapers/scrapers-library/data-delivery.md)。

## 输入字段

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

**url** `string` *required*

要下载的视频的完整 URL。支持的平台：YouTube、Vimeo、TikTok、Bilibili。

**format** `string` (default: full)

指定要下载的内容类型。

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

**captions** `boolean` (default: false)

是否下载视频的可用字幕或副标题。

**captions\_format** `string` (default: vtt)

下载字幕的文件格式。仅当 `captions` 为 `true` 时适用。

| 值 | 描述 |
| - | - |
| `vtt` | WebVTT 格式 |
| `srt` | SubRip 格式 |
| `json3` | JSON 格式 |

**min\_height** `integer`

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

常见值：`360`、`480`、`720`、`1080`、`1440`、`2160`

**max\_height** `integer`

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

常见值：`360`、`480`、`720`、`1080`、`1440`、`2160`

**orientation** `array` (default: 所有方向)

将下载限制为具有所列方向的视频。可接受一个或多个值。省略 `orientation` 时，接受全部三种方向。

| 值 | 描述 |
| - | - |
| `vertical` | 竖向视频，高度大于宽度 |
| `horizontal` | 横向视频，宽度大于高度 |
| `square` | 宽度与高度相等的视频 |

**示例：** `["vertical", "square"]`

**quality\_priority** `string` (default: highest)

当有多个版本同时满足 `min_height` 和 `max_height` 时，选择要下载的版本。

| 值 | 描述 |
| - | - |
| `highest` | 下载可用的最高质量 |
| `lowest` | 下载可用的最低质量 |

**filesize\_priority** `string` (default: highest)

在所选高度范围（`min_height` 和 `max_height`）内，优先选择文件大小最大或最小的版本进行下载。

| 值 | 描述 |
| - | - |
| `highest` | 下载可用文件大小最大的格式 |
| `lowest` | 下载可用文件大小最小的格式 |

**thumbnail** `boolean` (default: false)

是否在结果中包含视频的缩略图。

**storyboards** `boolean` (default: false)

是否在结果中包含视频的故事板图像（用于时间线预览滚动的精灵图）。

**extra\_path** `string`

用于文件上传的自定义路径。覆盖交付设置中配置的路径。支持模板变量：`{{datetime}}`、`{{video_id}}`、`{{job}}`。

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

**filename** `string`

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

**示例：** `"{{video_id}}_{{datetime}}"`


## 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/products/scrapers/scrapers-library/data-delivery).
      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
                orientation:
                  - vertical
                  - horizontal
                  - square
                quality_priority: highest
                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
        orientation:
          type: array
          description: >-
            Restricts the download to videos with the listed orientations. When
            omitted, all three orientations are accepted.
          items:
            type: string
            enum:
              - vertical
              - horizontal
              - square
          default:
            - vertical
            - horizontal
            - square
          example:
            - vertical
            - square
          x-enumDescriptions:
            vertical: Portrait videos, where height is greater than width.
            horizontal: Landscape videos, where width is greater than height.
            square: Videos with equal width and height.
        quality_priority:
          type: string
          description: >-
            Selects which of the available renditions to download when more than
            one satisfies `min_height` and `max_height`.
          default: highest
          enum:
            - highest
            - lowest
          x-enumDescriptions:
            highest: Downloads the highest available quality.
            lowest: Downloads the lowest available quality.
        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).

````