Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

In order to batch your API report output, you will need to utilize the 'offset' and 'limit' properties.  Offset determines the number of records into the full data set that will be the first record returned in your report's output.  Limit determines the maximum number of records that can be returned in your report's output.  Together they can be used to pull a large data set in manageable batches. 

Example:Full output request:

If the full output has 300,000 rows, instead of trying to pull the full output via the request below, it can be requested in 100,000 row batches.

Code Block
languagejs
{
	"timeDimension": "OVERALL",
	"reportType": ["PARTNER", "SITE", "DEAL", "TAG"],
	"reportFormat": "JSON",
	"startDate": "2017-03-01",
	"endDate": "2017-03-31",
	"timezone": "America/New_York",
	"sort": [{
        "field": "ad_requests",
        "order": "desc"        
    }]
}

...

Code Block
languagejs
{
	"timeDimension": "OVERALL",
	"reportType": ["PARTNER", "SITE", "DEAL", "TAG"],
	"reportFormat": "JSON",
	"startDate": "2017-03-01",
	"endDate": "2017-03-31",
	"timezone": "America/New_York",
	"sort": [{
        "field": "ad_requests",
        "order": "desc" 
    }],
	"offset": "100001",
	"limit": "100000"
}

 

Request 3

Code Block
languagejs
{
	"timeDimension": "OVERALL",
	"reportType": ["PARTNER", "SITE", "DEAL", "TAG"],
	"reportFormat": "JSON",
	"startDate": "2017-03-01",
	"endDate": "2017-03-31",
	"timezone": "America/New_York",
	"sort": [{
        "field": "ad_requests",
        "order": "desc" 
    }],
	"offset": "200001",
	"limit": "100000"
}