תמיכת The Movie Database

Hi there,

is there any way to search for a list of movies by name and getting beside their IDs the details as well in one response? I am asking for because I think about the traffic on the server and the limits for the communications which do exist. (40 request per 10secs)

Lets say I'm searching for "Terminator" I get 37 results. Which requires 38 requests to the server to get the information I want. First for getting all IDs and 37 further to get the details each.

Any chance to request all at once?

13 תגובות (בדף 1 מתוך 1)

Jump to last post

Hi SHW,

No, not at this time. Only the primary media methods support it.

Thanks for your response. Nice to hear from the developer of TMDb himself. Regarding my example and assuming it might give equivalent results on other movies as well it means 10 seconds for each movie? Or do you have any optimization hint for me?

No problem.

Can you clarify your question for me? I'm not quite sure I understand.

Sure, as mentioned in my question lets consider the given example:

I'm searching for "Terminator" and get 37 results. This requires 38 requests to the server. The first for getting all IDs and 37 further to get the details of each movie. 38 request (lets round it to 40 which are allowed) means I will have to wait 10 seconds before I can search for the next movie name.

Assuming each of my movie names I am searching for will result in about 40 IDs means each searched movie will take 10 seconds.

Means:

6 movies take 1 minute

60 movies take 10 minutes

360 movies take 1 hour

quite a lot from my point of view... so I hope there is any more fluent way to request 360 movies by name.

Ok, I guess what I am not clear on is what is taking 10 seconds? Our sever responses are sub 100ms so all your left dealing with at that point is network latency and time to handshake/establish the connection. If you use keep alive, that will save an enormous amount of time. There's another thread I posted about some of this, if you were interested.

https://www.themoviedb.org/talk/571bf39f92514135ff0023ca#571ce70892514115e2003143

10 seconds is a server limit for requests. Your API says: We do enforce a small amount of rate limiting. Our current limits are 40 requests every 10 seconds and are limited by IP address

You don't have that quite right.

You can make 40 requests every 10 seconds, or, to just average it out 4/s. So that's 240 requests every minute or 14,400 every hour.

Yes, that is the same :) 14400 requests divided by 40 requests per movie name means 360 movies at all.

Maybe I am not right with an everage of 40 results per movie name... Do you have a statistical amount for me?

Well, there's going to be lots of duplicates across search requests. I'm not sure what you're trying to accomplish exactly. If it's bringing a local cache in house, you'd be better to skip searching and just start at id 1 and iterate up to the last ID found in the /movie/latest method. You can see a live count of the number of movies here. As of me writing this there are 293,387 movies, so you could grab every movie within approx. 21 hours.

Sorry, this is not what I'm driving at. I just have a list of movies on my disc which are named in filename. I want to request those names against your server. However when requesting "Terminator" I get 37 possible IDs. To give me the option of choosing the right details for my file I have to request all 37 details for "Terminator". Although I will only keep one. This is the proceedure for the first movie on my disc. And I assume equivalet workflow for all other files as well.

Therefore I want to know whether 37 results per searched movie name is realistic. I guess you have a statistic about this, haven't you?

In that case, you'd be better to try and name your files with at least a year and then parse it out and use the year parameter. This will drastically reduce the number of results, and in the vast majority of cases will yield the proper result as the first result. This is how most media centres like Kodi or Plex do it.

https://api.themoviedb.org/3/search/movie?api_key=###&query=The+Terminator&year=1984

Only has a single result.

Therefore I want to know whether 37 results per searched movie name is realistic. I guess you have a statistic about this, haven't you?

That is impossible to say, searches like "Batman" have 80 results but a query for Batman in the year 2005 only has 5 results. I wouldn't look at it that way, improve your query and the results will become much more relevant.

Well the year is not present at the moment. I have to rethink the procedure. At the moment I tend to request the first result only and manually request the others when I dicide that the result does not fit. Thanks for you help.

No problem.

.לא מצאת סרט או סדרה? היכנס כדי ליצור אותם

עולמי

s התמקד בשורת החיפוש
p פתח תפריט פרופיל
esc סגור חלון פתוח
? פתח חלון קיצורי דרך של מקלדת

בדפי מדיה

b לך חזרה (או אל הורה אם ישים)
e לך אל דף עריכה

בדפי עונות

(חץ ימני) לך אל העונה הבאה
(חץ שמאלי) לך אל העונה הקודמת

בדפי סדרות

(חץ ימני) לך אל הפרק הבא
(חץ שמאלי) לך אל הפרק הקודם

בכל דפי תמונה

a פתח חלון הוספת תמונה

בכל דפי עריכה

t פתח בוחר תרגום
ctrl+ s הגש טופס

בדפי דיון

n צור דיון חדש
w עורר מעמד צפייה
p עורר ציבורי/פרטי
c עורר סגירה/פתיחה
a פתח פעילות
r השב אל דיון
l לך אל תשובה אחרונה
ctrl+ enter הגש את הודעתך
(חץ ימני) הדף הבא
(חץ שמאלי) הדף הקודם

הגדרות

?רוצה לדרג או להוסיף פריט אל רשימה

היכנס