# YouTube

Formats, media and text limits, options, inbox and analytics on YouTube.

Publish `video` and `short` to YouTube, read every post's numbers, and answer comments. Set a target's `format`, or leave it out and Rizamo picks one from the files.

## Formats [#formats]

| Format | Files | Text |
| --- | --- | --- |
| `video` | 1 video | 5,000 |
| `short` | 1 video | 5,000 |

## Media [#media]

Rizamo takes JPEG, PNG, WebP, MP4 and MOV files up to 4 GB. What YouTube takes:

- **Images:** JPEG or PNG, up to 2 MB.
- **Video:** H.264, HEVC, VP9 or AV1 with AAC or Opus audio, 1 to 60 frames a second, up to 3,840 px wide; `short` only vertical (taller than wide).

| Format | Length | Size |
| --- | --- | --- |
| `short` | 1 s to 3 min | up to 4 GB |
| `video` | 1 s to 12 h | up to 4 GB |

## What Rizamo does to files [#what-rizamo-does-to-files]

- **Images:** another type becomes JPEG or PNG; a larger file is compressed under 2 MB.
- **Video:** one YouTube does not take as it is (its codec, frame rate, width or size) is converted to H.264 and AAC within those limits. Its length cannot change: a video too short or too long for the format is refused when it is attached, as is a wide video for `short`.
- Your file itself never changes: the copy is made when the post goes out, and each target's `changes` says what was done.

## Text [#text]

- Up to 5,000, counted in bytes in UTF-8: an accented letter counts 2. Rizamo counts the same way, so `POST /v1/posts/validate` refuses what YouTube would.
- The text is the video's description; its title is `options.youtube.title`, or the text's first line, cut at 100 characters.

## Options [#options]

Under `options.youtube` on a target. Each says which formats take it.

| Option | Type | What it does |
| --- | --- | --- |
| `title` | string | The video's title, 1 to 100 characters, without \< or \>. Left out: the text's first line, cut at 100 characters. The text is the description. |
| `privacy` | `public`, `unlisted`, `private` | Who can watch it: public (YouTube's default when left out), unlisted or private. With `publishAt`, private. |
| `madeForKids` | boolean | Whether the video is made for kids (YouTube's audience setting, COPPA). Required to schedule or publish, with no default: ask the person. Made for kids turns off comments and personalized ads on YouTube. |
| `tags` | array of string | Keywords, at most 500 characters in all as YouTube counts them (a comma between tags, quotes around a tag with a space). |
| `categoryId` | string | YouTube's video category id, such as 22 (People & Blogs) or 28 (Science & Technology). Left out, YouTube picks the channel's default. |
| `publishAt` | string | When YouTube makes the video public, after Rizamo uploads it as private at the post's time (YouTube's own scheduling). In the future, and with `privacy` private or left out. To have Rizamo upload it later instead, schedule the post. |
| `isAiGenerated` | boolean | Discloses realistic altered or synthetic content (YouTube's `containsSyntheticMedia`). |
| `thumbnailMediaId` | string | An image to use as the thumbnail (JPEG or PNG, up to 2 MB), set once the video is live. YouTube takes custom thumbnails only from channels it has verified. |
| `notifySubscribers` | boolean | Whether YouTube tells subscribers about the video. Left out: yes, YouTube's default. |
| `license` | `youtube`, `creativeCommon` | The video's license: youtube (the standard YouTube license, the default) or creativeCommon. |
| `embeddable` | boolean | Whether other sites may embed it. Left out: yes, YouTube's default. |

## First comment [#first-comment]

Rizamo does not comment on YouTube videos yet: a post with a `firstComment` for a YouTube channel is refused (`400`).

## After publishing [#after-publishing]

- **Edits:** Rizamo does not edit YouTube videos yet: an update to a live post is `not_supported`.
- **Deleting:** deleting a post takes it off YouTube when the account's `capabilities` include `delete_posts`. Each target's `removal` says what happened.

## Inbox [#inbox]

Comments on every video of the channel are read for the whole channel at once: every 30 minutes while its newest video is under 48 hours old, hourly while it is under 14 days, every 6 hours after. They are answered as the channel, under the first comment of a thread.

- Replies to comments: up to 2,000 characters. They go out in the background: a reply is `sending`, then `sent` or `failed`.
- Messages: none. YouTube has no messages.
- Up to 50 replies a channel a day.
- Comments YouTube holds for review are not read: approve them in YouTube Studio.

| Action | People's comments | The account's own |
| --- | --- | --- |
| Hide | no | no |
| Delete | no | no |
| Like | no | no |

## Comment automations [#comment-automations]

Comment automations work on Instagram accounts and Facebook Pages only.

## Daily caps [#daily-caps]

YouTube takes up to 200 uploads a day, shared by every app on the Google project Rizamo uses, counted in Pacific days: one past them fails with the reason, to try again after midnight Pacific.

## Analytics [#analytics]

Days run on Pacific time (`America/Los_Angeles`). Views, likes and comments are read from a post's first hour; its other numbers come up to 72 hours late. On connecting, Rizamo reads back the posts of the last 12 months (up to 200) and 365 days of the account's numbers. [How Rizamo reads numbers](/analytics).

### Posts [#posts]

| Metric | YouTube's name | Formats | Note |
| --- | --- | --- | --- |
| `views` | `viewCount` | all |  |
| `engaged_views` | `engagedViews` | all | Where YouTube gives it |
| `likes` | `likeCount` | all |  |
| `comments` | `commentCount` | all |  |
| `watch_time` | `estimatedMinutesWatched` | all |  |
| `avg_watch_time` | `averageViewDuration` | all |  |
| `shares` | `shares` | all |  |
| `follows` | `subscribersGained` | all |  |

Its posts' details, what is not a count (a post's `details`, the latest read only: [Details](/analytics#details)):

| Detail | YouTube's name | Formats | Note |
| --- | --- | --- | --- |
| `avg_view_percentage` | `averageViewPercentage` | all |  |
| `traffic_sources` | `insightTrafficSourceType` | all |  |
| `retention` | `audienceWatchRatio` | all |  |

### Account [#account]

| Metric | YouTube's name | Note |
| --- | --- | --- |
| `views` | `views` |  |
| `views_followers` | `views` by `subscribedStatus` (`SUBSCRIBED`), for some accounts only | Where YouTube gives it |
| `views_non_followers` | `views` by `subscribedStatus` (`UNSUBSCRIBED`), for some accounts only | Where YouTube gives it |
| `views_short` | `views` by `creatorContentType` (`SHORTS`) | Where YouTube gives it |
| `views_video` | `views` by `creatorContentType` (`VIDEO_ON_DEMAND`) | Where YouTube gives it |
| `views_live` | `views` by `creatorContentType` (`LIVE_STREAM`) | Where YouTube gives it |
| `likes` | `likes` |  |
| `comments` | `comments` |  |
| `shares` | `shares` |  |
| `follows` | `subscribersGained` |  |
| `unfollows` | `subscribersLost` |  |
| `watch_time` | `estimatedMinutesWatched` |  |

Its audience: its viewers this month (last month until the 8th), by age, gender and country.

No `reach`, `engagements`, `saves` or `clicks` on its posts.
