Links

YouTube

Options for posting via the API to YouTube

YouTube API Endpoint

Overview

YouTube posting requires your YouTube account to have at least one Channel. To create a YouTube Channel, click on you profile in the YouTube Dashboard and choose "Create a Channel".
Posting to YouTube requires the youTubeOptions object with at least a title set. The title is the only required field. For example, to post a YouTube video with default settings:
{
"post": "My Best YouTube Description", // required: Video description
"platforms": ["youtube"], // required
"mediaUrls": ["https://img.ayrshare.com/012/vid.mp4"], // required: URL of video, 1 allowed
"youTubeOptions": {
"title": "Your Best Title" // required: Video Title, max 100 characters. Must be 100 characters or less.
}
}
There are several other optional fields listed below, including the video visibility, tags, and publishAt date. Please see the comments for requirements and descriptions.
{
"post": "My Best YouTube Description", // required: Video description
"platforms": ["youtube"], // required
"mediaUrls": ["https://img.ayrshare.com/012/vid.mp4"], // required: URL of video, 1 allowed
"youTubeOptions": {
"title": "Your Best Title", // required: Video Title, max 100 characters. Must be 100 characters or less.
"visibility": "private", // optional: "public", "unlisted", or "private" - default "private".
// Important Thumbnail information below
"thumbNail": "https://img.ayrshare.com/012/gb.jpg", // optional: URL of a JPEG or PNG and less than 2MB. Extension must end in png, jpg, or jpeg
"playListId": "PLrav6EfwgDX5peD7Ni-pOKa7B13WjLyUB", // optional: Playlist ID to add the video.
"tags": ["dancing", "dogs"], // optional: array of tags, length limit 400 characters combined. E.g. ["abc", "12"] is characters length 5. Must be at least 2 characters long.
"madeForKids": false, // optional: self declared made for kids. Default false.
"shorts": true, // optional: Post the video as a "Shorts". Video duration must be 60 seconds on less. Will add the #Shorts hashtag to the description.
"notifySubscribers": true, // optional: Default: true. Whether YouTube should send a notification about the new video to users who subscribe to the video's channel.
// optional: You may specify a time to publish on YouTube. The video will be sent to YouTube. Visibility automatically set to "private".
// Format: Accepts a UTC datetime. For example, use format "YYYY-MM-DDThh:mm:ssZ" and send as "2023-07-08T12:30:00Z".
"publishAt": "2022-10-08T21:18:36Z"
}
}
The title must be 100 characters or less. The post must be 5,000 characters or less. The post and title may contain any characters except < and >.
The Playlist Id can be found by opening the playlist in a browser and copying the value after list=. The authenticated user and channel must be the owner of the playlist to add videos.
If your video doesn't end in a known video extension such as mp4, please use the isVideo parameter. See the /post endpoint for details.

YouTube Shorts

You can post a YouTube Shorts video by adding the shorts parameter to the youTubeOptions:
"shorts": true
The #Shorts hashtag will be added to the YouTube description. The video must also be 60 seconds or less and have a square or vertical aspect ration to be considered a short.
Additional information on using the API to post YouTube Shorts.

YouTube Thumbnails

Thumbnails and other features, such as uploading 15 minute videos, require verification of your phone number. Thumbnails must be less than 2 MB in size.
In "YouTube Studio" go to "Setting" -> "Channel". Select "Feature Eligibility" and click "Features that require phone verification". Enter your phone number to enable.

Video: Posting to YouTube via the API

How to Post via the API
Last modified 13d ago