YouTube
Using hosted SimplePost? See connection requirements. The credential setup below is for your own SDK, local CLI, or self-hosted integration.
SimplePost uploads videos to YouTube through the YouTube Data API v3. YouTube access is tied to a Google account and channel, so authenticate as the channel owner or a Brand Account manager.
Content support
Current hosted app and core source
| Capability | SimplePost support |
|---|---|
| Text / caption (characters) | 5,000 caption |
| Media | Video required; 1 video max; No mixed images/video |
| Video size | 256 GiB maximum |
| Video title | 100 characters maximum |
- Custom thumbnails cannot exceed 2 MB.
These validation limits also match published SDK 1.3.1.
Provider permissions and quotas still apply. SimplePost storage can impose a lower upload limit. MB/GB use decimal bytes; MiB/GiB use binary bytes.
When publishAt is set, SimplePost posts the video as private regardless of the supplied privacyStatus and lets YouTube flip it public at the scheduled time.
Playlist support
The current hosted app and core source reject playlistId with youtube_playlist_unavailable. Omit it and add the uploaded video to a playlist in YouTube Studio. Published SDK 1.3.1 (and local CLI 1.3.1) still attempts playlist insertion, which depends on the token's scopes and can fail after the video upload. Hosted-account CLI posts use the current app behavior. See release scope.
Set up credentials
The fastest managed path is the Scheduler app. For a local CLI account or direct SDK use, create your own Google project using the steps below, export its client ID and secret, and run simplepost account add youtube to complete OAuth locally.
1. Create or select a Google Cloud project
Open the Google Cloud Console and create or select a project dedicated to SimplePost.
2. Enable YouTube Data API v3
Open APIs & Services, find YouTube Data API v3, and enable it.
3. Configure OAuth consent
Configure the OAuth consent screen. Add upload scopes:
https://www.googleapis.com/auth/youtube.upload
https://www.googleapis.com/auth/youtube
Add yourself as a test user while the app is in testing mode.
4. Create OAuth client credentials
Create OAuth 2.0 Client ID credentials with application type Web application. Add the redirect URI used by your app or Scheduler deployment.
For local manual testing, a redirect URI like this is common:
http://localhost:3000/youtube
Save the Client ID and Client Secret.
5. Generate tokens
Run an OAuth authorization flow with access_type=offline and prompt=consent so Google returns a refresh token. Store the refresh token for long-lived uploads.
Environment variables
YOUTUBE_CLIENT_ID=
YOUTUBE_CLIENT_SECRET=
YOUTUBE_REFRESH_TOKEN=
All three variables must be set together. The shorter accessToken-only credential variant is supported through options.youtube.credentials.accessToken but not through env vars.
SDK options
await post({
content: {
media: [
{
type: "video",
path: "./video.mp4",
title: "Launch demo",
description: "A short demo",
},
],
},
platforms: ["youtube"],
options: {
youtube: {
privacyStatus: "unlisted",
tags: ["demo", "launch"],
categoryId: "22",
thumbnailPath: "./thumbnail.jpg",
selfDeclaredMadeForKids: false,
publishAt: "2030-01-01T12:00:00Z",
},
},
});
Common category IDs:
| ID | Category |
|---|---|
| 10 | Music |
| 20 | Gaming |
| 22 | People & Blogs |
| 23 | Comedy |
| 24 | Entertainment |
| 25 | News & Politics |
| 26 | Howto & Style |
| 27 | Education |
| 28 | Science & Technology |
Custom thumbnails can be supplied either on the video media item or in options.youtube. The YouTube option takes precedence:
await post({
content: {
media: [{ type: "video", path: "./video.mp4", title: "Launch demo" }],
},
platforms: ["youtube"],
options: {
youtube: {
thumbnailPath: "./thumbnail.jpg",
// or thumbnailUrl: "https://cdn.example.com/thumbnail.jpg"
},
},
});
For Scheduler API calls, upload the thumbnail first, then set the returned public URL in per-account options:
{
"accountOptions": {
"youtube-account-id": {
"thumbnailUrl": "https://cdn.example.com/thumbnail.jpg"
}
}
}
REST server account
Add this entry under accounts in the self-hosted REST server's accounts.json:
{
"id": "youtube-main",
"platform": "youtube",
"credentials": {
"clientId": "...",
"clientSecret": "...",
"refreshToken": "..."
},
"options": {
"privacyStatus": "public",
"categoryId": "22",
"thumbnailUrl": "https://cdn.example.com/thumbnail.jpg"
}
}