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".
The following are required body parameters. Please see the comments for requirements.
1
{
2
"post": "YouTube Description", // required: Video description
3
"platforms": ["youtube"], // required
4
"mediaUrls": ["https://images.ayrshare.com/imgs/test-video-1.mp4"], // required: URL of video, 1 allowed
5
"youTubeOptions": {
6
"title": "YouTube Title", // required: Video Title, max 100 characters
7
"youTubeVisibility": "private", // optional: "public", "unlisted", or "private" - default "private"
8
9
/** Important Thumbnail information below **/
10
"thumbNail": "https://images.ayrshare.com/imgs/GhostBusters.jpg", // optional: URL of a JPEG or PNG and less than 2MB. Extension must end in png, jpg, or jpeg
11
12
"playListId": "PLrav6EfwgDX5peD7Ni-pOKa7B13WjLyUB", // optional: Playlist ID to add the video.
13
"tags": ["dancing", "dogs"], // optional: list of tags, length limit 500 chars
14
"madeForKids": false, // optional: self declared made for kids. Default false.
15
"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.
16
}
17
}
Copied!
Note 1: The title must be 100 characters or less.
Note 2: 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.
Note 3: 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:
1
"shorts": true
Copied!
The #Shorts hashtag will be added to the YouTube description. The video must also be 60 seconds or less 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 1mo ago