---
title: "YouTube"
description: "Publishing to YouTube via the Octopost API"
---

# YouTube

YouTube is a **video-only** platform -- no text-only or image-only posts. Send Octopost a video URL with your title and description, and Octopost handles the resumable upload protocol, video fetching, processing status, and hashtag-to-tag extraction automatically -- you just send us your content.

## Content Limits

| Field | Limit | Notes |
|---|---|---|
| Video title | **100 characters** | Parsed from the first line of `content`, or set explicitly in `platform_options` |
| Video description | **5,000 characters** | Remaining lines of `content` after the title |
| Tags | **500 characters** total | Octopost extracts these from hashtags in your content |
| Video file size | **256 GB** (or 12 hours) | Whichever limit is reached first |
| Supported formats | MP4, MOV, AVI, WMV, FLV, WebM, 3GP | |

## Good to Know

- **Your first line of content becomes the video title.** If you do not set a title explicitly in `platform_options`, Octopost uses the first line of your `content` field, truncated to 100 characters. The remaining lines become the description.
- **Hashtags in your content become YouTube tags.** Octopost extracts `#hashtags` and converts them into YouTube's tag field automatically.
- **Videos are not immediately live after upload.** YouTube needs processing time for transcoding and thumbnail generation. This can take anywhere from seconds to hours depending on length and resolution. Octopost reports upload success and notes that processing is ongoing.
- **YouTube Shorts are detected automatically.** If your video is vertical (9:16 aspect ratio) and 60 seconds or shorter, YouTube classifies it as a Short. There is no separate upload path -- you just upload a short vertical video. Adding `#Shorts` to your title or description can help ensure classification.
- **Community Posts are not available via the API.** YouTube has text-based Community Posts on the platform, but these cannot be created through the Data API.
- **Thumbnails must be set separately in YouTube Studio.** Custom thumbnails cannot be uploaded through Octopost at this time.
- **Monetization and age restrictions** must be configured directly in YouTube Studio -- they are not available via the API.

## Platform-Specific Features

### Privacy Settings

Control visibility by setting `privacy` in `platform_options`:

| Status | Description |
|---|---|
| `public` | Visible to everyone (default) |
| `unlisted` | Accessible via link only, not in search or recommendations |
| `private` | Visible only to the uploader and specified users |

### Title and Description

You can set the title explicitly, or let Octopost parse it from your content:

```json
{
  "platform_options": {
    "youtube": {
      "title": "Building APIs with Bun - Complete Guide",
      "privacy": "public",
      "category": "Science & Technology"
    }
  }
}
```

If no `title` is provided, Octopost uses the first line of `content` (truncated to 100 characters). The rest of `content` becomes the description.

### Tags

Octopost extracts hashtags from your content and converts them to YouTube tags. You can also provide tags explicitly:

```json
{
  "platform_options": {
    "youtube": {
      "tags": ["bun", "api", "tutorial", "javascript"]
    }
  }
}
```

### Category

YouTube uses numeric category IDs internally. Octopost lets you use human-readable names:

| Category | Examples |
|---|---|
| `Science & Technology` | Dev tutorials, tech reviews |
| `People & Blogs` | Vlogs, personal content |
| `Education` | Courses, how-tos |
| `Entertainment` | General content |

## Rate Limits

Octopost tracks YouTube's quota system for you. YouTube uses a **unit-based quota** rather than simple request counts:

| Operation | Cost |
|---|---|
| Video upload | **1,600 units** |
| Read operations | 1--5 units |

The default daily quota is **10,000 units**, which allows roughly **6 video uploads per day**. The quota resets at midnight Pacific time. If you hit the limit, Octopost reports it clearly so you know to wait or request a higher quota through Google Cloud Console.

## Things Octopost Handles for You

You do not need to worry about any of this, but in case you are curious:

- **Google OAuth 2.0 authentication.** Octopost manages the full Google OAuth flow, including the `youtube.upload` and `youtube` scopes. Token refresh is automatic.
- **Resumable upload protocol.** YouTube requires a multi-step resumable upload protocol for all video uploads. Octopost initializes the upload, fetches your video from the URL you provide, and streams it to YouTube with chunked transfer and retry capability if the connection drops.
- **Video fetching from URL.** You provide a video URL, Octopost fetches it and handles the upload to YouTube on your behalf.
- **Processing status polling.** After upload, YouTube needs time to process the video. Octopost polls for processing completion with a 3-minute timeout, then reports the final status.
- **Hashtag-to-tag extraction.** Octopost automatically parses hashtags from your content and converts them to YouTube's tag format, saving you from managing tags separately.
- **Category ID mapping.** YouTube uses numeric category IDs internally (e.g., 22 = People & Blogs, 28 = Science & Technology). Octopost maps human-readable category names to the correct IDs.
- **Error reporting.** If YouTube rejects the upload (quota exceeded, corrupt file, unsupported codec), Octopost translates the error into a clear message. Quota errors include a note that the quota resets at midnight Pacific.

## Example

```json
{
  "content": "New tutorial on building APIs with Bun\n\nIn this video we walk through setting up a REST API from scratch using Bun's built-in HTTP server. #bun #api #tutorial",
  "platforms": ["youtube"],
  "media": {
    "video": "https://example.com/tutorial.mp4"
  },
  "platform_options": {
    "youtube": {
      "privacy": "public",
      "category": "Science & Technology"
    }
  }
}
```

That's it. Octopost takes care of the rest.
