Help using analytics.query

I am really struggling and getting nowhere. I also could not find information in the documentation to achive my goal. I try to use the analytics.query endpoint to retrieve:

  • metrics: count of plays, sum of time viewed
  • by dimensions: viewer id, date , media id
  • filters: channel id , start date, end date.

Would anyone have the JSON body for this ?

Hello @bdarbonneau,

analytics.query() is deprecated. Please use the report service.
See this step by step tutorial:
For general documentation about the service, see:


Thanks for the reply. I also tried the report service, with some success. However, as explained inthis thread, I cannot find a way to get the user engagemement grouped by date. The user_engagement report (11) includes neither the date nor the media id fields. And the the user_engagement_timeline (34) does not have the userid.

My current workaround is to run the user_engagement report for each day and media id, which creates a very large number of calls. Is not there a better way ?

Hi @bdarbonneau,

Since our analytics dashboard is FOSS (licensed under AGPLv3) and makes use of the exact same APIs to display the stats, I think the best approach would be for you to review its code here:

It’s written in JS (using Angular) but of course, you can make the same API requests using any of our client libraries.

Hi Jess,
I would appreciate that you point me to the code page that is relevant to my question. Without such information, you are just sending me into a maze.