Problem with Piwik API (Unique Visitors)

Hi,

i’ve played around for a while and had already read the API reference but i could not find any solution for my API Problem. I hope somebody of you can help me. :slight_smile:

I need some help with an API request to get all unique visitors for each URL string with one(!) HTTP request for the current day. So far i’m doing it so that i send an HTTP request to the API for each URL substring (@) to get the unique visitors for this URL. Although the method works but it takes too long once i would do many requests for several different URLs. My API request looks at the moment like this:


piwikurl.blub/?module=API&token_auth=bla&method=VisitsSummary.getUniqueVisitors&idSite=bla&period=day&segment=pageUrl=@[part of url that i'm searching for]&date=today&format=XML

With this request i get the unique visitors for each URL as an XML (which takes around 0,37 seconds per request). But if i run that on a loop for e.g 10000 URLs my script takes too long because i must do one API request for each URL. I’ve read in the API reference something about an bulk request but if i have understood it correctly i have to send each url in a array with the api request.

Is it not possible that i get the URLs of each page and there unique visitors for the current day with one api request without sending all these URL substings?

I hope somebody can help me because i am now desperate already on… :slight_smile:

Has nobody a suggestion how i could do that? :frowning: :frowning:

use the API Actions.getPageUrls to get all Page URLs