Generate download URLs
You are reading API v2 documentationStill using the Legacy API? Access the Legacy API documentation.
Download URLs allows Partners to programmatically retrieve video files directly from Dailymotion's CDN using the API.
This guide explains how to generate downloadable video file URLs for your content hosted on Dailymotion.
Prerequisites
Pro Enterprise plan with add-on Stream URL feature
Reach out to your Dailymotion Customer Success Manager or our Support team if you need to add the feature to your plan.
Private API key with Generate stream URLs permission
In Dailymotion Studio > Organization settings > API keys > Create API key > Private API key > Toggle on "Generate stream URLs".

1. Authenticate
To generate stream URLs via the API v2, you need an access token with the video.read scope. Refer to the authentication guide.
curl --request POST \
--url https://oauth2.dailymotion.com/v2/token \
--header 'accept: application/json' \
--header 'content-type: application/x-www-form-urlencoded' \
--data grant_type=client_credentials \
--data scope=video.read \
--data client_id=<CLIENT_ID> \
--data client_secret=<CLIENT_SECRET>2. Check available formats (optional but recommended)
Before requesting a download, it is strongly recommended to check which formats are available for the video. This allows you to pick the right format_id values and avoid unnecessary errors caused by requesting a non-existent format.
Request the available_formats field on the video resource:
// Replace the VIDEO_ID with your own
curl -X GET "https://api.dailymotion.com/v2/videos/<VIDEO_ID>?fields=available_formats" \
-H "Authorization: Bearer <ACCESS_TOKEN>"This returns a list of available encoded formats with the following information:
| Field | Type | Description |
|---|---|---|
format_id | string | Unique identifier for this format. Use this in the download request (ie. vf_720p_h264) |
type | Enum("video", "audio", "muxed") | Whether this is a video track, audio track, or a muxed file |
label | string | Human-readable label (ie. 720p, AAC stereo) |
quality | string | Quality descriptor (ie. HD, SD) |
codecs | Array[string] | Codec identifiers (ie [h264], [aac]) |
language | string | Language tag (e.g. en, fr), if applicable |
sub_type | Enum("original", "dubbed", "dubbed_ai", "audiodescription") | null | Audio variant type, if applicable |
Use the format_id values from this response as inputs to the download endpoint in the next step.
3. Request download URL
Call the download endpoint with the video ID. There are three common scenarios depending on your use case.
Scenario A: Download all available formats
If you omit both video_format_id and audio_format_ids, the server returns download URLs for every available video and audio rendition. This is useful for bulk export or when you want to present the full format list to an end user.
curl -X POST "https://api.dailymotion.com/v2/videos/<VIDEO_ID>/downloads" \
-H "Authorization: Bearer <ACCESS_TOKEN>" \
-H "Content-Type: application/json" \
-d '{}'Scenario B: Download a specific video quality
Provide a video_format_id to request a download URL for a specific video track only. The format_id must come from the available_formats response from step 2.
curl -X POST "https://api.dailymotion.com/v2/videos/<VIDEO_ID>/downloads" \
-H "Authorization: Bearer <ACCESS_TOKEN>" \
-H "Content-Type: application/json" \
-d '{"video_format_id": "vf_720p_h264"}'Scenario C: Download a specific video + audio combination
Provide both video_format_id and audio_format_ids to target a precise video/audio pairing. When a muxed version of that combination is available on the server, it will be returned as a single "muxed" entry (one file containing both video and audio). Otherwise, separate video and audio download URLs are returned.
This is particularly useful for multilingual content, where you may want to download a video track paired with a specific dubbed or original audio track.
curl -X POST "https://api.dailymotion.com/v2/videos/<VIDEO_ID>/downloads" \
-H "Authorization: Bearer <ACCESS_TOKEN>" \
-H "Content-Type: application/json" \
-d '{
"video_format_id": "vf_720p_h264",
"audio_format_ids": ["af_aac_stereo_fr"]
}'You can also request multiple audio tracks at once (ie. to get both an original and a dubbed version):
curl -X POST "https://api.dailymotion.com/v2/videos/x8abc123/downloads" \
-H "Authorization: Bearer <your_access_token>" \
-H "Content-Type: application/json" \
-d '{
"video_format_id": "vf_720p_h264",
"audio_format_ids": ["af_aac_stereo_en", "af_aac_stereo_fr"]
}'Response
The response is a list of data around the downloadable file. Each entry contains:
| Field | Type | Description |
|---|---|---|
type | Enum("video", "audio", "muxed") | Nature of the downloadable file |
label | string | Human-readable label matching the available_format descriptor (ie "720p") |
quality | string | Quality descriptor (e.g. HD, SD) |
download_url | string | Time-limited, pre-signed download URL. Use this to fetch the file. |
Example response (muxed video + audio):
[
{
"type": "muxed",
"label": "720p",
"quality": "HD",
"download_url": "https://cdn.example.com/video/x8abc123/file_720p.mp4?token=abc"
}
]Example response (all formats, no filter applied):
[
{
"type": "video",
"label": "1080p",
"quality": "HD",
"download_url": "https://cdn.example.com/video/x8abc123/file_1080p.mp4?token=abc"
},
{
"type": "video",
"label": "720p",
"quality": "HD",
"download_url": "https://cdn.example.com/video/x8abc123/file_720p.mp4?token=abc"
},
{
"type": "audio",
"label": "AAC stereo",
"quality": "HD",
"download_url": "https://cdn.example.com/video/x8abc123/audio_aac.m4a?token=abc"
}
]
download_urlare time-limitedUse them immediately to fetch the file. Do not store or cache them for later use.
Error Handling
If you provide a format_id that does not exist or is not available for the requested video, the API returns a 422 Unprocessable Entity error. Always validate format_id values against the available_formats response as in step 2 before requesting a download URL.
{
"error": {
"code": "INVALID_VIDEO_FORMAT_ID",
"message": "The requested format_id 'vf_720p_h264' does not exist or is unavailable for this video.",
"correlation_id": "550e8400-e29b-41d4-a716-446655440000"
}
}Updated 6 days ago
