Page 1 of 1

API search issues

Posted: Sat Sep 30, 2023 1:40 pm
by natsunasubi
Hi, Thank you for your constant support. I am using the old API(https://rest.opensubtitles.org/search/) and am considering migrating to the new API, but there seem to be some problems with the search functionality of the new API.

1.For example, keywords with less than 3 characters, such as "saw", will result in a 400 error.
https://api.opensubtitles.com/api/v1/subtitles?languages=en&query=saw
2. For example, if you search for "titanic", you will get a lot of hits for "titan".
https://api.opensubtitles.com/api/v1/subtitles?languages=en&query=titanic

These behaviors feel a little unnatural because they are different from the old API and the web search function of opensubtitles.com.
If you have any solutions, I would appreciate it if you could let me know.

Re: API search issues

Posted: Sat Oct 07, 2023 7:24 am
by os_dev
Hi, Thank you for your constant support. I am using the old API(https://rest.opensubtitles.org/search/) and am considering migrating to the new API, but there seem to be some problems with the search functionality of the new API.

1.For example, keywords with less than 3 characters, such as "saw", will result in a 400 error.
https://api.opensubtitles.com/api/v1/su ... &query=saw
2. For example, if you search for "titanic", you will get a lot of hits for "titan".
https://api.opensubtitles.com/api/v1/su ... ry=titanic

These behaviors feel a little unnatural because they are different from the old API and the web search function of opensubtitles.com.
If you have any solutions, I would appreciate it if you could let me know.
the idea is to use the /features endpoint to gather the ID needed for the search. querying with 3 characters just won't work.

for the second example, this is just one use case, we have worked over thousands of cases to establish the best compromises.

but I've added a feature for you to try, you can send the parameter "title_match", and only exact matching titles will be returned (so, no "titan" with your titanic)

Re: API search issues

Posted: Sat Oct 07, 2023 2:33 pm
by natsunasubi
Thank you very much for your reply and response.

You're right, Titanic seems to be a special case. The reason why there are so many movies that don't even include "Titan" seems to be because the "release" item contains strings such as "AC3.TiTAN".

Also, will the new API match synonyms?
For example, if you search for "Accused", you will find many subtitles that do not even have "ac-" in the data string, and the actual movie "The Accused" will be found in the 14th place. I'm just guessing, but words like "charge", "plea" and "condemned" seem to be hits.

I tried "title_match", but it seems to only do exact matches. For example, instead of "spy family" I had to search for "spy x family".
Is it possible to limit the target to only "title" without using an exact match and without using a synonym search?

Sorry to be so selfish, but I would be happy if it were possible.