Page Summary
-
This endpoint retrieves details about the advertising options enabled for a specific YouTube video, including the types of ads allowed and where they can run.
-
The
videoIdpath parameter is mandatory to specify the target video for which you are retrieving ad settings. -
The
onBehalfOfContentOwnerquery parameter allows a user associated with multiple content owners to specify which content owner they are acting on behalf of. -
The response provides information like a list of allowed countries, available ad formats per country, ad break details, and whether ads can run when the video is embedded.
-
Authorization for this request requires the
https://www.googleapis.com/auth/youtubepartnerOAuth scope.
- HTTP request
- Path parameters
- Query parameters
- Request body
- Response body
- Authorization scopes
- CountriesRestriction
- Try it!
Retrieves details about the types of allowed ads for a specified partner- or user-uploaded video.
HTTP request
GET https://youtubepartner.googleapis.com/youtube/partner/v1/videoAdvertisingOptions/{videoId}/getEnabledAds
The URL uses gRPC Transcoding syntax.
Path parameters
| Parameters | |
|---|---|
videoId
|
The |
Query parameters
| Parameters | |
|---|---|
onBehalfOfContentOwner
|
The |
Request body
The request body must be empty.
Response body
This resource identifies the ad settings for a claimed YouTube video. It identifies the video, the times when ads can run during the video, the countries where ads can run, and the types of ads allowed in those countries. It also indicates whether ads can run if the video plays in an embedded player.
If successful, the response body contains data with the following structure:
| JSON representation |
|---|
{ "kind" : string , "countriesRestriction" : [ { object ( |
| Fields | |
|---|---|
kind
|
The type of the API resource. For this resource, the value is |
countriesRestriction[]
|
A list that identifies the countries where ads can run and the types of ads allowed in those countries. |
adBreaks[]
|
A list of ad breaks that occur in a claimed YouTube video. |
adsOnEmbeds
|
This field indicates whether YouTube can show ads when the video is played in an embedded player. |
id
|
The ID that YouTube uses to uniquely identify the claimed video. |
Authorization scopes
Requires the following OAuth scope:
-
https://www.googleapis.com/auth/youtubepartner
For more information, see the OAuth 2.0 Overview .
CountriesRestriction
Formats enabled in given countries, based on applied policy.
| JSON representation |
|---|
{ "adFormats" : [ string ] , "territories" : [ string ] } |
| Fields | |
|---|---|
adFormats[]
|
A list of ad formats that can be used in the specified countries. |
territories[]
|
A list of ISO 3166-1 alpha-2 country codes that identify the countries where ads are enabled. |

