How to retrieve collection data in a specific language using Plex's built-in TMDB API?

I’m using a Plex plugin called Themerr-plex, and there’s a step where it need to retrieve TMDB collection IDs. Since Plex itself doesn’t save collection IDs after scraping collections, we have to use the collection name to request collection data from TMDB using Plex’s built-in TMDB API. However, the data returned is in English by default. Because everyone’s collection title language may vary depending on the region, I would like to specify the language when requesting collection data. I’ve tried various request methods, but I can only get English data or no data at all. Does anyone know how to specify the language when using the built-in TMDB API?

If no language is added, the request looks like this: query_url = 'search/collection?query={}'

Here is a complete request example:

http://127.0.0.1:32400/services/tmdb?uri=/search/collection?query=James-Bond-Collection
http://127.0.0.1:32400/services/tmdb?uri=/search/collection?query=%E8%A9%B9%E5%A7%86%E6%96%AF%C2%B7%E9%82%A6%E5%BE%B7%EF%BC%88%E7%B3%BB%E5%88%97%EF%BC%89

Below are the methods I’ve tested for adding language:

search/collection?query={}&language=zh-CN
search/collection?query={}&language=zh
search/collection?query={}&language=CN
search/collection?query={}&language=8
search/collection?query={}&lang=zh-CN
search/collection?query={}&lang=zh
search/collection?query={}&lang=CN
search/collection?query={}&lang=8
search/collection?query={}?lang=zh-CN
search/collection?query={}?lang=zh
search/collection?query={}?lang=CN
search/collection?query={}?lang=8

None of these methods have been successful in retrieving collection data in the specified language. The data returned is either in English or no data is retrieved at all. Does anyone know what should be done in this situation?

The current method being used is precise matching, which requires the user’s collection title to match exactly with the retrieved collection title to obtain the ID. Ignoring this condition might result in matching errors. Therefore, we still prefer to match collections by title, which necessitates having the search language match the data language.

I don’t think we support that, but what you can do, is ask tmdb directly

https://api.themoviedb.org/3/search/collection?query=james-bond-collection&include_adult=false&language=da-DK&page=1&api_key=XXXXXXXX

You’ll need to get an API key from them though

But the Plex Movie agent can fetch collection data in a specified language, can’t this operation be replicated in the plugin?

The actual download is an internal process, and not exposed via API