Collect video IDs
You are reading API v2 documentationStill using the Legacy API? Access the Legacy API documentation.
You can use the API v2 to easily collect video IDs and embed your content on your properties.
In this article, you'll learn how to collect the right video ID to embed.
How it works
Every video has a video_url field that points to the canonical URL of the video on Dailymotion. The ID embedded in this URL automatically reflects the video's visibility:
| Visibility | video_url example | ID to use |
|---|---|---|
public, password | https://www.dailymotion.com/video/x1234 | x1234 |
private | https://www.dailymotion.com/video/k123456789 | k123456789 |
No need to juggle multiple fields, video_url always gives you the right ID.
1. Get your Profile ID
If you don't already have it, retrieve your profile_id first:
curl --request GET \
--url https://api.dailymotion.com/v2/me \
--header 'accept: application/json' \
--header 'authorization: Bearer <ACCESS_TOKEN>'Required scope: account.read
2. List your videos and retrieve their URLs
Request the video_url, title, and visibility fields for your videos:
curl --request GET \
--url 'https://api.dailymotion.com/v2/profiles/<PROFILE_ID>/videos?page=1&page_size=20&fields=video_url%2Ctitle%2Cvisibility' \
--header 'accept: application/json' \
--header 'authorization: Bearer <ACCESS_TOKEN>'Required scope: video.read
Pagination: Use page and page_size (max 100) to navigate through results.
Example response
{
"data": [
{
"title": "My public video",
"visibility": "public",
"video_url": "https://www.dailymotion.com/video/x12345"
},
{
"title": "My private video",
"visibility": "private",
"video_url": "https://www.dailymotion.com/video/k543219876"
}
]
}3. Extract the video ID and embed your content
The video ID is the last segment of the video_url path:
https://www.dailymotion.com/video/x12345→ video ID isx12345https://www.dailymotion.com/video/k543219876→ video private ID isk543219876
Use this ID directly in your embed.
You're now ready to embed your content. We invite you to continue with our dedicated embed method guides to learn how to pick the best integration method and start your step-by-step integration:
Updated 7 days ago
