How to set YouTube video monetization programticly

I am able to upload videos to YouTube using the API, however I have been unable to find out how to enable monetize for my video using API.

Videos.insert does not appear to have any way of setting this. Nor can I find any more information on how to set it in the documentation.

any help will be appreciated.

Upvotes: 0

Views: 589

Answers (1)

Linda Lawton - DaImTo
Linda Lawton - DaImTo

Reputation: 117186

To enable monetization you need to use the Google Content Owner API, which is available to those with a Content Owner account. YouTube Partner Program overview

Once you have your content owner id you should be able to do something like this

POST https://www.googleapis.com/youtube/partner/v1/claims?onBehalfOfContentOwner=CONTENT_OWNER_ID
Authorization: Bearer ...

{
  "assetId": "ASSET_ID",
  "videoId": "VIDEO_ID",
  "policy": {
    "id": "POLICY_ID"
  },
  "contentType": "audiovisual"
}

Upvotes: 1

Related Questions