The Movie Database Support

Hello,

I am having troubles with the x-ratelimit-reset header. Based on this post (https://www.themoviedb.org/talk/5317af69c3a3685c4a0003b1), I understood that this header corresponds to the epoch timestamps when the counter is reset. The problem I have is when I compare it with a "current" timestamp after a request, I get a number of seconds greater than 10 (15-16s most of the time). So I thought you had changed the timeframe, but when I looked at the date header sent back by your server, I found it was actually in the "future" compared with a timestamp on my machine.

I checked my machine against this source (http://www.epochconverter.com/) and I'm pretty much on time. However, your server seems to be rushing by 8-10 seconds. Consequently, there's no way for me to know when I will really be able to make new requests. It might be a good idea to send the number of seconds (or milliseconds) remaining before we can make new requests; so that you don't care at all if the server's on time.

What do you think ?

Other than that, awesome work, this API is great !

1 reply (on page 1 of 1)

Jump to last post

Hi WaldoJeffers,

You should be able to keep track of the reset by storing the time of the first request you make (or once the counter has been reset). With that initial time you can calculate the offset in relation to the time we return by the Date header. Since we reset the counter every 10 seconds (or simply at the time specified by X-RateLimit-Reset you can accurately gauge when the next reset will be local to whatever time your client is returning.

For what it's worth, I just tested the time our servers are reporting and they are within 1 second (less than) of what epochconverter.com is reporting.

Can't find a movie or TV show? Login to create it.

Global

s focus the search bar
p open profile menu
esc close an open window
? open keyboard shortcut window

On media pages

b go back (or to parent when applicable)
e go to edit page

On TV season pages

(right arrow) go to next season
(left arrow) go to previous season

On TV episode pages

(right arrow) go to next episode
(left arrow) go to previous episode

On all image pages

a open add image window

On all edit pages

t open translation selector
ctrl+ s submit form

On discussion pages

n create new discussion
w toggle watching status
p toggle public/private
c toggle close/open
a open activity
r reply to discussion
l go to last reply
ctrl+ enter submit your message
(right arrow) next page
(left arrow) previous page

Settings

Want to rate or add this item to a list?

hyrje