6

Is it possible to set a date range for requestReport?

POST /v2/sp/{recordType}/report

 {
   "segment": {segment},
   "reportDate": {reportDate}, <-- here
   "metrics": {metrics}
 }  

Or do I need to make 30 request in order to get results for a month? Maybe snapshots can help?

starball
  • 20,030
  • 7
  • 43
  • 238
lidox
  • 1,901
  • 3
  • 21
  • 40

2 Answers2

1

Yes, you have to do multiple requests (one for each day) and merge them. The Advertising API currently does not offer an option to request data for a date range. Snapshots can maybe help you to get data which has no click data for the requested date(s).

tector
  • 977
  • 1
  • 8
  • 31
1

Yes, you do. What I do is run it daily using a cron job and load the data into a database, and query the database. Keep in mind certain metrics, like sales, don't finalize until after the attribution window e.g. 14 days.

mr_mooo_cow
  • 1,098
  • 1
  • 6
  • 16