1 API Parameters
_
2 Resources
2.1 accounts
3 Resources
adsense-accounts-list
adsense-accounts-get
3.1 customchannels
4 Resources
adsense-customchannels-list
adsense-customchannels-get
4.1 adunits
5 Resources
adsense-adunits-list
adsense-adunits-get
5.1 adclients
adsense-adclients-list
5.2 reports
adsense-reports-generate
5.3 urlchannels
adsense-urlchannels-list
Version: 5.3

AdSense Management API v1.1

This documentation has been automatically generated using information supplied by the Google API Discovery service.

Gives AdSense publishers access to their inventory and the ability to generate reports Google documentation.

    1 API Parameters

    2 Resources

      2.1 accounts

    3 Resources

      3.1 customchannels

    4 Resources

      4.1 adunits

    5 Resources

      5.1 adclients

      5.2 reports

      5.3 urlchannels

(require-gapi-doc "adsense.v1.1.js")

1 API Parameters

The following optional keyword arguments may be passed to all functions for this web service:

procedure

(_ [#:alt alt    
  #:fields fields    
  #:key key    
  #:oauth_token oauth_token    
  #:prettyPrint prettyPrint    
  #:quotaUser quotaUser    
  #:userIp userIp])  jsexpr?
  alt : string? = 'N/A
  fields : string? = 'N/A
  key : string? = (api-key)
  oauth_token : string? = 'N/A
  prettyPrint : string? = 'N/A
  quotaUser : string? = 'N/A
  userIp : string? = 'N/A

This is not actually a function. This is just using Scribble’s defproc form to list the optional keyword arguments that may be passed to all functions for this service.

alt: Data format for the response.

fields: Selector specifying which fields to include in a partial response.

key: API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.

oauth_token: OAuth 2.0 token for the current user.

prettyPrint: Returns response with indentations and line breaks.

quotaUser: Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.

userIp: IP address of the site where the request originates. Use this if you want to enforce per-user limits.

2 Resources

2.1 accounts

3 Resources

procedure

(adsense-accounts-list [#:maxResults maxResults    
  #:pageToken pageToken    
  #:alt alt    
  #:fields fields    
  #:key key    
  #:oauth_token oauth_token    
  #:prettyPrint prettyPrint    
  #:quotaUser quotaUser    
  #:userIp userIp])  jsexpr?
  maxResults : string? = 'N/A
  pageToken : string? = 'N/A
  alt : string? = 'N/A
  fields : string? = 'N/A
  key : string? = (api-key)
  oauth_token : string? = 'N/A
  prettyPrint : string? = 'N/A
  quotaUser : string? = 'N/A
  userIp : string? = 'N/A
List all accounts available to this AdSense account.

maxResults: The maximum number of accounts to include in the response, used for paging.

pageToken: A continuation token, used to page through accounts. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response.

procedure

(adsense-accounts-get #:accountId accountId    
  [#:tree tree    
  #:alt alt    
  #:fields fields    
  #:key key    
  #:oauth_token oauth_token    
  #:prettyPrint prettyPrint    
  #:quotaUser quotaUser    
  #:userIp userIp])  jsexpr?
  accountId : string?
  tree : string? = 'N/A
  alt : string? = 'N/A
  fields : string? = 'N/A
  key : string? = (api-key)
  oauth_token : string? = 'N/A
  prettyPrint : string? = 'N/A
  quotaUser : string? = 'N/A
  userIp : string? = 'N/A
Get information about the selected AdSense account.

accountId: Account to get information about.

tree: Whether the tree of sub accounts should be returned.

3.1 customchannels

4 Resources

procedure

(adsense-customchannels-list #:adClientId adClientId 
  [#:maxResults maxResults 
  #:pageToken pageToken 
  #:alt alt 
  #:fields fields 
  #:key key 
  #:oauth_token oauth_token 
  #:prettyPrint prettyPrint 
  #:quotaUser quotaUser 
  #:userIp userIp]) 
  jsexpr?
  adClientId : string?
  maxResults : string? = 'N/A
  pageToken : string? = 'N/A
  alt : string? = 'N/A
  fields : string? = 'N/A
  key : string? = (api-key)
  oauth_token : string? = 'N/A
  prettyPrint : string? = 'N/A
  quotaUser : string? = 'N/A
  userIp : string? = 'N/A
List all custom channels in the specified ad client for this AdSense account.

adClientId: Ad client for which to list custom channels.

maxResults: The maximum number of custom channels to include in the response, used for paging.

pageToken: A continuation token, used to page through custom channels. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response.

procedure

(adsense-customchannels-get #:adClientId adClientId 
  #:customChannelId customChannelId 
  [#:alt alt 
  #:fields fields 
  #:key key 
  #:oauth_token oauth_token 
  #:prettyPrint prettyPrint 
  #:quotaUser quotaUser 
  #:userIp userIp]) 
  jsexpr?
  adClientId : string?
  customChannelId : string?
  alt : string? = 'N/A
  fields : string? = 'N/A
  key : string? = (api-key)
  oauth_token : string? = 'N/A
  prettyPrint : string? = 'N/A
  quotaUser : string? = 'N/A
  userIp : string? = 'N/A
Get the specified custom channel from the specified ad client.

adClientId: Ad client which contains the custom channel.

customChannelId: Custom channel to retrieve.

4.1 adunits

5 Resources

procedure

(adsense-adunits-list #:adClientId adClientId 
  [#:maxResults maxResults 
  #:pageToken pageToken 
  #:includeInactive includeInactive 
  #:alt alt 
  #:fields fields 
  #:key key 
  #:oauth_token oauth_token 
  #:prettyPrint prettyPrint 
  #:quotaUser quotaUser 
  #:userIp userIp]) 
  jsexpr?
  adClientId : string?
  maxResults : string? = 'N/A
  pageToken : string? = 'N/A
  includeInactive : string? = 'N/A
  alt : string? = 'N/A
  fields : string? = 'N/A
  key : string? = (api-key)
  oauth_token : string? = 'N/A
  prettyPrint : string? = 'N/A
  quotaUser : string? = 'N/A
  userIp : string? = 'N/A
List all ad units in the specified ad client for this AdSense account.

adClientId: Ad client for which to list ad units.

maxResults: The maximum number of ad units to include in the response, used for paging.

pageToken: A continuation token, used to page through ad units. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response.

includeInactive: Whether to include inactive ad units. Default: true.

procedure

(adsense-adunits-get #:adClientId adClientId    
  #:adUnitId adUnitId    
  [#:alt alt    
  #:fields fields    
  #:key key    
  #:oauth_token oauth_token    
  #:prettyPrint prettyPrint    
  #:quotaUser quotaUser    
  #:userIp userIp])  jsexpr?
  adClientId : string?
  adUnitId : string?
  alt : string? = 'N/A
  fields : string? = 'N/A
  key : string? = (api-key)
  oauth_token : string? = 'N/A
  prettyPrint : string? = 'N/A
  quotaUser : string? = 'N/A
  userIp : string? = 'N/A
Gets the specified ad unit in the specified ad client.

adClientId: Ad client for which to get the ad unit.

adUnitId: Ad unit to retrieve.

5.1 adclients

procedure

(adsense-adclients-list [#:maxResults maxResults    
  #:pageToken pageToken    
  #:alt alt    
  #:fields fields    
  #:key key    
  #:oauth_token oauth_token    
  #:prettyPrint prettyPrint    
  #:quotaUser quotaUser    
  #:userIp userIp])  jsexpr?
  maxResults : string? = 'N/A
  pageToken : string? = 'N/A
  alt : string? = 'N/A
  fields : string? = 'N/A
  key : string? = (api-key)
  oauth_token : string? = 'N/A
  prettyPrint : string? = 'N/A
  quotaUser : string? = 'N/A
  userIp : string? = 'N/A
List all ad clients in this AdSense account.

maxResults: The maximum number of ad clients to include in the response, used for paging.

pageToken: A continuation token, used to page through ad clients. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response.

5.2 reports

procedure

(adsense-reports-generate #:endDate endDate    
  #:startDate startDate    
  [#:sort sort    
  #:filter filter    
  #:maxResults maxResults    
  #:accountId accountId    
  #:currency currency    
  #:dimension dimension    
  #:locale locale    
  #:metric metric    
  #:startIndex startIndex    
  #:alt alt    
  #:fields fields    
  #:key key    
  #:oauth_token oauth_token    
  #:prettyPrint prettyPrint    
  #:quotaUser quotaUser    
  #:userIp userIp])  jsexpr?
  endDate : string?
  startDate : string?
  sort : string? = 'N/A
  filter : string? = 'N/A
  maxResults : string? = 'N/A
  accountId : string? = 'N/A
  currency : string? = 'N/A
  dimension : string? = 'N/A
  locale : string? = 'N/A
  metric : string? = 'N/A
  startIndex : string? = 'N/A
  alt : string? = 'N/A
  fields : string? = 'N/A
  key : string? = (api-key)
  oauth_token : string? = 'N/A
  prettyPrint : string? = 'N/A
  quotaUser : string? = 'N/A
  userIp : string? = 'N/A
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.

endDate: End of the date range to report on in "YYYY-MM-DD" format, inclusive.

startDate: Start of the date range to report on in "YYYY-MM-DD" format, inclusive.

sort: 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.

filter: Filters to be run on the report.

maxResults: The maximum number of rows of report data to return.

accountId: Accounts upon which to report.

currency: Optional currency to use when reporting on monetary metrics. Defaults to the account’s currency if not set.

dimension: Dimensions to base the report on.

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

metric: Numeric columns to include in the report.

startIndex: Index of the first row of report data to return.

5.3 urlchannels

procedure

(adsense-urlchannels-list #:adClientId adClientId    
  [#:maxResults maxResults    
  #:pageToken pageToken    
  #:alt alt    
  #:fields fields    
  #:key key    
  #:oauth_token oauth_token    
  #:prettyPrint prettyPrint    
  #:quotaUser quotaUser    
  #:userIp userIp])  jsexpr?
  adClientId : string?
  maxResults : string? = 'N/A
  pageToken : string? = 'N/A
  alt : string? = 'N/A
  fields : string? = 'N/A
  key : string? = (api-key)
  oauth_token : string? = 'N/A
  prettyPrint : string? = 'N/A
  quotaUser : string? = 'N/A
  userIp : string? = 'N/A
List all URL channels in the specified ad client for this AdSense account.

adClientId: Ad client for which to list URL channels.

maxResults: The maximum number of URL channels to include in the response, used for paging.

pageToken: A continuation token, used to page through URL channels. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response.