v1.4 of the AdSense Management API is now deprecated. This version will stop returning data on October 12, 2021. Please migrate to v2 as soon as possible.

Method: accounts.reports.generate

reports.generate an AdSense report based on the report request sent in the query parameters. Returns the result as JSON; to retrieve output in CSV format specify "alt=csv" as a query parameter.

HTTP request

GET https://www.googleapis.com/adsense/v1.4/accounts/{accountId}/reports

The URL uses gRPC Transcoding syntax.

Path parameters

Parameters
accountId

string

Account upon which to report.

Query parameters

Parameters
dimension[]

string

Dimensions to base the report on.

metric[]

string

Numeric columns to include in the report.

filter[]

string

Filters to be run on the report.

startDate[]

string

Start of the date range to report on in "YYYY-MM-DD" format, inclusive. Note: this value should be singular but is defined as repeated here to satisfy validation.

endDate[]

string

End of the date range to report on in "YYYY-MM-DD" format, inclusive. Note: this value should be singular but is defined as repeated here to satisfy validation.

sort[]

string

The name of a dimension or metric to sort the resulting report on, optionally prefixed with "+" to sort ascending or "-" to sort descending. If no prefix is specified, the column is sorted ascending.

locale

string

Optional locale to use for translating report output to a local language. Defaults to "en_US" if not specified.

currency[]

string

Optional currency to use when reporting on monetary metrics. Defaults to the account's currency if not set. Note: this value should be singular but is defined as repeated here to satisfy validation.

startIndex

integer

Index of the first row of report data to return.

maxResults

integer

The maximum number of rows of report data to return.

useTimezoneReporting

boolean

Whether the report should be generated in the AdSense account's local timezone. If false default PST/PDT timezone will be used.

Request body

The request body must be empty.

Response body

If successful, the response is a generic HTTP response whose format is defined by the method.

Authorization Scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/adsense
  • https://www.googleapis.com/auth/adsense.readonly