Report
Generate data reports collected by the Green Ad Tag.
The /report
endpoint operates asynchronously. Users request a report by submitting specifications to this endpoint and immediately receive a report ID. The report computation begins in the background after this request.
The actual computation time depends on the report's size and scale.
Users can access the report via the /report/{id}
endpoint. If the report is ready, this endpoint will return the report's result.
Create new Report
Request a report on stored data (i.e. data from Green Ad Tag pixels, or from API calls using store=true). This will return a report id, which can be used to check the status of the report, and to retrieve the result.
Endpoint
Method
POST
Parameters
Parameter | Description | Type | Required |
---|---|---|---|
start | Start date for the report | string | Yes |
end | End date for the report | string | Yes |
q | Query string for filtering reports. E.g. use adid:X where X is the id of a Green Tag you generated | string | No |
breakdown | (optional) Specify a breakdown for the report by format, domain, country, time or os | string | No |
callback | If provided, this will be called with the completed report when ready | string | No |
Start and end date
You can specify the start and end date for the report in one of two ways:
- Use the
start
andend
parameters to specify the start and end date in ISO-8601 format of yyyy-mm-dd (date only) or yyyy-mm-ddTHH:mmZ (date and time). - Time period strings. For example:
3 months ago
or2 days ago
.
Example
curl --header 'Authorization: token <your-api-key>' \
--request POST \
'https://api.good-loop.com/v0/report/new?start=2%20months%20ago&end=1%20day%20ago'
curl --header 'Authorization: token <your-api-key>' \
--request POST \
'https://api.good-loop.com/v0/report/new?start=2023-11-30T00:00:00Z&end=2023-12-01T00:00:q=adid:fo123&breakdown=format'
Response
Get Report
Get the status of a report, or retrieve the report's result.
Endpoint
Method
GET
Example
curl --header 'Authorization: token <your-api-key>' \
--location 'https://api.good-loop.com/v0/report/apireport_xxxxxxxx'