The AdMob API lets you view [mediation ad sources](https://developers.google.com/admob/api/v1/ad-sources-reference)
programmatically. See
[`accounts.adSources.list`](https://developers.google.com/admob/api/reference/rest/v1beta/accounts.adSources/list)
for additional information.

### Request using Curl

1. Load the [client secrets file](https://console.cloud.google.com/apis/credentials) and generate authorization
   credentials.

   The first time you perform this step you'll be asked to accept an
   authorization prompt in your browser. Before accepting, make sure you're
   signed in with a Google Account that has access to the AdMob API. Your
   app will be authorized to access data on behalf of whichever account is
   currently signed in.

   For authentication and authorization, we recommend using
   [oauth2l](https://github.com/google/oauth2l), a simple command-line tool for
   working with Google OAuth 2.0. Install oauth2l and run the
   command below, replacing <var translate="no">path_to_credentials_json</var> with a path
   to a `credentials.json` file that you download when registering your
   cloud application. For the first run, the command walks you through the
   OAuth 2.0 authorization flow. Subsequent runs refresh the token
   automatically.

   ```
   oauth2l header --json path_to_credentials_json --scope admob.readonly
   ```
2. List ad sources.

   Get AdMob ad source information by replacing <var translate="no">pub-XXXXXXXXXXXXXXXX</var>
   with your publisher ID. See the
   [instructions](https://support.google.com/admob/answer/2784578) on how to find
   your publisher ID.

   ```
   curl --http1.0 -X GET https://admob.googleapis.com/v1beta/accounts/pub-XXXXXXXXXXXXXXXX/adSources \
    -H "$(oauth2l header --json path_to_credentials_json --scope admob.readonly)"
   ```

   Sample response:

   ```
   {
    "adSources": [
      {
        "name": "accounts/pub-XXXXXXXXXXXXXXXX/adSources/5450213213286189855",
        "adSourceId": "5450213213286189855",
        "title": "AdMob Network",
      }
    ]
   }
   ```