Select the format before requesting its address

Use this operation after identifying the target video and format. Obtain itag from video-stream information, then supply it with video_id or video_url. Do not reuse a remembered identifier from another video without checking. Decide whether your player needs combined audio and video before retrieving the address so a format-selection mistake is not mistaken for a playback failure.

Read the returned validity period

The response provides itag, the signed url, and expires_in_seconds. Documentation describes a typical lifetime of roughly six hours, but your handling should use the returned value rather than assuming an address never expires. Keep the retrieval time with the validity period and check the window before use. An expired URL does not establish that the underlying video was deleted.

Preserve evidence for both stages of troubleshooting

If a hypothetical player has no sound, first check whether you selected a video-only format, then check address validity. Record the target, itag, retrieval time, and test result without unnecessarily exposing the temporary address in a shared report. Signing solves address retrieval, not downloading or redistribution permission. Mark playback as verified only after testing it in the intended environment, rather than treating a returned URL as the final proof.

Request URL and parameters

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

Parameter Type Required Meaning
video_id string No Video ID
video_url string No Video URL (ignored if video_id is provided)
itag integer Yes Format identifier itag (obtained from get_video_streams endpoint)

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_signed_stream_url"
params = {
    "video_id": "dQw4w9WgXcQ",
    "video_url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
    "itag": "18"
}
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.