Use Live.getLastVisitsDetails to export all data for one site


I´m trying to use the API method Live.getLastVisitsDetails to export all raw data of a site like stated in

Unfortunately, when I use filter_limit=-1 or another very high number to get all results there is no export generated. Can you tell me how I can fix this problem?


Is this behavior on past data and/or on a period including today?
How do you archive data?
Archiving process is used to compile data used by reports:

Do you see some error in the Matomo log (eg. timeout, etc.)?

Hey Philippe,

Thanks for our reply. I activated the log and checked them, the issue is that PHP does not have enough RAM to export the data. I increased the php memory limit dramatically to 1GB and then to 8GB but that is still not enough. I guess this is something that can not be fixed so I need to allocate alot of more RAM to the VM and increase the limit further?

This is with 1GB
{“result”:“error”,“message”:“Allowed memory size of 1073741824 bytes exhausted (tried to allocate 8192 bytes)”}%

With 8GB I can see that the RAM in the VM is fastly allocated and then it gives a 502 bad gateway for the api call. Probably also the database needs more RAM.


Have a look at:

I increased the resources of the server dramatically to 80GB RAM and adapted all parameters for the export to work. like php limits, database parameters, nginx settings and limits ect. but still there is no luck, now the export is running for a long time, one with almost 6 hours over night and then crashed with a 502 bad gateway. Sometimes they also crash with other errors like 504.

It is probably a fact that this API is not capable of exporting a big load of data, right? I think this is simply not going to work or is there anything we can do?

@innocraft, do you have a clue?

Hi @mmh1 ,

When you have more than 10K visits, it is better to export in batches by setting up the offset appropriately. Please review