Help with Matomo/Piwik API


(Vindieselwal) #1

Hello out there :slight_smile: I would be very pleased Sarkari Result if someone could help me with the Matomo/Piwik API. I want to display the Actions->Pages Pnr Status Tree as JSON or XML, but I don’t have a clue how to accomplish that.


(Lukas Winkler) #2

Hi,

There are two very easy ways to find out how to accomplish this:

Go to Actions->Pages Tree and press the :export: button. You can then click on Show Export URL and it will show you the API call to get exactly this data:
https://matomo.example/index.php?date=today&expanded=1&filter_limit=100&format=JSON&idSite=1&method=Actions.getPageUrls&module=API&period=month&token_auth=THE_SECRET_TOKEN

Or you could take a look at Reporting API Reference: API Reference - Matomo Analytics (formerly Piwik Analytics) - Developer Docs - v3 and look for the Actions.getPageUrls API.