Decide what your playback setup needs

Use video_id or video_url to inspect streams before choosing a format. Does your viewing tool need combined audio and video, or can it handle separate tracks? Answer that before chasing the highest resolution. Basic video information helps confirm the target, while available_qualities describes available quality choices rather than a specification you should assume from the title.

Separate combined formats from adaptive tracks

formats contains audio and video together. adaptive_formats may contain only video or only audio. Read itag, mime_type, quality labels, resolution, and bitrate alongside that distinction. The url field in this operation is null; retrieving stream information is not the same as obtaining a directly playable address. When has_signature is true, use the signed-stream operation for the next step. HLS and DASH manifest addresses may also be present where available.

Document the choice before testing playback

For a hypothetical device that benefits from a lower resolution, note the chosen itag, track type, and reason. Then verify playback separately. A video-only track is not evidence of broken sound, and maximum resolution is not automatically the appropriate choice. Stream information grants no downloading or redistribution rights. Address validity and player compatibility still need checking, so report a reasoned format selection rather than an untested claim of playback success.

Request URL and parameters

GET https://api.trmesh.com/openapi/api/v1/youtube/web_v2/get_video_streams

Parameter Type Required Meaning
video_id string No Video ID
video_url string No Video URL (ignored if video_id is provided)

Run the Python example

Install requests and set TRMESH_API_TOKEN in your environment. Replace the sample identifiers with the public object you intend to inspect. Example IDs may no longer be available.

import os
import requests

# Read your own developer key from the server environment.
url = "https://api.trmesh.com/openapi/api/v1/youtube/web_v2/get_video_streams"
params = {
    "video_id": "dQw4w9WgXcQ",
    "video_url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
}
response = requests.get(
    url, params=params, timeout=30,
    headers={"Authorization": f"Bearer {os.environ['TRMESH_API_TOKEN']}"},
)
response.raise_for_status()
payload = response.json()
print(payload)  # Inspect the actual response before mapping fields

Endpoint documentation · Free profile tool

API calls use your TRMesh account allowance. Check the endpoint price before running a script.