YouTube Content ID API Code Samples
Stay organized with collections
Save and categorize content based on your preferences.
All rights reserved. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-28 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[[["\u003cp\u003eThis page lists code samples for the YouTube Data API (v3) in .NET, PHP, and Python.\u003c/p\u003e\n"],["\u003cp\u003ePHP samples cover uploading and monetizing videos, managing asset labels, and uploading references, including versions for service account authorization.\u003c/p\u003e\n"],["\u003cp\u003ePython samples provide examples for creating, managing, and using asset labels, as well as creating assets and claiming videos.\u003c/p\u003e\n"],["\u003cp\u003eBoth .NET and Python provide code samples for retrieving a content owner's managed channels using the channels.list method.\u003c/p\u003e\n"]]],["Code samples for the YouTube Data API (v3) are available in .NET, PHP, and Python. Key actions include retrieving a content owner's managed channels using `channels.list`. PHP samples cover uploading and monetizing videos, creating and managing asset labels, and uploading references, with options for service account authorization. Python samples demonstrate creating, managing, and using asset labels via `assetLabels.insert` and creating assets while uploading and claiming videos via `assets.insert`.\n"],null,["# YouTube Content ID API Code Samples\n\nThe lists below identify the code samples available for the YouTube Data API (v3):\n\n.NET\n----\n\n\u003cbr /\u003e\n\n1. [Retrieve a content owner's managed channels](/youtube/partner/code_samples/dotnet#retrieve_a_content_owner_s_managed_channels) ([channels.list](/youtube/v3/docs/channels/list))\n\n\u003cbr /\u003e\n\nPHP\n---\n\n\u003cbr /\u003e\n\n1. [Upload and monetize a video (service account authorization)](/youtube/partner/code_samples/php#upload_and_monetize_a_video__service_account_authorization_)\n2. [Upload and monetize a video](/youtube/partner/code_samples/php#upload_and_monetize_a_video)\n3. [Create, manage, and use asset labels](/youtube/partner/code_samples/php#create__manage__and_use_asset_labels)\n4. [Upload a reference (service account authorization)](/youtube/partner/code_samples/php#upload_a_reference__service_account_authorization_)\n5. [Upload a reference](/youtube/partner/code_samples/php#upload_a_reference)\n6. [Retrieve a content owner's managed channels (service account authorization)](/youtube/partner/code_samples/php#retrieve_a_content_owner_s_managed_channels__service_account_authorization_)\n\n\u003cbr /\u003e\n\nPython\n------\n\n\u003cbr /\u003e\n\n1. [Create, manage, and use asset labels](/youtube/partner/code_samples/python#creating__managing__and_using_asset_labels) ([assetLabels.insert](/youtube/partner/reference/rest/v1/assetLabels/insert))\n2. [Create an asset; upload and claim a video](/youtube/partner/code_samples/python#create_an_asset__upload_and_claim_a_video) ([assets.insert](/youtube/partner/reference/rest/v1/assets/insert))\n3. [Retrieve a content owner's managed channels](/youtube/partner/code_samples/python#retrieve_a_content_owner_s_managed_channels) ([channels.list](/youtube/v3/docs/channels/list))\n\n\u003cbr /\u003e"]]