Im writing an application that uses Piwik data via the API and needs to query for data in a tabular fashion - visitors for each day for each label, to generate a table like this:
| | 2016-11-20 | 2016-11-21 | 2016-11-22 |
| foo | 300 | 400 | 123 |
| bar | 452 | 114 | 112 |
So far, my naive approach is to do an API request for each label like this:
However, the requests take a long time, since each label is queried with its own HTTP request and a have potentially hundreds of labels.
I’ve looked into using the label
parameter as an array (&label[]=foo&label[]=bar
) or doing bulk URLs, but both seem clumsy to me. Is there a better way to get the data?