TikTok for Developers

Developer Docs

Last updated November 24, 2026

Query Mini Drama Video Media Information

Retrieves technical information about up to 20 videos, including the source file and every transcoded output. Use the returned store_uri values to create a CDN preload task.

Endpoint

HTTP URL

https://open.tiktokapis.com/v2/sg/shortdrama/video/media-info/query/

HTTP method

POST

Scopes

None

Content type

application/json

Request

Headers

Field

Type

Description

Required

Example

Authorization

string

The client access token of your mini app, prefixed with Bearer.

Yes

Bearer clt.example12345Example12345Example

Content-Type

string

The media type of the request body.

Yes

application/json

Request body

Field

Type

Description

Required

Example

byteplus_account_id

string

The ID of the BytePlus account.

Yes

3000000000

vids

list<string>

The IDs of the videos to query. Minimum: 1. Maximum: 20.

Yes

["v0d000example0000000000000000001"]

Request example

curl --location --request POST 'https://open.tiktokapis.com/v2/sg/shortdrama/video/media-info/query/' \
--header 'Authorization: Bearer CLIENT_ACCESS_TOKEN' \
--header 'Content-Type: application/json' \
--data-raw '{
  "byteplus_account_id": "BYTEPLUS_ACCOUNT_ID",
  "vids": ["v0d000example0000000000000000001"]
}'

Replace the following:

  • CLIENT_ACCESS_TOKEN: your mini app's client access token.
  • BYTEPLUS_ACCOUNT_ID: the ID of the BytePlus account bound to your mini app.

Response

Response body

Field

Type

Description

data

MediaInfoData

The media information.

error

ErrorStruct

The error object.

MediaInfoData

Field

Type

Description

Example

media_info_map

object

The media information for each video. Each key is a vid, and each value is a list<MediaInfoItem>. See MediaInfoItem.

See the response example.

partial_success

Boolean

true if information was returned for only some videos; false otherwise. Check status in each item.

false

MediaInfoItem

Field

Type

Description

Example

media_info

MediaInfo

The media information for the video.

See MediaInfo.

status

string

The query status for this video.

SUCCESS

error_code

string

The error code. Returned only when the query for this video fails.

1221106

error_message

string

The error description. Returned only when the query for this video fails.

Video was not found in BytePlus.

MediaInfo

Field

Type

Description

basic_info

BasicInfo

General information about the video.

source_info

SourceInfo

Information about the source file.

transcode_infos

list<TranscodeInfo>

Information about each transcoded output.

BasicInfo

Field

Type

Description

Example

vid

string

The ID of the video.

v0d000example0000000000000000001

title

string

The title of the video.

episode_01

space_name

string

The name of the BytePlus space.

shortdrama-sg

create_time

string

The creation time, in ISO 8601 format.

2026-08-19T06:26:05Z

duration

double

The duration of the video in seconds.

10.08

poster_uri

string

The storage URI of the cover image.

tos-vod-example/poster0000example

publish_status

string

The BytePlus publish status.

Published

tos_storage_class

string

The BytePlus storage class.

STANDARD

vod_upload_source

string

How the video was uploaded.

url_upload

classification

Classification

The media classification.

See Classification.

SourceInfo

Field

Type

Description

Example

file_id

string

The ID of the file.

v0d000example0000000000000000001

file_name

string

The file name.

example0000.mp4

file_type

string

The file type.

video

format

string

The container format.

MP4

codec

string

The video codec.

h264

definition

string

The definition label.

unknown

width

int32

The video width in pixels.

720

height

int32

The video height in pixels.

1280

fps

double

The frame rate.

24

bitrate

int64

The total bitrate in bits per second.

3494934

duration

double

The duration in seconds.

10.08

dynamic_range

string

The dynamic range.

SDR

size

int64

The file size in bytes.

4403618

md5

string

The MD5 hash of the file.

0123456789abcdef0123456789abcdef

store_uri

string

The storage URI of the file.

tos-vod-example/example0000.mp4

tos_storage_class

string

The BytePlus storage class.

STANDARD

create_time

string

The creation time, in ISO 8601 format.

2026-08-19T06:26:05Z

video_stream_meta

VideoStreamMeta

The video stream information.

See VideoStreamMeta.

audio_stream_meta

AudioStreamMeta

The audio stream information.

See AudioStreamMeta.

TranscodeInfo

TranscodeInfo has the same fields as SourceInfo, except file_name. The definition field returns the transcoded definition, such as 480p or 720p.

VideoStreamMeta

Field

Type

Description

Example

codec

string

The video codec.

h264

width

int32

The width in pixels.

720

height

int32

The height in pixels.

1280

definition

string

The definition label.

720p

duration

double

The duration in seconds.

10.08

bitrate

int64

The bitrate in bits per second.

3494934

fps

double

The frame rate.

24

AudioStreamMeta

Field

Type

Description

Example

duration

double

The duration in seconds.

10.08

sample_rate

int32

The sample rate in hertz.

44100

bitrate

int64

The bitrate in bits per second.

128000

channels

int32

The number of audio channels.

2

Classification

Field

Type

Description

Example

classification

string

The media classification.

N/A

ErrorStruct

Field

Type

Description

code

string

The error code. Omitted on success.

message

string

A human-readable description of the error.

log_id

string

The unique identifier for the request. Include this value when contacting support.

Response example

{
  "data": {
    "media_info_map": {
      "v0d000example0000000000000000001": [
        {
          "media_info": {
            "basic_info": {
              "vid": "v0d000example0000000000000000001",
              "title": "episode_01",
              "space_name": "shortdrama-sg",
              "create_time": "2026-08-19T06:26:05Z",
              "duration": 10.08,
              "poster_uri": "tos-vod-example/poster0000example",
              "publish_status": "Published",
              "tos_storage_class": "STANDARD",
              "vod_upload_source": "url_upload"
            },
            "source_info": {
              "file_id": "v0d000example0000000000000000001",
              "file_name": "example0000.mp4",
              "file_type": "video",
              "format": "MP4",
              "codec": "h264",
              "definition": "unknown",
              "width": 720,
              "height": 1280,
              "fps": 24,
              "bitrate": 3494934,
              "duration": 10.08,
              "dynamic_range": "SDR",
              "size": 4403618,
              "md5": "0123456789abcdef0123456789abcdef",
              "store_uri": "tos-vod-example/example0000.mp4",
              "tos_storage_class": "STANDARD",
              "create_time": "2026-08-19T06:26:05Z"
            },
            "transcode_infos": [
              {
                "file_id": "example0000transcode480p",
                "file_type": "video",
                "format": "MP4",
                "codec": "h264",
                "definition": "480p",
                "width": 480,
                "height": 854,
                "bitrate": 496999,
                "duration": 10.08,
                "dynamic_range": "SDR",
                "size": 626219,
                "md5": "abcdef0123456789abcdef0123456789",
                "store_uri": "tos-vod-example/transcode0000480p",
                "tos_storage_class": "STANDARD",
                "create_time": "2026-08-19T06:29:42Z"
              }
            ]
          },
          "status": "SUCCESS"
        }
      ]
    },
    "partial_success": false
  },
  "error": {
    "log_id": "202508010000000000000000000000000"
  }
}

Error codes

Error code

Description

Resolution

5001

The service is temporarily unavailable.

Retry later. If the error persists, contact support with the log_id.

1121012

The query is invalid.

Provide the client key, byteplus_account_id, and 1 to 20 video IDs.

1221106

The video wasn't found in BytePlus.

Verify the vid and BytePlus account. When partial_success is true, check error_code in each item.

TikTok for Developers