The Movie Database Support Forum

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?

9 Antworten (Seite 1 von 1)

Jump to last post

@leanne63 said:

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?

In your first example
https://developers.themoviedb.org/3/tv/get-tv-watch-providers
you receive all but separated by country or region.

https://api.themoviedb.org/3/tv/4614/watch/providers?api_key=THE_KEY

id  4614
results 
AD  
link    "https://www.themoviedb.org/tv/4614-ncis/watch?locale=AD"
flatrate    
0   
logo_path   "/iieEQVJIEOSfDj477zG8sSTtr25.jpg"
provider_id 1773
provider_name   "SkyShowtime"
display_priority    27
AE  
link    "https://www.themoviedb.org/tv/4614-ncis/watch?locale=AE"
flatrate    
0   {…}
AL  
link    "https://www.themoviedb.org/tv/4614-ncis/watch?locale=AL"
flatrate    
0   {…}
AR  
link    "https://www.themoviedb.org/tv/4614-ncis/watch?locale=AR"
flatrate    
0   {…}
AT  
link    "https://www.themoviedb.org/tv/4614-ncis/watch?locale=AT"
buy 
0   {…}
flatrate    
0   {…}
1   {…}
2   {…}
3   {…}
4   {…}
5   {…}
AU  
link    "https://www.themoviedb.org/tv/4614-ncis/watch?locale=AU"
buy 
0   {…}
flatrate    
0   {…}
1   {…}
2   {…}
3   {…}
BA  
link    "https://www.themoviedb.org/tv/4614-ncis/watch?locale=BA"
flatrate    
0   {…}
BE  
...

To be extra specific around the details of the /watch/providers request, notice the response. The results object is keyed by country.

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!

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.

@snowtauren said:
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.

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.

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

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:

  • Added SQUARE brackets to surround the entire "results" key.
  • Made sure each of the regions was entirely within CURLY BRACES. The FIRST one already had the BEGINNING brace and the LAST one already had the CLOSING brace. Added them to all the inside ones.
  • The beginning and ending of the JSON:

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}]}]}

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.

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

Es fehlt ein Film oder eine Serie? Logge dich ein zum Ergänzen.

Allgemein

s Fokus auf Suchfeld
p Profil öffnen
esc Fenster schließen
? Tastenkürzel anzeigen

Videos

b Zurück
e Bearbeiten

Staffeln

Nächste Staffel
Vorherige Staffel

Episoden

Nächste Episode
Vorherige Episode

Bilder

a Poster oder Hintergrundbild hinzufügen

Editieren

t Sprachauswahl öffnen
ctrl+ s Speichern

Diskussionen

n Neue Diskussion erstellen
w Beobachten an / aus
p Diskussion öffentlich / privat
c Diskussion öffnen / schließen
a Diskussionsverlauf anzeigen
r Auf Diskussion antworten
l Letzte Antwort anzeigen
ctrl+ enter Senden
Nächste Seite
Vorherige Seite

Einstellungen

Diesen Eintrag bewerten oder zu einer Liste hinzufügen?

Anmelden