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

By default, generated URLs are IP-locked (restricted to the caller's IP/AS) and time-limited. You can relax these restrictions using optional body fields — see Restriction options below.

💡

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"}'

3. Restriction options (optional)

By default, stream URLs are locked to the caller's IP/AS and are time-limited. If you are relaying traffic on behalf of an end-user (e.g. server-to-server calls), you can relax these restrictions using the following optional body fields:

FieldTypeDescription
client_ipstringPublic IPv4 address of the end-user consuming the URL. Locks the URL to this IP instead of the caller's. IPv6 is not supported.
no_ip_lockbooleanSet to true to disable IP/AS-based restriction. Omit or set to false to keep the URL IP-locked.
no_expirebooleanSet to true to disable URL expiration. Omit or set to false to keep the URL time-limited.

Lock the URL to a specific end-user IP:

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

Generate an unrestricted URL (no IP lock, no expiration):

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

⚠️

Use restriction options responsibly

Disabling IP lock or expiration makes URLs less secure. Only use these options when your architecture requires it (e.g. server-to-server relay).


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?