Generate stream URLs

📘

You are reading API v2 documentation

Still using the Legacy API? Access the Legacy API documentation.



To keep your content safely hosted at Dailymotion and integrate it with third-party players, you can generate stream URLs.

In API v2, streaming URLs are generated via a dedicated action endpoint: POST /v2/videos/{id}/streams. This endpoint generates time-limited URLs on every call.

Use this endpoint any time a user or player is about to start playback. Do not pre-generate and store these URLs.

Stream URL feature is a plan feature

Please reach out to your Dailymotion Account Manager to upgrade.


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

1. Authenticate

To generate download 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. Generate a stream URL

Call the streams endpoint with your video ID. You can optionally specify a protocol to get only one stream format. If you omit protocol, the server returns entries for all available protocols (HLS, DASH, and HbbTV depending on what was encoded).

💡

Which protocol to use?

  • hls: Best for Apple devices, Safari, and most mobile players (adaptive bitrate, .m3u8).
  • dash: Best for Android, Chrome, and web players that support adaptive streaming (.mpd).
  • hbbtv: For HbbTV-compliant smart TV applications.

Get all available stream URLs:

curl -X POST "https://api.dailymotion.com/v2/videos/<VIDEO_ID>/streams" \
  -H "Authorization: Bearer <ACCESS_TOKEN>" \
  -H "Content-Type: application/json" \

Get only the HLS stream URL:

curl -X POST "https://api.dailymotion.com/v2/videos/<VIDEO_ID>/streams" \
  -H "Authorization: Bearer <ACCESS_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{"protocol": "hls"}'

Get only the DASH stream URL:

curl -X POST "https://api.dailymotion.com/v2/videos/<VIDEO_ID>/streams" \
  -H "Authorization: Bearer <ACCESS_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{"protocol": "dash"}'

Response

The response is a list of stream URL objects. Each entry contains:

protocolEnum("hls", "dash", "hbbtv")The streaming protocol for this URL
stream_urlstringThe time-limited playback URL to pass to your player

Example response:

{
  "stream_urls": [
    {
      "protocol": "hls",
      "stream_url": "https://cdn.example.com/playlist.m3u8?token=abc"
    }
  ]
}
🚧

stream_url values are time-limited

Pass them directly to your player immediately after generation — do not store or cache them for later reuse.



Did this page help you?