Method: accounts.adUnits.list

List the ad units under the specified AdMob account.

HTTP request

GET https://admob.googleapis.com/v1/{parent=accounts/*}/adUnits

The URL uses gRPC Transcoding syntax.

Path parameters

Parameters
parent

string

Required. Resource name of the account to list ad units for. Example: accounts/pub-9876543210987654

Query parameters

Parameters
pageSize

integer

The maximum number of ad units to return. If unspecified or 0, at most 1000 ad units will be returned. The maximum value is 10,000; values above 10,000 will be coerced to 10,000.

pageToken

string

The value returned by the last ListAdUnitsResponse; indicates that this is a continuation of a prior adUnits.list call, and that the system should return the next page of data.

Request body

The request body must be empty.

Response body

If successful, the response body contains data with the following structure:

Response for the ad units list request.

JSON representation
{
  "adUnits": [
    {
      object (AdUnit)
    }
  ],
  "nextPageToken": string
}
Fields
adUnits[]

object (AdUnit)

The resulting ad units for the requested account.

nextPageToken

string

If not empty, indicates that there may be more ad units for the request; this value should be passed in a new ListAdUnitsRequest.

Authorization Scopes

Requires the following OAuth scope:

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

For more information, see the OAuth 2.0 Overview.

AdUnit

Describes an AdMob ad unit.

JSON representation
{
  "name": string,
  "adUnitId": string,
  "appId": string,
  "displayName": string,
  "adFormat": string,
  "adTypes": [
    string
  ]
}
Fields
name

string

Resource name for this ad unit. Format is accounts/{publisherId}/adUnits/{ad_unit_id_fragment} Example: accounts/pub-9876543210987654/adUnits/0123456789

adUnitId

string

The externally visible ID of the ad unit which can be used to integrate with the AdMob SDK. This is a read only property. Example: ca-app-pub-9876543210987654/0123456789

appId

string

The externally visible ID of the app this ad unit is associated with. Example: ca-app-pub-9876543210987654~0123456789

displayName

string

The display name of the ad unit as shown in the AdMob UI, which is provided by the user. The maximum length allowed is 80 characters.

adFormat

string

AdFormat of the ad unit. Possible values are as follows:

"BANNER" - Banner ad format. "BANNER_INTERSTITIAL" - Legacy format that can be used as either banner or interstitial. This format can no longer be created but can be targeted by mediation groups. "INTERSTITIAL" - A full screen ad. Supported ad types are "RICH_MEDIA" and "VIDEO". "NATIVE" - Native ad format. "REWARDED" - An ad that, once viewed, gets a callback verifying the view so that a reward can be given to the user. Supported ad types are "RICH_MEDIA" (interactive) and video where video can not be excluded.

adTypes[]

string

Ad media type supported by this ad unit. Possible values as follows:

"RICH_MEDIA" - Text, image, and other non-video media. "VIDEO" - Video media.