Note:
The YouTube Content ID API is intended for use by YouTube content partners and is not accessible to all developers or to all YouTube users. If you do not see the YouTube Content ID API as one of the services listed in the
Google API Console
, see the
YouTube Help Center
to learn more about the YouTube Partner Program.
Each object in the YouTube rights management system is associated with a
content owner
. A content owner is a YouTube partner who has the rights to a collection of assets. When an application uses the YouTube Content ID API, it must have authorization from the content owner for the assets, policies, and claims it creates or manipulates. It receives that authorization when the
authenticated user
of the application has access to a content owner account. If the authenticated user
doesn't
have access to a content owner account, calls to the Content ID API fail.
Retrieve a content owner's ID
To retrieve a content owner's ID, call the YouTube Content ID API's
contentOwners.list
method. The API response contains a list of
contentOwner
resources associated with the user who authorized the request. In each resource, the
id
property specifies the content owner's ID.
For an example that retrieves the content owner ID programmatically, see
Uploading and Claiming a Video
.
Call YouTube APIs on a content owner's behalf
YouTube Content ID API
Because most users have access to a single content owner account, the Content ID API can implicitly determine the content owner that the user is acting as. As such, the
onBehalfOfContentOwner
parameter is optional for Content ID API calls.
However, some users have access to
multiple
content owner accounts. For these users, each API request must include the
onBehalfOfContentOwner
parameter to explicitly identify which content owner account to use.
YouTube Data API (v3)
Many
YouTube Data API
methods also support the
onBehalfOfContentOwner
parameter. The methods that use that parameter employ
delegation
, allowing an application to perform actions either on channels managed by the content owner, on videos in those managed channels, or on other API resources.
When using delegation in the YouTube Data API, the
onBehalfOfContentOwner
parameter is always required. The parameter's value is an ID that uniquely identifies the content owner. You can retrieve the ID programmatically by calling the YouTube Content ID API's
contentOwners.list
method.
Some API calls also require an additional delegation parameter. The list below describes two examples:
The documentation for each specific method details when it supports delegation and whether you need to set an additional parameter besides
onBehalfOfContentOwner
.
YouTube Analytics API
To retrieve a
content owner report
using the YouTube Analytics API, you set the
ids
parameter value in your API request to
contentOwner==OWNER_ID
, where
OWNER_ID
specifies the content owner's ID.