# Source: https://developers.google.com/youtube/v3/code_samples.md.txt

# YouTube Data API (v3) Code Samples

You can explore common use cases for the YouTube Data API and YouTube Live Streaming API on the [use cases and code samples](https://developers.google.com/youtube/v3/code_samples/code_snippets) page.

The 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.

The following section lists code samples available in other languages.

## Standalone code snippets

The 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](https://developers.google.com/youtube/v3/code_samples/code_snippets) page.  

### Apps Script

|                                                          Code sample                                                          |                                          Methods                                           |
|-------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------|
| [Add a channel subscription](https://developers.google.com/youtube/v3/code_samples/apps-script#subscribe_to_channel)          | [subscriptions.insert](https://developers.google.com/youtube/v3/docs/subscriptions/insert) |
| [Retrieve current user's uploads](https://developers.google.com/youtube/v3/code_samples/apps-script#retrieve_my_uploads)      | [channels.list](https://developers.google.com/youtube/v3/docs/channels/list)               |
| [Search for videos related to a keyword](https://developers.google.com/youtube/v3/code_samples/apps-script#search_by_keyword) | [search.list](https://developers.google.com/youtube/v3/docs/search/list)                   |
| [Update a video](https://developers.google.com/youtube/v3/code_samples/apps-script#update_video)                              | [videos.update](https://developers.google.com/youtube/v3/docs/videos/update)               |

### Go

|                                                     Code sample                                                      |                                        Methods                                         |
|----------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------|
| [Authorize a request](https://developers.google.com/youtube/v3/code_samples/go#authorize_a_request)                  | Any method requiring authorization                                                     |
| [Retrieve current user's uploads](https://developers.google.com/youtube/v3/code_samples/go#retrieve_my_uploads)      | [playlistItems.list](https://developers.google.com/youtube/v3/docs/playlistItems/list) |
| [Search for videos related to a keyword](https://developers.google.com/youtube/v3/code_samples/go#search_by_keyword) | [search.list](https://developers.google.com/youtube/v3/docs/search/list)               |
| [Upload a video](https://developers.google.com/youtube/v3/code_samples/go#upload_a_video)                            | [videos.insert](https://developers.google.com/youtube/v3/docs/videos/insert)           |

### .NET

|                                                         Code sample                                                         |                                                                               Methods                                                                               |
|-----------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Create a playlist](https://developers.google.com/youtube/v3/code_samples/dotnet#create_a_playlist)                         | [playlists.insert](https://developers.google.com/youtube/v3/docs/playlists/insert)                                                                                  |
| [Retrieve current user's uploaded videos](https://developers.google.com/youtube/v3/code_samples/dotnet#retrieve_my_uploads) | [channels.list](https://developers.google.com/youtube/v3/docs/channels/list) [playlistItems.list](https://developers.google.com/youtube/v3/docs/playlistItems/list) |
| [Search for videos related to a keyword](https://developers.google.com/youtube/v3/code_samples/dotnet#search_by_keyword)    | [search.list](https://developers.google.com/youtube/v3/docs/search/list)                                                                                            |
| [Upload a video](https://developers.google.com/youtube/v3/code_samples/dotnet#upload_a_video)                               | [videos.insert](https://developers.google.com/youtube/v3/docs/videos/insert)                                                                                        |

### Ruby

|                                                      Code sample                                                       |                                                                               Methods                                                                               |
|------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Authorize a request](https://developers.google.com/youtube/v3/code_samples/ruby#authorize_a_request)                  | Any method requiring authorization                                                                                                                                  |
| [Create a channel subscription](https://developers.google.com/youtube/v3/code_samples/ruby#add_a_channel_subscription) | [subscriptions.insert](https://developers.google.com/youtube/v3/docs/subscriptions/insert)                                                                          |
| [Retrieve current user's uploads](https://developers.google.com/youtube/v3/code_samples/ruby#retrieve_my_uploads)      | [channels.list](https://developers.google.com/youtube/v3/docs/channels/list) [playlistItems.list](https://developers.google.com/youtube/v3/docs/playlistItems/list) |
| [Search for videos related to a keyword](https://developers.google.com/youtube/v3/code_samples/ruby#search_by_keyword) | [search.list](https://developers.google.com/youtube/v3/docs/search/list)                                                                                            |
| [Upload a video](https://developers.google.com/youtube/v3/code_samples/ruby#upload_a_video)                            | [videos.insert](https://developers.google.com/youtube/v3/docs/videos/insert)                                                                                        |

You may also be able to adapt one of the other
[Ruby samples](https://github.com/googleapis/google-api-ruby-client/tree/main/samples).