YouTube videos stats using Google API YouTube Analytics in one request

263 views Asked by At

Is it possible to get daily video stats for X videos at once?

YT Analytics API does stats only for a channel. Of course I can filter results by video ID (but only one!). I'm getting an error while trying to put "video=1;video=2;video=3" in filter method.

1

There are 1 answers

0
paolo On BEST ANSWER

From the documentation of the reports.query endpoint of the YouTube Analytics API, assuming this is the endpoint you are referring to:

The API supports the ability to specify multiple values for the video, playlist, and channel filters. To do so, specify a separated list of the video, playlist, or channel IDs for which the API response should be filtered. For example, a filters parameter value of video==pd1FJh59zxQ,Zhawgd0REhA;country==IT restricts the result set to include data for the given videos in Italy. The parameter value can specify up to 200 IDs.

In other words: only use commas between video IDs (not semicolons), don't repeat the video keyword for each ID and use == instead of =.