API: Getting an account

You can use this method to check the status of an account. An account will only serve ads if it has the state "APPROVED".

HTTP request

POST https://adsenseplatform.googleapis.com/v1alpha/{name=platforms/*/accounts/*}

The URL uses gRPC Transcoding syntax.

Path parameters

Parameter Description
name string

Required. This consists of the platform publisher ID and shadow publisher ID. You can find your platform publisher ID by visiting AdSense: Account > Settings > Account information, but will need to keep track of your shadow account IDs in your own database for now (until we extend the API to support a list method).

Format:
platforms/{platform_publisher_id}/accounts/{shadow_publisher_id}

Query parameters

There are no query parameters for this method.

Request body

The request body must be empty.

Python example

import requests as rqst

# This is the ID of your AdSense account (refer to "Path parameters" section)
platform = "pub-9952238966586479"

# This is the ID of the shadow account (refer to "Path parameters" section)
shadow_id = "pub-1060639449721357"

headers = {
    'Content-Type': 'application/json',
    'Authorization': 'OAuth ' + get_service_account_token()
}

r = rqst.get(
    "https://adsenseplatform.googleapis.com/v1alpha/platforms/" + platform + "/accounts/" + shadow_id,
    headers=headers
)

Successful response

{
  "name": "platforms/pub-9952238966586479/accounts/pub-1060639449721357",
  "displayName": "pub-1060639449721357",
  "state": "UNCHECKED",
  "timeZone": {
    "id": "America/Los_Angeles"
  },
  "createTime": "2021-06-22T17:40:23.976Z"
}
{
  "name": "platforms/pub-9952238966586479/accounts/pub-1060639449721357",
  "displayName": "pub-1060639449721357",
  "state": "APPROVED",
  "timeZone": {
    "id": "America/Los_Angeles"
  },
  "createTime": "2021-06-22T17:40:23.976Z"
}

Refer to the Create events API page to learn more about getting an approved shadow account.