Run Large Reports

Reports have a maximum length of 100,000 rows in the AdSense Host API, by default. If you’re running close to these limits, or running into performance issues while processing the data, here are some tips that may help.

Reducing the scale of your report

The first thing to look for when trying to make a report smaller is the list of dimensions you’re using; each dimension you add has a multiplicative effect on the number of returned rows. Make sure you only add the dimensions you need!

Splitting your reports

Sometimes, you only need extremely accurate data for a portion of the report, with the rest allowing for less detail. For example, you could need extremely accurate details for the previous month’s earnings, with stats per country and channel across every day, but only really need the country-level data when looking before that. You could therefore run a complex report for the previous month, but a simpler one for the time before that.

Avoid JSON parsing by switching to CSV

The AdSense Host API allows you to receive your reports in CSV format, rather than the usual JSON. To do that, simply add the alt parameter to your request, setting it to "CSV".



Limit break

There’s actually a way of getting beyond the limit of 100,000 rows if your report absolutely needs to have all that data. You can add the alt parameter to your request, setting it to "media". This allows you to get approximately 1 million rows. That's an approximate limit because the reporting server can go up to 2 million rows in certain conditions.

The results will come back as a gzipped CSV which, after decompression, is identical to the one in the previous section.

Next steps