# YouTube

Upload, find, update and rate YouTube videos, manage playlists and their videos, update your channel, and read, post or reply to comments.

## Connect YouTube

1. In the sidebar, open **Connections** and press **Add connection**.
2. Type `youtube` and choose **YouTube**.
3. Press **Sign in with Google**.
4. Choose your account in Google’s window and allow access.

You should see **Signed in as** and the account’s address.

You can also connect from a step: under **Connection**, press **New**.

**What if it says “Google sign-in isn’t set up here”?**

This installation has no Google app yet. An admin of the installation sees **Set up Google sign-in** instead, and sets it up once for everyone:

1. In Google Cloud, create an OAuth client of type **Web application**, and turn on the API for YouTube.
2. In GoRunner, copy the **Redirect address to add in Google Cloud**, and add it to the client.
3. Paste the **Client ID** and **Client secret**, then press **Save and sign in**.

Publish the app in Google Cloud. An app left in Testing signs everyone out after 7 days.

Everyone else sees who to ask.

[Set up Google sign-in for connections](https://docs.gorunner.io/self-host/oauth-apps)

**Can I use my own Google app?**

Yes. In the sheet, open **Use your own Google app** and paste its **Client ID** and **Client secret**. Add the **Redirect address to add in Google Cloud** to your app first. The connection then signs in through your app instead of the installation’s.

[Connections](https://docs.gorunner.io/build/connections) says how to sign in again, rename or delete it. In a product that embeds GoRunner, **Add connection** can be missing: then [your provider makes connections](https://docs.gorunner.io/embed/customer-connections) for you.

## Do things in YouTube

Add a **YouTube** step, choose a **Resource**, then an **Operation**. Choose a row to see its fields.

- [Video](https://docs.gorunner.io/apps/youtube#fields-f-video): Upload · Get · Search · Update · Rate · Delete
- [Playlist](https://docs.gorunner.io/apps/youtube#fields-f-playlist): Create · Get · Get Many · Update · Delete
- [Playlist Item](https://docs.gorunner.io/apps/youtube#fields-f-playlistitem): Add · Get · Get Many · Delete
- [Channel](https://docs.gorunner.io/apps/youtube#fields-f-channel): Get · Get Many · Update · Upload Banner
- [Video Category](https://docs.gorunner.io/apps/youtube#fields-f-videocategory): Get Many
- [Comment](https://docs.gorunner.io/apps/youtube#fields-f-comment): Get Many · Create · Reply · Delete

To start a workflow from YouTube, use a [Schedule](https://docs.gorunner.io/apps/schedule), [Webhook](https://docs.gorunner.io/apps/webhook) or [Form](https://docs.gorunner.io/apps/form) trigger.

Later steps read a step’s output by its name: see [Use data from earlier steps](https://docs.gorunner.io/build/use-data-from-earlier-steps).

## Limits

- A reply from YouTube can be up to 16 MB (a file download can have its own limit). A larger one fails the step; it is never cut short.
- When YouTube says to slow down (429), the step waits as long as it asks, if the step’s time allows. Otherwise it fails and says when to try again.

Not in your list? See [When an app isn’t here](https://docs.gorunner.io/apps/when-an-app-isnt-here#q-not-in-list).

## For developers

In the API, which calls apps pieces, YouTube is `pieceId: "youtube"` with `actionId: "youtube"`, set by `resource` and an `operation_…` field, such as `operation_channel`. [Get an app](https://docs.gorunner.io/api/apps/get-app) returns every field.

It can change something outside the run (`writes_external`). See [How versions and side effects work](https://docs.gorunner.io/apps#q-versions).

### YouTube › Video

### Upload

- **Video File · Required**: Upload a file, or switch to an expression to use one from an earlier step (such as {{steps.download.result}}). Any format YouTube takes (MP4, MOV, WebM …).
- **Title · Optional**: The video's title (at most 100 characters). Required to upload; on Update, empty keeps it.
- **Description · Optional**: At most 5,000 bytes. On Update, empty keeps it.
- **Tags · Optional**: Separated by commas. On Update, these replace the video's tags; empty keeps them.
- **Category · Optional**: The video category. On Update, empty keeps it.
- **Visibility · Optional**: Who can watch it. A new upload is private unless you pick another; on Update, empty keeps it. Options: Private, Unlisted, Public.
- **Publish At · Optional**: Make a private video public at this time. Only for a video that has never been public.
- **Made for Kids · Optional**: Your declaration under YouTube's rules for content made for children. Empty leaves it for YouTube Studio to ask. Options: Yes, No.
- **Allow Embedding · Optional**: Whether other sites may embed it. Empty keeps YouTube's setting. Options: Yes, No.
- **Show Statistics · Optional**: Whether the watch page shows its statistics. Empty keeps YouTube's setting. Options: Yes, No.
- **License · Optional**: Empty keeps YouTube's setting. Options: Standard YouTube license, Creative Commons – Attribution.
- **Language · Optional**: The language of the title and description (a BCP-47 code such as en or de-CH).
- **Recording Date · Optional**: When it was recorded.
- **Notify Subscribers · Optional**: Tell the channel's subscribers about the new video. On by default.

### Get and Delete

- **Video · Required**: The video's link or id.

### Search

- **Search Text · Optional**: Words to search for. Search allows 100 calls a day per Google Cloud project (each page of 50 is one).
- **Only My Videos · Optional**: Search only the signed-in channel's videos (Duration and Type cannot be combined with it). Off by default.
- **Channel · Optional**: Only videos of this channel (its id UC… or link).
- **Published After · Optional**
- **Published Before · Optional**
- **Region · Optional**: Results for viewers in this country (ISO 3166-1 alpha-2).
- **Category · Optional**: The video category. On Update, empty keeps it.
- **Duration · Optional**: Empty finds any length. Options: Under 4 minutes, 4 to 20 minutes, Over 20 minutes.
- **Type · Optional**: Empty finds every kind. Options: Show episodes, Movies.
- **Order · Optional**: Options: Best match, Newest first, Most viewed, Highest rated, Title (A–Z). Default: Best match.
- **Safe Search · Optional**: Options: Off, Moderate, Strict. Default: Moderate.
- **Return All · Optional**: Read every video, page by page (at most 250; past that the step fails rather than stop early). Off by default.
- **Limit · Optional**: How many videos to return (1–250). Default: 25. Shows when **Return All** is off.

### Update

- **Video · Required**: The video's link or id.
- **Title · Optional**: The video's title (at most 100 characters). Required to upload; on Update, empty keeps it.
- **Description · Optional**: At most 5,000 bytes. On Update, empty keeps it.
- **Tags · Optional**: Separated by commas. On Update, these replace the video's tags; empty keeps them.
- **Category · Optional**: The video category. On Update, empty keeps it.
- **Visibility · Optional**: Who can watch it. A new upload is private unless you pick another; on Update, empty keeps it. Options: Private, Unlisted, Public.
- **Publish At · Optional**: Make a private video public at this time. Only for a video that has never been public.
- **Made for Kids · Optional**: Your declaration under YouTube's rules for content made for children. Empty leaves it for YouTube Studio to ask. Options: Yes, No.
- **Allow Embedding · Optional**: Whether other sites may embed it. Empty keeps YouTube's setting. Options: Yes, No.
- **Show Statistics · Optional**: Whether the watch page shows its statistics. Empty keeps YouTube's setting. Options: Yes, No.
- **License · Optional**: Empty keeps YouTube's setting. Options: Standard YouTube license, Creative Commons – Attribution.
- **Language · Optional**: The language of the title and description (a BCP-47 code such as en or de-CH).
- **Recording Date · Optional**: When it was recorded.

### Rate

- **Video · Required**: The video's link or id.
- **Rating · Required**: Options: Like, Dislike, Remove my rating. Default: Like.

### YouTube › Playlist

### Create

- **Title · Optional**: The playlist's title (at most 150 characters). Required to create; on Update, empty keeps it.
- **Description · Optional**: At most 5,000 bytes. On Update, empty keeps it.
- **Visibility · Optional**: Who can see it. A new playlist is private unless you pick another; on Update, empty keeps it. Options: Private, Unlisted, Public.
- **Tags · Optional**: Separated by commas. On Update, these replace the playlist's tags; empty keeps them.
- **Language · Optional**: The language of the title and description (a BCP-47 code).

### Get and Delete

- **Playlist · Required**: The playlist.

### Get Many

- **Channel · Optional**: Another channel's public playlists (its id UC… or link). Empty lists the signed-in channel's own, private ones included.
- **Return All · Optional**: Read every playlist, page by page (at most 1000; past that the step fails rather than stop early). Off by default.
- **Limit · Optional**: How many playlists to return (1–1000). Default: 50. Shows when **Return All** is off.

### Update

- **Playlist · Required**: The playlist.
- **Title · Optional**: The playlist's title (at most 150 characters). Required to create; on Update, empty keeps it.
- **Description · Optional**: At most 5,000 bytes. On Update, empty keeps it.
- **Visibility · Optional**: Who can see it. A new playlist is private unless you pick another; on Update, empty keeps it. Options: Private, Unlisted, Public.
- **Tags · Optional**: Separated by commas. On Update, these replace the playlist's tags; empty keeps them.
- **Language · Optional**: The language of the title and description (a BCP-47 code).

### YouTube › Playlist Item

### Add

- **Playlist · Required**: The playlist.
- **Video · Required**: The video's link or id.
- **Position · Optional**: Where it goes: 1 is first. Empty adds it at the end.
- **Note · Optional**: A note shown with the video in the playlist (at most 280 characters).

### Get and Delete

- **Playlist Item ID · Required**: The item's id in the playlist (id in Get Many's items: not the video's id).

### Get Many

- **Playlist · Required**: The playlist.
- **Return All · Optional**: Read every playlist item, page by page (at most 1000; past that the step fails rather than stop early). Off by default.
- **Limit · Optional**: How many playlist items to return (1–1000). Default: 50. Shows when **Return All** is off.

### YouTube › Channel

### Get

- **Channel · Optional**: The channel's id (UC…), @handle or link. Empty is the signed-in account's own channel.

### Get Many

- **Channel IDs · Optional**: Channel ids (UC…), separated by commas. Empty, with no Username, lists the signed-in account's channels.
- **Legacy Username · Optional**: A channel's old YouTube username (not its @handle).
- **Return All · Optional**: Read every channel, page by page (at most 1000; past that the step fails rather than stop early). Off by default.
- **Limit · Optional**: How many channels to return (1–1000). Default: 50. Shows when **Return All** is off.

### Update

- **Description · Optional**: The channel's description (at most 1,000 characters). Empty keeps it.
- **Keywords · Optional**: Separated by spaces; put a phrase in double quotes. Empty keeps them.
- **Country · Optional**: Where the channel is based (two letters). Empty keeps it.
- **Language · Optional**: The language of the channel's title and description. Empty keeps it.
- **Trailer for New Visitors · Optional**: The video (link or id) shown to visitors who have not subscribed. Empty keeps it.

### Upload Banner

- **Banner Image · Required**: Upload a file, or switch to an expression to use one from an earlier step (such as {{steps.download.result}}). JPEG or PNG, 16:9, at least 2048 × 1152 (2560 × 1440 recommended), at most 6 MB.

### YouTube › Video Category

### Get Many

- **Region · Required**: The country whose categories to list (two letters). Default: US.
- **Return All · Optional**: Read every category, page by page (at most 100; past that the step fails rather than stop early). Off by default.
- **Limit · Optional**: How many categorys to return (1–100). Default: 50. Shows when **Return All** is off.

### YouTube › Comment

### Get Many

- **Video · Required**: The video's link or id.
- **Order · Optional**: Options: Newest first, Top comments. Default: Newest first.
- **Containing · Optional**: Only comments holding these words.
- **Return All · Optional**: Read every comment thread, page by page (at most 1000; past that the step fails rather than stop early). Off by default.
- **Limit · Optional**: How many comment threads to return (1–1000). Default: 50. Shows when **Return All** is off.

### Create

- **Video · Required**: The video's link or id.
- **Text · Required**: The comment (at most 10,000 characters).

### Reply

- **Reply To · Required**: The id of the comment (or comment thread) to reply to.
- **Text · Required**: The comment (at most 10,000 characters).

### Delete

- **Comment ID · Required**: The comment's id. Only the comment's author, or the video's owner, can delete it.

Source: https://docs.gorunner.io/apps/youtube
