YouTube posting requires your YouTube account to have at least one Channel and be an owner on the Channel. To create a YouTube Channel, click on you profile in the YouTube Dashboard and choose “Create a Channel”. You may also use this direct link to create a YouTube Channel: http://m.youtube.com/create_channel

If you’re having issues viewing YouTube channels please see the troubleshooting guide.

Posting to YouTube requires the youTubeOptions object with at least a title set. The title is the only required field and can use autogenerated with the transcribe endpoint.

For example, to post a YouTube video with default settings:

{
  // Required: Video description
  "post": "My Best YouTube Description",

  // Required: Platform to post to
  "platforms": ["youtube"],

  // Required: URL of video (only 1 allowed)
  "mediaUrls": ["https://img.ayrshare.com/012/vid.mp4"],

  "youTubeOptions": {
    // Required: Video title (max 100 characters)
    "title": "Your Best Title"
  }
}

There are several other optional fields listed below, including the video visibility, tags, and publishAt date. Please see the comments for requirements and descriptions.

{
  // Required fields
  "post": "My Best YouTube Description", // Video description
  "platforms": ["youtube"], // Platform to post to
  "mediaUrls": ["https://img.ayrshare.com/012/vid.mp4"], // URL of video (1 allowed)

  "youTubeOptions": {
    // Required fields
    "title": "Your Best Title", // Video Title (max 100 characters)

    // Optional fields
    "visibility": "private", // "public", "unlisted", or "private" (default: "private")

    // Thumbnail settings
    "thumbNail": "https://img.ayrshare.com/012/gb.jpg", // JPEG/PNG URL under 2MB, must end in png/jpg/jpeg

    // Video organization
    "playListId": "PLrav6EfwgDX5", // Playlist ID to add the video
    "tags": ["dancing", "dogs"], // Tag array (400 chars total, 2+ chars each)

    // Video settings
    "madeForKids": false, // Self-declared kids content (default: false)
    "shorts": true, // Post as YouTube Short (max 60s, adds #Shorts)
    "notifySubscribers": true, // Send notification to subscribers (default: true)
    "categoryId": 24, // Video category (24 = Entertainment)

    // Scheduling
    "publishAt": "2022-10-08T21:18:36Z" // UTC publish time (sets visibility to private)
  }
}

⮕ 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 object.

"shorts": true

The #Shorts hashtag will be added to the YouTube description.

Sending a video as a Short is an indication to YouTube that you would like the video to appear as a Short, but does not guarantee it will appear as a Short. The video must meet the Short video requirements, such as being 60 seconds or less and vertical aspect ratio of 9:16 to be considered a Short by YouTube.

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. A thumbNail is a URL of a JPEG or PNG and less than 2MB in size. Extension must end in png, jpg, or jpeg.

{
  "thumbNail": "https://img.ayrshare.com/012/gb.jpg"
}

YouTube Shorts do not currently support thumbnails.

Enable Thumbnails in YouTube Studio

You must be granted YouTube permissions to post thumbnails. In YouTube Studio go to Settings->Channel. Select “Feature Eligibility” and click “Features that require phone verification”. Enter your phone number to enable.

YouTube may take up to 24 hours to enable thumbnails after you verify your phone number. Please note, YouTube determines eligibility for adding thumbnails. “Enabled” phone verification does not guarantee YouTube will allow thumbnail uploads.

If you have been verified for 24 hours and still have issues check that:

  1. You are able to manually upload thumbnails in YouTube Studio.
  2. If you’re working with a Brand Content Owner Account (often used for business or organization channels), make sure you have the necessary permissions. We recommend “Owner” rights.
  3. If you are still having issues, please see this video on solving the Thumbnail issue.

Video: Posting to YouTube via the API

Upload Limits

YouTube limits how many videos a channel can upload in a 24-hour period via the YouTube API.

  • Depending on a creator’s location, a channel might be able to increase their daily limit by getting access to advanced features. To learn more visit this article.
  • Limits may vary by country/region or channel history. Copyright strikes may impact channel history eligibility and Community Guidelines strikes will affect how much a channel can upload.

If you receive and upload limit error please wait and try again in 24 hours.

You must activate Advanced Features in YouTube Studio to have clickable links in the YouTube video description.

Go to YouTube Studio -> Settings -> Channel -> Feature Eligibility -> Advanced Features -> Access Features to activate the advanced features.

Playlists

You can add videos to a playlist by including the playListId in the youTubeOptions object. Be sure that the authenticated user and channel are the owner of the playlist.

{
  "youTubeOptions": {
    "playListId": "PLrav6EfwgDX5"
  }
}

Subtitles / Captions for Videos

You can add subtitles, also known as captions, to videos by including an SRT file or a YouTube SBV file. Use the subTitleUrl field in the youTubeOptions object to specify the URL to your SRT or SBV file.

{
  "youTubeOptions": {
    "title": "My new post from Ayrshare to Youtube",
    "subTitleUrl": "https://img.ayrshare.com/012/captions.srt",
    "subTitleLanguage": "en",
    "subTitleName": "English"
  }
}
  • subTitleUrl: A valid SRT or SBV file. The URL must start with https:// and end in .srt or .sbv and be a valid SRT or SBV file. The file must be under 100 MB.
  • subTitleLanguage: Optional: The language of the subtitles. Much be a valid language code. Default: “en”.
  • subTitleName: Optional: The name of the caption track. The name is intended to be visible to the user as an option during playback. The maximum name length supported is 150 characters. Default: “English”.

What are SRT and SBV files?

SRT (SubRip Subtitle) and SBV (YouTube SubViewer) are subtitle file formats used for displaying timed text in videos. The main difference is that SRT uses timestamps in HH:MM:SS,MS format with arrow separators, while SBV uses HH:MM:SS.MS format with commas.

## SRT Format Example
1
00:00:01,000 --> 00:00:04,000
Welcome to our tutorial on subtitle formats.

2
00:00:04,500 --> 00:00:08,000
Today we'll learn about SRT and SBV files.

## SBV Format Example
0:00:01.000,0:00:04.000
Welcome to our tutorial on subtitle formats.

0:00:04.500,0:00:08.000
Today we'll learn about SRT and SBV files.

Tags

You can add tags to your videos by including the tags array in the youTubeOptions object. Tags must be at least 2 characters in length each and the total length of all tags must be 400 characters or less.

{
  "youTubeOptions": {
    "tags": ["dancing", "dogs"]
  }
}

Additional Endpoints

Get YouTube Categories