API VisitsSummary.getVisits of all sites not possible


#1

Hi there,

I want to write an arduino application based on the output of piwik, and I want to use the VisitsSummary.getVisits function from the API to get the total of all visits to all sites in the last 10 days. However the API does not let me do that.

If I change the example url to the following

http://www.domain.com/piwik/index.php?module=API&method=VisitsSummary.getVisits&idSite=all&period=day&date=last10&format=rss&token_auth=BLABLA&translateColumnNames=1

I get an error saying (please note I change the token_auth in the example above)

error on line 1 at column 1: Document is empty

I am using piwik 1.8 and I wonder is there no way of doing this, to get a sum of all visits to all sites during the last 10 days.

Thanks a lot for your answers.


(Matthieu Aubry) #2

To export data for multiple websites, select XML format instead, as we have chosen not to implement RSS for idSite=all or multiple sites. XML or JSON would work well for arduino i think :slight_smile:

I created the ticket to improve error message: Improve RSS format error message · Issue #3173 · matomo-org/matomo · GitHub

Arduino is such a great thing, I’m quite interested in your project, please send a few pictures or even consider posting a howto in this forum: 301 Moved Permanently :slight_smile:


#3

Okey good thanks,

I’ll have to rewrite my parser than, but that’s o.k :slight_smile: Sure once I’ve got the thing working 100% I am going to post a demo/code on howto forum.

It’s basically like this, I have a python script which parses the visists of the last 10 days and calculates a percentage compared to the value today. This gives me a float number which can be from 0% to >100%, depending on that I light up LEDS on my breadboard so for instance for 10% I light up 1/10 LEDS for 20% 2/10LEDS and so on.

It’s not that exciting but I want to have something at home showing me how much traffic I have, and if for some reason I have more traffic than usual.

Cya and thanks for your answer


(Matthieu Aubry) #4

That’s cool, for this feature you should really use the Multisites.getAlll which returns % evolution directly!

It would be cool to put a RED and GREEN LEDs and handle decreasing days :wink:

Also can you please send me an email with a picture of the final LED system? :slight_smile: