हम Data API को अपडेट कर रहे हैं, ताकि यह Shorts पर मिले व्यू की गिनती करने के तरीके से मेल खा सके.
ज़्यादा जानें
YouTube Data API (v3) कोड सैंपल
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
इस्तेमाल के उदाहरण और कोड सैंपल पेज पर, YouTube Data API और YouTube Live Streaming API के इस्तेमाल के सामान्य उदाहरण देखे जा सकते हैं.
इस पेज पर, एपीआई संसाधन और तरीका चुना जा सकता है. इसके बाद, उस तरीके के लिए इस्तेमाल के सामान्य उदाहरणों की सूची दिखती है. इसके बाद, किसी भी इस्तेमाल के उदाहरण पर क्लिक करके, एपीआई एक्सप्लोरर विजेट को उस उदाहरण के लिए सैंपल पैरामीटर और प्रॉपर्टी वैल्यू से पॉप्युलेट किया जा सकता है. Java, JavaScript, PHP, और Python के लिए काम करने वाले कोड के सैंपल देखने के लिए, फ़ुलस्क्रीन APIs Explorer विजेट भी खोला जा सकता है. अगर आपने एपीआई एक्सप्लोरर में पैरामीटर या प्रॉपर्टी की वैल्यू अपडेट की हैं, तो आपके बदलावों को दिखाने के लिए कोड सैंपल भी अपडेट हो जाएंगे.
नीचे दिए गए सेक्शन में, दूसरी भाषाओं में उपलब्ध कोड सैंपल की सूची दी गई है.
स्टैंडअलोन कोड स्निपेट
यहां दी गई सूचियों में, Java, JavaScript, PHP, और Python के अलावा अन्य भाषाओं में, YouTube Data API (v3) के लिए उपलब्ध कोड सैंपल की जानकारी दी गई है. पिछले सेक्शन में बताया गया है कि इन भाषाओं के लिए कोड सैंपल, इस्तेमाल के उदाहरण और कोड सैंपल पेज पर उपलब्ध हैं.
Ruby
आपके पास किसी दूसरे Ruby सैंपल को भी इस्तेमाल करने का विकल्प है.
जब तक कुछ अलग से न बताया जाए, तब तक इस पेज की सामग्री को Creative Commons Attribution 4.0 License के तहत और कोड के नमूनों को Apache 2.0 License के तहत लाइसेंस मिला है. ज़्यादा जानकारी के लिए, Google Developers साइट नीतियां देखें. Oracle और/या इससे जुड़ी हुई कंपनियों का, Java एक रजिस्टर किया हुआ ट्रेडमार्क है.
आखिरी बार 2025-08-21 (UTC) को अपडेट किया गया.
[[["समझने में आसान है","easyToUnderstand","thumb-up"],["मेरी समस्या हल हो गई","solvedMyProblem","thumb-up"],["अन्य","otherUp","thumb-up"]],[["वह जानकारी मौजूद नहीं है जो मुझे चाहिए","missingTheInformationINeed","thumb-down"],["बहुत मुश्किल है / बहुत सारे चरण हैं","tooComplicatedTooManySteps","thumb-down"],["पुराना","outOfDate","thumb-down"],["अनुवाद से जुड़ी समस्या","translationIssue","thumb-down"],["सैंपल / कोड से जुड़ी समस्या","samplesCodeIssue","thumb-down"],["अन्य","otherDown","thumb-down"]],["आखिरी बार 2025-08-21 (UTC) को अपडेट किया गया."],[[["\u003cp\u003eExplore the use cases and code samples page to find examples for the YouTube Data API and YouTube Live Streaming API.\u003c/p\u003e\n"],["\u003cp\u003eThe use cases and code samples page provides interactive samples in Java, JavaScript, PHP, and Python, allowing you to adjust parameters and see updated code.\u003c/p\u003e\n"],["\u003cp\u003eStandalone code snippets are available for Apps Script, Go, .NET, and Ruby, demonstrating common methods like uploading videos, searching for videos, and managing playlists.\u003c/p\u003e\n"],["\u003cp\u003eThe page provides code samples for several common methods including subscriptions.insert, channels.list, search.list, and videos.update, allowing developers to find quick snippets for their use cases.\u003c/p\u003e\n"],["\u003cp\u003eCode samples are provided for various common tasks such as authorization, uploading, and searching for videos, as well as creating playlists and subscriptions.\u003c/p\u003e\n"]]],["The document details code samples for the YouTube Data API and YouTube Live Streaming API. Users can find examples for common use cases by selecting an API resource and method. The APIs Explorer widget allows interaction with samples, including parameter adjustments, with working code in Java, JavaScript, PHP, and Python. Additional code snippets are available in Apps Script, Go, .NET, and Ruby, covering actions like subscribing to channels, retrieving uploads, searching videos, updating videos, and creating playlists.\n"],null,["# YouTube Data API (v3) Code Samples\n\nYou can explore common use cases for the YouTube Data API and YouTube Live Streaming API on the [use cases and code samples](/youtube/v3/code_samples/code_snippets) page.\n\nThe page lets you select an API resource and method and then lists common use cases for that method. You can then click on any use case to populate the APIs Explorer widget with sample parameter and property values for that use case. You can also open the fullscreen APIs Explorer widget to see working code samples for Java, JavaScript, PHP, and Python. If you update parameter or property values in the APIs Explorer, the code samples also update to reflect your changes.\n\nThe following section lists code samples available in other languages.\n\nStandalone code snippets\n------------------------\n\nThe lists below identify code samples available for the YouTube Data API (v3) in languages other than Java, JavaScript, PHP, and Python. As noted in the previous section, code samples for those languages are available on the [use cases and code samples](/youtube/v3/code_samples/code_snippets) page. \n\n### Apps Script\n\n| Code sample | Methods |\n|--------------------------------------------------------------------------------------------------|---------------------------------------------------------------|\n| [Add a channel subscription](/youtube/v3/code_samples/apps-script#subscribe_to_channel) | [subscriptions.insert](/youtube/v3/docs/subscriptions/insert) |\n| [Retrieve current user's uploads](/youtube/v3/code_samples/apps-script#retrieve_my_uploads) | [channels.list](/youtube/v3/docs/channels/list) |\n| [Search for videos related to a keyword](/youtube/v3/code_samples/apps-script#search_by_keyword) | [search.list](/youtube/v3/docs/search/list) |\n| [Update a video](/youtube/v3/code_samples/apps-script#update_video) | [videos.update](/youtube/v3/docs/videos/update) |\n\n### Go\n\n| Code sample | Methods |\n|-----------------------------------------------------------------------------------------|-----------------------------------------------------------|\n| [Authorize a request](/youtube/v3/code_samples/go#authorize_a_request) | Any method requiring authorization |\n| [Retrieve current user's uploads](/youtube/v3/code_samples/go#retrieve_my_uploads) | [playlistItems.list](/youtube/v3/docs/playlistItems/list) |\n| [Search for videos related to a keyword](/youtube/v3/code_samples/go#search_by_keyword) | [search.list](/youtube/v3/docs/search/list) |\n| [Upload a video](/youtube/v3/code_samples/go#upload_a_video) | [videos.insert](/youtube/v3/docs/videos/insert) |\n\n### .NET\n\n| Code sample | Methods |\n|------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------|\n| [Create a playlist](/youtube/v3/code_samples/dotnet#create_a_playlist) | [playlists.insert](/youtube/v3/docs/playlists/insert) |\n| [Retrieve current user's uploaded videos](/youtube/v3/code_samples/dotnet#retrieve_my_uploads) | [channels.list](/youtube/v3/docs/channels/list) [playlistItems.list](/youtube/v3/docs/playlistItems/list) |\n| [Search for videos related to a keyword](/youtube/v3/code_samples/dotnet#search_by_keyword) | [search.list](/youtube/v3/docs/search/list) |\n| [Upload a video](/youtube/v3/code_samples/dotnet#upload_a_video) | [videos.insert](/youtube/v3/docs/videos/insert) |\n\n### Ruby\n\n| Code sample | Methods |\n|-------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------|\n| [Authorize a request](/youtube/v3/code_samples/ruby#authorize_a_request) | Any method requiring authorization |\n| [Create a channel subscription](/youtube/v3/code_samples/ruby#add_a_channel_subscription) | [subscriptions.insert](/youtube/v3/docs/subscriptions/insert) |\n| [Retrieve current user's uploads](/youtube/v3/code_samples/ruby#retrieve_my_uploads) | [channels.list](/youtube/v3/docs/channels/list) [playlistItems.list](/youtube/v3/docs/playlistItems/list) |\n| [Search for videos related to a keyword](/youtube/v3/code_samples/ruby#search_by_keyword) | [search.list](/youtube/v3/docs/search/list) |\n| [Upload a video](/youtube/v3/code_samples/ruby#upload_a_video) | [videos.insert](/youtube/v3/docs/videos/insert) |\n\nYou may also be able to adapt one of the other\n[Ruby samples](https://github.com/googleapis/google-api-ruby-client/tree/main/samples)."]]