matomo-org / matomo

Empowering People Ethically with the leading open source alternative to Google Analytics that gives you full control over your data. Matomo lets you easily collect data from websites & apps and visualise this data and extract insights. Privacy is built-in. Liberating Web Analytics. Star us on Github? +1. And we love Pull Requests!
https://matomo.org/
GNU General Public License v3.0
19.83k stars 2.64k forks source link

Access freshness of report via the API #21962

Open asprouse5 opened 8 months ago

asprouse5 commented 8 months ago

Summary

We need to access the freshness of a report, which seems available in the UI but not in the API. I thought this API would return that data:

https://demo.matomo.cloud/index.php?module=API&format=JSON&idSite=1&period=day&date=today&method=API.getProcessedReport&apiModule=DevicesDetection&apiAction=getBrowsers&expanded=1&token_auth=anonymous

but no luck. Is there another API we should be looking at? Our workaround is using the above API to get the totals, then accessing the UI separately (below) and looking at the span element with class helpDate (not the greatest)

https://demo.matomo.cloud/?module=DevicesDetection&action=getBrowsers&idSite=1&period=day&date=today

We need the text like "Report generated 4 min 56s ago".

Your Environment

michalkleiner commented 8 months ago

Hi @asprouse5, thank you for the suggestion, that could indeed be helpful to have in the reports (where possible). I'll pass this on to the product team for consideration and prioritisation.