Search code examples
dailymotion-api

Dailymotion Api - can't make the "created_after" filter to work properly


I am using the dailymotion api to retrieve all user's videos created after a specific time.

Example Request url:
    https://api.dailymotion.com/user/x1g65ms/videos?created_after=1423578052

The problem is, the api is returning videos created slightly before the specified timestamp. You can try it yourself by using the api explorer: https://developer.dailymotion.com/tools#/user/videos/list using these parameters as en example:

id=x1g65ms
fields='created_time,'

and with

created_after=1423578052 --> returns videos with created_time 1423578051
created_after=1423578059 --> returns videos with created_time 1423578051
created_after=1423578060 --> doesn't return video

Is there something I don't understand? Am I doing these tests right?

Thanks.


Solution

  • You're right, there may be a few seconds difference, but it will always be less than a minute. Indeed, the created_* filters are rounding dates on purpose to the minute (the aim is to have better performances). This behavior shouldn't be an issue more most of the use-cases.