3

Trying to use the Reports Query API and used the example "Top 10 – YouTube search terms that generate the most traffic for a video":

youtube-analytics-sample

Here is a screenshot of the API Explorer: youtube-analytics-api-explorer

Unfortunately I get the following response: youtube-analytics-api-explorer-error

Are the samples out of date? Am I missing something?

Linda Lawton - DaImTo
  • 106,405
  • 32
  • 180
  • 449
Matthias Posch
  • 537
  • 6
  • 27
  • I know this won't be of much help to you, but from everything I've tried, it only works if `insightTrafficSourceType` is removed from the filter. Looks like there's an issue with the API. The workaround would be to retrieve the data without the filter, and then your code filters the returned response. – vinoaj Feb 22 '18 at 06:50
  • Check the start date you have added. Set it to 2016 or something I think you have hit a date before youtube. If that doesnt work please run the same request here https://developers.google.com/apis-explorer/#p/youtubeAnalytics/v1/youtubeAnalytics.reports.query Let me know how that works. – Linda Lawton - DaImTo Feb 23 '18 at 07:36

1 Answers1

2

You need to set the max-results and sort parameters for this query. Here's an APIs Explorer query that works for me ... I'm using channel==MINE and you have to substitute in your own video ID. (My query has video==VIDEO_ID.) Otherwise, the parameters are the same as in your query, though I'm sure the data doesn't go back as far as Jan. 1, 2000. :)

andyland
  • 114
  • 3