The Movie Database qoldaýy

Hi, I've created a front-end application that directly consumes the TMDB api.

In this application, I have an array of strings that correspond to a simple list of movie names.

So I wanted to make a for loop via this array, to retrieve the data from this url https://api.themoviedb.org/3/search/tv?query=${query}

I got this error: “Too many requests”. (Makes sense...)

I'd like to know how I can go about avoiding this, as I haven't found a solution in the document.

4 jaýap (1 ishinen 1 betinde)

Jump to last post

may be the request too fast so that cause the error,you can use 'setTimeout' function to delay these request

@Maxime145 said:
Too many requests
Hi, I've created a front-end application that directly consumes the TMDB api.
In this application, I have an array of strings that correspond to a simple list of movie names.
So I wanted to make a for loop via this array, to retrieve the data from this url
https://api.themoviedb.org/3/search/tv?query=${query}
I got this error: “Too many requests”. (Makes sense...)
I'd like to know how I can go about avoiding this, as I haven't found a solution in the document.

Perhaps the following will help resolve your issue.

API Request Limits
First we have this information in the instructions for using the TMDb API.
https://developer.themoviedb.org/docs/rate-limiting

And Travis Bell, the Administrator, has already given us this explanation.

For API Requests:

One of our CDN providers enforces some base level rate limiting to help prevent DDOS attacks.
I believe it's a maximum of:
50 requests per second and
20 connections per IP.

See here: https://www.themoviedb.org/talk/62c7c1b258361b005fd2e747?page=1#62c83b78befd91005007a0c7

For Images:

For image.tmdb.org the only thing we limit is the max number of simultaneous connections.
The limit is the same, 20.

See here:
https://www.themoviedb.org/talk/62edd3ca46aed400917de201#62ee88e7176a940086449cdf
https://www.themoviedb.org/talk/62c7c1b258361b005fd2e747?page=1#6301a107097c49007f60374a
https://www.themoviedb.org/talk/62c7c1b258361b005fd2e747

And...
Is there really no API Rate Limiting?

The original rate limiting (40 requests every 10 seconds) has indeed been been disabled since December 2019.
There are some higher overall limits that still exists to help mitigate different attacks and the like.
I believe they sit around the 50 request per second range.

See here:
https://www.themoviedb.org/talk/6442ced4d35dea02fcfb0fab#6442d4a0d35dea0455fb1a07

In this link I believe you can see your volume of API Requests.
https://www.themoviedb.org/session

@ticao2 that request count is only for the website, it doesn't relate to the API in any way.

@noodlecat The easiest way to help with your issue is it to introduce a small delay in between every requests so that you are issuing more than ~40 per second. There are fancier designs where you can keep track of the number of requests in a second, and then limit the number you execute within a threshold of sorts. It's really up to you how you want to implement this.

Thanks for your answers !

The “delay” solution doesn't work for me because it's impractical to deal with single-call errors. What's more, I get around 120 calls every time I refresh my page.

I ended up making a back application with rudimentary cache management. And on the front-end, I simply send the names to be retrieved. This reduces the number of calls to the TMDB API.

Fılmdi nemese kórsetimdi taba almadyńyz ba? Ony jasaý úshin kirińiz.

Ǵalamdyq

s kezelimdi izdeý jolaǵyna aýystyrý
p profaıl mázirin ashý
esc ashyq terezeni jabý
? perneler tirkesimi terezesin ashý

Tasyǵyshtar betterinde

b artqa oralý (nemese qoldanylatyn bolsa, tektikke)
e óńdeý betine ótý

Telemaýsym betterinde

(oń jaq kórsetki) kelesi telemaýsymǵa ótý
(sol jaq kórsetki) aldyńǵy telemaýsymǵa ótý

Epizod betterinde

(oń jaq kórsetki) kelesi epızodqa ótý
(sol jaq kórsetki) aldyńǵy epızodqa ótý

Barlyq keskin betterinde

a keskin ústeý terezesin ashý

Barlyq óńdeý betterinde

t tárjime tańdaǵyshyn ashý
ctrl+ s pishindi jiberý

Talqylaý betterinde

n jańa talqylaýdy jasaý
w qaralǵan kúıin aýystyrý
p jalpy/jekeni aýystyrý
c jabý/ashýdy aýystyrý
a áreketterdi ashý
r talqylaýǵa jaýap berý
l sońǵy jaýapqa ótý
ctrl+ enter habaryńyzdy jiberý
(oń jaq kórsetki) kelesi betke
(sol jaq kórsetki) aldyńǵy betke

Parametrler

Want to rate or add this item to a list?

Kirý