The Movie Database Support

Hi everyone, I'd like to get the number total of genres.

For example if I have a request where I'm trying to get every movie from 2022, if would be possible to get total sum of every genre from first to last page to show user how many Tvshows will be at 2022 regarding their genres?

4 replies (on page 1 of 1)

Jump to last post

@jur98 said:
How can I get total genres of tvshows
Hi everyone, I'd like to get the number total of genres.
For example if I have a request where I'm trying to get every movie from 2022,
if would be possible to get total sum of every genre from first to last page to show user how many Tvshows will be at 2022 regarding their genres?

Not with just an API Request.
I believe only using Discover API Request for each of the genres.
For example Comedy, ID 35.

http://www.shbhawani.com/3/discover/tv?api_key=THE_KEY&language=en-US&first_air_date_year=2022&page=1&with_genres=35

Thanks for your answer @ticao2.

Unfortunately that wouldn't my goal. Imagine an scenario where programmer wants to show a kinda menu with total quantity of appearances by each tvshow/movie. Perhaps an example it's easier to understand.

Example
Let's imagine that your previous request will show 90 pages in todo and you want to know how many tvshows are "Sciencie Fiction", "Animation" among other genres in these 90 pages.

Like this: 
Science-fiction 11 tvshows
Adventures 20 tvshows
Action 14 tvshows

Now I just got the quantity of each tvshow by each page,  but not whole sum.

 Page 1                                                             Page 2
Science-fiction **2 tvshows**                        Science-fiction **3 tvshows**
Adventures  **4 tvshows **                             Adventures  **5 tvshows**

Above example is what I get, but I'd like...
Science-fiction  **5 tvshows**
Adventures  **9 tvshows**

The only way I can think of how you would do this is to make hundreds of requests, one for each page of movies or shows, then add up the number of entries for each genre.

If I may ask, what is the use case for doing this? There might be a better way around this.

Hi @Leon, I thought it, cause I have an input who user has to choose a year to see all tvshows. Then I wanted to show whole quantity of genres in severals inputs radio.

Example:

( input radio) Science Fiction (8)
( input radio) Adventures (2) ....

Perhaps it's much better to create a menu with inputs by each genre and save id to shows all tvshows, like this:

Science Fiction <input type="radio" value="ID"> 
http://www.shbhawani.com/3/discover/tv?api_key=THE_KEY&language=en-US&first_air_date_year=YEAR&page=1&with_genres=ID

Can't find a movie or TV show? Login to create it.

Global

s focus the search bar
p open profile menu
esc close an open window
? open keyboard shortcut window

On media pages

b go back (or to parent when applicable)
e go to edit page

On TV season pages

(right arrow) go to next season
(left arrow) go to previous season

On TV episode pages

(right arrow) go to next episode
(left arrow) go to previous episode

On all image pages

a open add image window

On all edit pages

t open translation selector
ctrl+ s submit form

On discussion pages

n create new discussion
w toggle watching status
p toggle public/private
c toggle close/open
a open activity
r reply to discussion
l go to last reply
ctrl+ enter submit your message
(right arrow) next page
(left arrow) previous page

Want to rate or add this item to a list?

Login