Getting started with Dailymotion’s APIs

You may have already heard about APIs. If this is your first contact, don’t worry, you’re going to love working with Dailymotion’s one. At first, APIs can seem technical and abstract, mostly because they don’t have graphical user interfaces, but they are actually very useful and powerful.

API introduction for newbies

Using Dailymotion’s API requires to master at least one technical language (such as PHP, Python, JavaScript, Ruby, Golang…) and you would probably be right if you think that you could get data in a lot more user-friendly way (with a web browser like Google Chrome, for example). But interacting with it allows you to do a lot of concrete actions. It’s basically the simplest way to access, publish and modify resources on the platform.

API: definition

By definition an API is an application programming interface, which means that it’s a framework which allows you to talk with another application. Just as every other APIs, our interface follows some rules to communicate. So, in order to use it, you first have to register yourself and retrieve an API key.

Performing an API call

Our API presents a simple, consistent view of Dailymotion’s resources (usersvideosplaylists…) and connections between them (user’s videosvideos in playlists, followed channels…). There are 3 categories of actions you can perform with our API:

  1. GET: to get information about a Dailymotion’s resource.
  2. POST: to create or update a new resource on the platform.
  3. DELETE: to remove a resource from the platform.

Now let’s see which data you can interact with. Once you’re authenticated, you can access to specific resources with specific URLs. For example, https://api.dailymotion.com/videos will give you access to the list of the latest videos on Dailymotion, while https://api.dailymotion.com/video/ID will lead you to one specific video. In a nutshell, it’s a connection-point to a web service. Every data possesses its own URL that you’ll point your HTTP client at to interact with.

Our REST API uses HTTP protocol to receive and send messages. All responses are sent back to you in JSON format (a lightweight data-interchange format). In order to make your requests more precise you can use fields. All Dailymotion’s resources are composed of fields. Each resource has an identifier id and some other fields defined in the API Reference.

Error responses:

Error responses may happen, resulting from failed API calls, but don’t worry: every error response contains a status code and an error message, which indicates the error type in order to help you understand what went wrong. In the interests of simplification Dailymotion’s API uses conventional HTTP response codes.

Explore Dailymotion’s API

Dailymotion Explorer

To allow you test and learn our service, we created an “API Explorer”. This sandbox is the best place to simulate requests, discover all the available fields and avoid error responses. Don’t hesitate to use it before you actually request data in our API. It’s also an excellent way to get familiar with the syntax (see our glossary).