MediaAnalytics: How to get the media detail of a video by export feature

(Y Tanaka) #1


I have been using Matomo x Media Analytics plugin to use media insights. I want to integrate the Media details information which are “Time spent watching” with bar chart into our service.

Here is an detail article including the time spend watching info.

So is there any ways to get the data or bar chart from API as export feature?
I try to find the docs, but I still didn’t find yet.


(Jason) #2


Yes, you can use ImageGraph Metadata: API Reference - Matomo Analytics (formerly Piwik Analytics) - Developer Docs - v3

Along with the Media Analytics module Reporting API Reference: API Reference - Matomo Analytics (formerly Piwik Analytics) - Developer Docs - v3 specifying the sum_total_time_watched column.

An example could be:

(Y Tanaka) #3


Thanks for your response.

Sorry for the lack of information.

Actually, we would like to use the MediaAnalytics plugin to generate a chart that displays the number of users who left the video at time=n seconds. I think we need to use the media_spent_time segment in order to do that.

We would like to get data from the API to generate a graph similar to the ‘Time spent watching’ graph created by this url:,2018-10-09&category=MediaAnalytics_Media&subcategory=MediaAnalytics_TypeVideo&popover=RowAction$3AMediaDetails$3AgetVideoTitles$3A66$3A$257B$257D

We need to generate charts in our CMS by getting data from the API.

We need accurate data and if possible we would like to avoid to use time ranges like segment=media_spent_time>0;media_spent_time<7

Currently, we use this command, but we would like to reduce the number of calls to the API.
At time = 35 seconds, X users left the video:

curl -X GET "\
token_auth=xyz" -v | python -m json.tool

As our videos are about 10 minutes long, we can’t call the API 600 times…

Any help would be highly appreciated.


(Jason) #4

Can you confirm the type of graph you would like is similar to below?

(Y Tanaka) #5


Thanks for your response.

Yes, the graph is what we want to get.
Furthermore we would like to get the data from API.


(Y Tanaka) #6


Is there any way to get the each range of data from API for the chart?


(Jason) #7

Hi Sorry for the delay,

You would use the following request to get a similar chart:

where idSubtable needs to be set to the correct id that matches a specific video.

Is there any way to get the each range of data from API for the chart?

Do you mean for each second?

(Y Tanaka) #8

Hi Jason,

Sorry for the delay response.

The API url you gave me was I was looking for. It worked fine on our environment. It will be able to customize our chart using it.

Thanks so much.