Media.list error while retrieving a LOT of items

I am in the process of migrating Kaltura data to another platform, however whenever I try to get all the media items by running a media.list API command, iterating through all the available pages, once I reach a specific page (itemsPerPage 500, page 34) the totalCount integer suddenly decreases to 10.000 (on previous pages it was 90k approx).

Also, if I try to request page 35, it gives me a QUERY_EXCEEDED_MAX_MATCHES_ALLOWED error.

Is there an alternative way to retrieve ALL account items or am I doing something wrong?

Best,
Giampaolo

Hi @gfalqui,

You can simply use:

It will output everything in XLS format. If you need to change the way the output is formatted, you can adjust the code accordingly but it’s certainly a decent starting point.

Thank you for the exporting tool, it has been quite helpful reading how you do things, however what’s the solution to this specific API issue, though?

Because we’ve internally built an exporter already, but we’re knocking our head against that message. Is there a solution to it?

I’ve solved the issue by using the createdAtLessThanOrEqual filter with CREATED_AT_DESC order.

Yes, that’s how you should do it and how the code I referred you to does it.