Using GET /tv/{tv_id}/watch/providers, I can get ALL the watch providers for the provided show.
Using GET /watch/providers/tv, I can get all the watch providers for a given region by adding the watch_region
query parameter with the 2-letter region I want.
However, it seems that the watch_region
query parameter does nothing when used with the more specific GET /tv/{tv_id}/watch/providers
request.
What method can I use to get only the watch providers for a specific region for a given tv_id
?
فیلم و نمایش تلویزیونی را نمیتوانید پیدا کنید؟ به سیستم وارد شوید تا آن را ایجاد کنید.
آیا میخواهید به این مورد امتیاز دهید یا به فهرست اضافه کنید؟
عضو نیستید؟
پاسخ توسط ticao2 🇧🇷 pt-BR
در تاریخ آوریل 18, 2023 ساعت 8:45 ق.ض
In your first example
https://developers.themoviedb.org/3/tv/get-tv-watch-providers
you receive all but separated by country or region.
پاسخ توسط Travis Bell
در تاریخ آوریل 18, 2023 ساعت 11:24 ق.ض
To be extra specific around the details of the
/watch/providers
request, notice the response. Theresults
object is keyed by country.پاسخ توسط leanne63
در تاریخ آوریل 18, 2023 ساعت 4:49 ب.ض
Yes, @travisbell and @ticao2 - I did notice that the results are broken out by country, and that is what I'm using now. I wanted to check in to see if I could get specific up front.
Thanks for your timely and thorough responses!
پاسخ توسط snowtauren
در تاریخ اکتبر 17, 2023 ساعت 3:00 ب.ض
I have the same use case as the OP. I don't think is answered yet for example I want watch providers in USA ONLY for the movie gladiator... How do I go about that, the response as is contains too much information from all countries.
پاسخ توسط ticao2 🇧🇷 pt-BR
در تاریخ اکتبر 17, 2023 ساعت 4:46 ب.ض
I don't think we can be clear.
You receive the complete list with all the countries where the film is available and the different distribution methods (rental, purchase, etc...).
But the list is separated by country.
Then look at the end of the list for "US".
There you will find where and in what form the film is available in the "US", that is, in the United States.
Therefore, it is you, on your side, who must filter the country and the method of distribution.
پاسخ توسط Mark Stepan
در تاریخ فوریه 4, 2024 ساعت 1:20 ب.ض
From reading the prior posts, I believe I have the answer to a question that was in my mind relative to retrieving Watch Providers.
Let me just add my $.05 worth. (With a 3-cent tip! haha)
I'm using Excel (VBA) to make the calls to the API. In order to maximize efficiency (and decrease some of the network traffic), using the "append_to_response" is a very useful tool (love it! thanks!). Unfortunately, I think the Watch Provider data is actually going to have a side-effect ... That is, I think I'm going to go over the size of a cell! 32,767 characters is quite a few, but with these types of lists ("release_dates" is similar), I'm going to be over the limit. Of course there are things I can (and will) do on my end, but the point I'm trying to make is that having the ability to pass filtering information to any/all API calls (similar to how "append_to_response" can be appended to many or maybe all) might have a multi-fold effect: Fewer calls, smaller datasets, etc (which of course makes everything more efficient, even if only marginally). It's tough to estimate, but I'd think at least 75% of the data returned by "watch_providers" and "release_dates" I ignore completely. I'm also aware that I don't need to STORE the response, but I do and it's actually come in handy at times (and eliminated the need to re-call the API), so for now for sure I'd like to continue keeping it.
So the net effect here is that I guess I'd respectfully ask you to consider doing something similar to "append_to_response" in order to enable a little more targeted response. While my personal situation is mainly focused on the Movie Details API, it would also be useful in several others (TV, Search, Discover, etc).
Thanks!!!
Mark
پاسخ توسط Mark Stepan
در تاریخ فوریه 5, 2024 ساعت 9:17 ق.ض
Sorry, one more thing ... Related to the Watch Providers ... I'm struggling to parse the JSON. 2 of the tools I use (a VBA JSONConverter I found on the internet and also NotePad++) are acting like it's not properly formatted. When I look a little closer, I'm not sure it is. Specifically:
Post: https://api.themoviedb.org/3/tv/63726/watch/providers?api_key={MyAPIKey}
Response: {"id":63726,"results":{"AD":{"link":"https://www.themoviedb.org/tv/63726-alone/watch?locale=AD","flatrate":[{"logo_path":"/pbpMk2JmcoNnQwx5JGpXngfoWtp.jpg","provider_id":8,"provider_name":"Netflix","display_priority":0}]},"AG":{"link":"https://www.themoviedb.org/tv/63726-alone/watch?locale=AG","flatrate":[{"logo_path":"/pbpMk2JmcoNnQwx5JGpXngfoWtp.jpg","provider_id":8,"provider_name":"Netflix","display_priority":0}]},"AR": ...
Shouldn't the character right after "results": above in the response be a SQUARE bracket? I think it maybe is supposed to be IN ADDITION to the brace. In every other response I've looked at (several with a "results" key), when multiple values are returned, they are surrounded by SQUARE brackets and comma-separated. For example, this reply: { "page": 1, "results": [{"adult": false,"backdrop_path": "/anYzA7qDyx3yXEK4mEIbSVAL4Vp.jpg","genre_ids": [99,10768],"id": 153966,"origin_country": ["GB" ...
When I put the URL above into a browser, it works and returns the same raw data and the browser IS able to parse the JSON, but when I copy/paste that JSON into NotePad++ and specify Language=JSON, it doesn't organize it correctly (but does for all the other JSON I've used there).
I believe this site (which may or may not be reliable of course) seems to support my claim: https://www.freecodecamp.org/news/what-is-json-a-json-file-example/#:~:text=Valid%20JSON%20data%20can%20be,brackets%20%5B...%5D%20.
And this tool barks as well: https://jsonlint.com/
Thanks in advance for your thoughts/comments on the matter ...
Mark
P.S. Edit: I made the following changes to (I believe) follow the JSON formatting rules more strictly (properly?). As a result, the JSONLint tool was happy:
Before/beginning:
{"id":63726,"results":{"AD":{"link":"https://www.themoviedb.org/tv/63726-alone/watch?locale=AD","flatrate":[{"logo_path":"/pbpMk2JmcoNnQwx5JGpXngfoWtp.jpg","provider_id":8,"provider_name":"Netflix","display_priority":0}]},"AG":
Before/middle:
:0}]},"AG":
Before/ending:
,"ZA":{"link":"https://www.themoviedb.org/tv/63726-alone/watch?locale=ZA","flatrate":[{"logo_path":"/pbpMk2JmcoNnQwx5JGpXngfoWtp.jpg","provider_id":8,"provider_name":"Netflix","display_priority":0}]}}}
After/beginning:
{"id":63726,"results":[{"AD":{"link":"https://www.themoviedb.org/tv/63726-alone/watch?locale=AD","flatrate":[{"logo_path":"/pbpMk2JmcoNnQwx5JGpXngfoWtp.jpg","provider_id":8,"provider_name":"Netflix","display_priority":0}]}},{"AG":
After/middle:
:0}]}},{"AG":
After/ending:
{"VE":{"link":"https://www.themoviedb.org/tv/63726-alone/watch?locale=VE","flatrate":[{"logo_path":"/pbpMk2JmcoNnQwx5JGpXngfoWtp.jpg","provider_id":8,"provider_name":"Netflix","display_priority":0}]}},{"ZA":{"link":"https://www.themoviedb.org/tv/63726-alone/watch?locale=ZA","flatrate":[{"logo_path":"/pbpMk2JmcoNnQwx5JGpXngfoWtp.jpg","provider_id":8,"provider_name":"Netflix","display_priority":0}]}]}
پاسخ توسط Travis Bell
در تاریخ فوریه 5, 2024 ساعت 11:00 ق.ض
The
results
object here is not an array, it's an object. See here for more details. Objects are a perfectly valid JSON data type.پاسخ توسط Mark Stepan
در تاریخ فوریه 6, 2024 ساعت 2:08 ب.ض
Thanks Travis, I think! hahaha Just kidding, thanks. I spent a lot of years doing development, but this stuff is rather new. I only encountered JSON toward the end of my working years. Once I got the JSONConverter working, I never really had any issues (whew! thankfully!), so this twist sorta threw me off, but I think I have a way to make sense of it now (without too much craziness!). Thanks again! Have a good week. Mark