I was wondering if there was a way to filter the results endpoints give back. For example a way to talk to the /shows endpoint and say we only want the show ids?
Thanks!
I was wondering if there was a way to filter the results endpoints give back. For example a way to talk to the /shows endpoint and say we only want the show ids?
Thanks!
No, you can't request less than the default.
I'm not part of TVMaze (so this isn't official), but if you provide some insight into why you'd want/require it then they might consider it.
How is it that you are interacting with the endpoints? This can be accomplished really easily using my Python interface to the API:
>>> import pytvmaze
>>> shows = pytvmaze.get_show_list('utopia')
>>> ids = [show.maze_id for show in shows]
>>> ids
[64, 3300, 153, 15569, 18752, 18917, 5421, 16136, 17958, 21018]
It occurs to me that you may have meant the full show index, not a show search. If this is the case, just replace line 2 with:
>>> shows = pytvmaze.show_index()
Note that this only gets page 1 of the full list of shows. You can get different pages by doing:
>>> shows = pytvmaze.show_index(page=2)
You can find the code here if you want to look deeper :) https://github.com/srob650/pytvmaze
This isn't possible on the API level, though you can always do so on the client side like srob650 suggested.
But for the specific usecase of retrieving all the available show ID's, you could check out the updates endpoint.
I figured out what i needed with /update/shows. In general, it'd be great way to save some bandwidth if I know my code is only going to use certain field and ignores others.
See http://www.tvmaze.com/threads/1115/list-of-popular-shows#17904 for some background as well. The issue is that while it saves bandwidth on the client end, it's immensely more expensive on our end since we can't re-use the already cached data.