پشتیبانی پایگاه داده‌ فیلم

Hello. The main purpose I'm using the TMDB API for is to normalize the titles and years of a list of movies. The list came from a Google Form, so users can type the titles however they want, in any language they choose (mainly English, Portuguese, and the original language of the film). My plan is to search for the movie using the TMDB API, get the first result, and save the title and year from TMDB to facilitate data analysis.

I was trying to search for Lucky Star, 1929, and this query works fine: https://api.themoviedb.org/3/search/movie?query=Lucky+Star&primary_release_year=1929 It returns the data for this movie: https://www.themoviedb.org/movie/105981-lucky-star

But if my user doesn't type the year of the movie: https://api.themoviedb.org/3/search/movie?query=Lucky+Star It returns data for this series: https://www.themoviedb.org/tv/42500-lucky-star

I find this very strange since I'm querying in the movie section.

I tried the same thing on the user website. Typing "Lucky Star" results in the following query: https://www.themoviedb.org/search?query=Lucky+Star And the top result is this: https://www.themoviedb.org/tv/42500-lucky-star

Which is fine, because it's a search of the entire database, not just movies. But when I search specifically for movies:

https://www.themoviedb.org/search/movie?query=Lucky%20Star It results in the movie I really want to find as the top result: https://www.themoviedb.org/movie/105981-lucky-star

Am I doing something wrong that causes me to get the wrong result when the year is not included?

I'm also having problems with the language section. Is there any way I can try to find movies in any language, just like the website does? Or maybe to include more them one language?

It would also be interesting if I could restrict the results by decades.

6 پاسخ (در صفحه 1 از 1)

Jump to last post

@joaopabdala said:

But if my user doesn't type the year of the movie: https://api.themoviedb.org/3/search/movie?query=Lucky+Star It returns data for this series: https://www.themoviedb.org/tv/42500-lucky-star

Are you sure of the query you have sent ? In my case, using that query, I got this movie as the top result : https://www.themoviedb.org/movie/18707

@superboy97 said:

@joaopabdala said:

But if my user doesn't type the year of the movie: https://api.themoviedb.org/3/search/movie?query=Lucky+Star It returns data for this series: https://www.themoviedb.org/tv/42500-lucky-star

Are you sure of the query you have sent ? In my case, using that query, I got this movie as the top result : https://www.themoviedb.org/movie/18707

Yes, I literally copy pasted it from here https://developer.themoviedb.org/reference/search-movie.

It seems to me that Superboy97's guess is what is happening.
Your programming code should be with search/multi and not with search/movie.
Only you can check that.

But it is good to warn you about another problem.
The number of homonymous films is large.
Adding the year of the film reduces the error considerably.

My plan is to search for the movie using the TMDB API, get the first result, and save the title and year from TMDB to facilitate data analysis.

But expecting that without the year the film searched for will be the first on the list is a mistake.
The older or less famous the greater the chance that the film will not be in the first place in the answer.

@superboy97 said:

I got your result if I use https://api.themoviedb.org/3/search/multi instead of https://api.themoviedb.org/3/search/movie

It didn't worked for me. Maybe it's a region filter doing it. I tried to do url = "https://api.themoviedb.org/3/search/movie?query=Lucky%20Star&include_adult=false&language=en-US&page=1" and got https://www.themoviedb.org/movie/18707 (just as you got earlier), but when I useurl = "https://api.themoviedb.org/3/search/movie?query=Lucky%20Star&include_adult=false&language=pt-BR&page=1" I get https://www.themoviedb.org/movie/105981-lucky-star (which is very strange, because Lucky Star is a US movie, but i'm not sure if the top result should appear according to language)

@ticao2 said:

It seems to me that Superboy97's guess is what is happening.
Your programming code should be with search/multi and not with search/movie.
Only you can check that.

But it is good to warn you about another problem.
The number of homonymous films is large.
Adding the year of the film reduces the error considerably.

My plan is to search for the movie using the TMDB API, get the first result, and save the title and year from TMDB to facilitate data analysis.

But expecting that without the year the film searched for will be the first on the list is a mistake.
The older or less famous the greater the chance that the film will not be in the first place in the answer.

I'm actually doing a list for each decade, so maybe I'll try to get all the results and filter to the ones that are between the decades. I think there isn't much more I can do if the user don't add the year. Thanks for the answers you all.

فیلم و نمایش تلویزیونی را نمی‌توانید پیدا کنید؟ به سیستم وارد شوید تا آن را ایجاد کنید.

Global

s تمرکز بر منوی جستجو
p منوی پروفایل باز شود
esc بستن پنجره باز
? پنجره میانبرهای صفحه‌کلید باز شود

در صفحات مدیا

b بازگشت به عقب (یا در صورت لزوم به منشا)
e برو به صفحه ویرایش

در صفحات فصل تلویزیونی

(فلش سمت راست) برو به فصل بعد
(پیکان سمت چپ) برو به نشست قبلی

در صفحات قسمت تلویزیونی

(فلش سمت راست) برو به قسمت بعد
(پیکان سمت چپ) برو به قسمت قبلی

در تمام صفحات تصویر

a پنجره افزودن تصویر باز شود

در تمام صفحات ویرایش

t انتخابگر ترجمه باز شود
ctrl+ s ثبت از

در صفحات بحث

n ایجاد بحث جدید
w تغییر وضعیت وضعیت تماشا
p تغییر وضعیت عمومی/خصوصی
c تغییر وضعیت بسته/باز
a گشایش صفحه فعالیت
r پاسخ به بحث
l برو به آخرین پاسخ
ctrl+ enter پیام خود را ثبت کنید
(فلش سمت راست) صفحه بعد
(پیکان سمت چپ) صفحه قبلی

تنظیمات

آیا می‌خواهید به این مورد امتیاز دهید یا به فهرست اضافه کنید؟

ورود