Wednesday, February 1, 2012 | 6:31 AM
When you need to retrieve a large set of objects, such as a list of criteria for an account, it’s tempting to use one simple query with a paging parameter to pull the data from the server page-by-page.
While this approach is acceptable for most queries, it has some limitations:
- The AdWords API does not allow you to retrieve data whose start index is past 50000
- Unit cost for the request will depend on the number of pages and will be relatively expensive
- A parallel update request may interfere with the process
- Error handling and retry logic could be complex
We recommend using one of the following approaches instead:
- Use AdHoc reporting to obtain data. With reports, you can still retrieve most fields available through SOAP requests, with the added bonus of AdHoc reporting being faster and free of unit costs.
- Try to narrow the query as much as possible with predicates. Group queries by Campaign and AdGroup to retrieve only required data and to fit all results into one response.
Also, you can save bandwidth and retrieve large results faster by enabling transparent gzip compression. Check out our best practices page for more details on this feature and other recommendations.