Try 30 days of free premium.

See All Shows

markallencarey wrote 3 years ago: 1

I see the endpoint for all shows @ api.tvmaze.com/shows, but it only displays shows 1-249.  How can we access the next 249? Is there a way to view all shows at once? How can we know how many there are total?=

Thanks for this awesome API and for your help!


gazza911 wrote 3 years ago: 2

Also, no, it's not possible to see how many shows there are via the API.

If doing it synchronously, you should keep on incrementing the page until you get an empty array.

Doing it asynchronously is a little bit more difficult as you can't actually obtain the last show ID; either:

a) You just do a pre-configured amount, but cancel all other requests with a page number above the page number you got the empty array on

b) Go to https://www.tvmaze.com/shows?Show%5Bsort%5D=5, get the last show ID, then do show ID / 250 ignoring the decimal to get the last page number

c) If you really want a fully automated solution, you can get the sitemap - https://www.tvmaze.com/sitemaps/shows.xml then the last element (currently https://www.tvmaze.com/sitemaps/shows2.xml) then the last element for the ID and then show ID / 250 ignoring the decimal (might also be worth doing the page afterwards as the sitemap can be slightly out of date)

markallencarey wrote 3 years ago: 1

@gazza911 wrote:
Also, no, it's not possible to see how many shows there are via the API.

If doing it synchronously, you should keep on incrementing the page until you get an empty array.

Doing it asynchronously is a little bit more difficult as you can't actually obtain the last show ID; either:

a) You just do a pre-configured amount, but cancel all other requests with a page number above the page number you got the empty array on

b) Go to https://www.tvmaze.com/shows?Show%5Bsort%5D=5, get the last show ID, then do show ID / 250 ignoring the decimal to get the last page number

c) If you really want a fully automated solution, you can get the sitemap - https://www.tvmaze.com/sitemaps/shows.xml then the last element (currently https://www.tvmaze.com/sitemaps/shows2.xml) then the last element for the ID and then show ID / 250 ignoring the decimal (might also be worth doing the page afterwards as the sitemap can be slightly out of date)

thank you so much!!

Try 30 days of free premium.