Generate download URLs


Download URL is a plan feature

Please reach out to your Dailymotion Account Manager to upgrade.

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".

Generate Stream URLs permission in Studio

Download files from Dailymotion

1. Authenticate

Authenticate against the API using:

  • Private API key with "Generate stream URL" permission.
  • client_credentials grant type.
  • read_video_streams scope.
curl --request POST \
     --url https://partner.api.dailymotion.com/oauth/v1/token \
     --header 'accept: application/json' \
     --header 'content-type: application/x-www-form-urlencoded' \
     --data grant_type=client_credentials \
     --data scope=read_video_streams \
     --data client_id=<CLIENT_ID> \
     --data client_secret=<CLIENT_SECRET>

2. Generate a file URL

Retrieve your video's file URL in the quality you need. Check supported mp4 formats.

curl --request GET \
     --url 'https://partner.api.dailymotion.com/rest/video/<VIDEO_ID>?fields=stream_h264_url%2Cstream_h264_hq_url' \ Add any mp4 video format needed
     --header 'authorization: Bearer <ACCESS_TOKEN>'

The response includes a file URL with a temporary security token.


3. Add download parameter

Append the retrieved file URL with download=1 parameter to download the video file.

https://cdndirector.dailymotion.com/cdn/H264-512x384/video/<VIDEO_ID>.mp4?sec=<TOKEN>&download=1

Supported MP4 formats

You can retrieve a file link in any of the mp4 quality below. Pass the API parameter(s) in fields in your request. 

FormatQualityAPI parameterResolutionW x H
H264 (mp4)stream_h264_url380p512 x 384
H264 (mp4)hqstream_h264_hq_url480p720 x 480
H264 (mp4)hdstream_h264_hd_url720p1280 x 720
H264 (mp4)hd1080stream_h264_hd1080_url1080p1920 x 1080
H264 (mp4)qhdstream_h264_qhd_url1440p2560 x 1440
H264 (mp4)uhdstream_h264_uhd_url2160p3840 x 2160

If the selected format returns null, this indicates that the requested format is not available for the specified video.