New TikTok Comment-to-DM is now on OnlySocialSend a DM to people who ask buying questions in your TikTok comments, automatically. See how it works
Network APIs

The YouTube API for uploading, scheduling and measuring videos

The OnlySocial YouTube API lets your app upload a video, schedule it, set its title, privacy and tags, post a first comment and read the channel's analytics, all with one workspace key. You skip the Google Cloud project, the OAuth consent screen and the quota maths, and the same calls also post to 15 other networks.

No Google Cloud projectYour customers connect their channel in OnlySocial. Your code never handles Google tokens, consent screens or refreshes.
Uploads that finishLarge files go up in chunks or from a URL, odd formats are converted, and a failed upload can be retried for that channel alone.
One API for 16 networksThe call that publishes to YouTube also sends a Reel to Instagram and a post to LinkedIn, each with its own text and options.

What the YouTube Data API asks of you

Google's own route is the YouTube Data API v3. To use it you create a Google Cloud project, switch on the API, set up an OAuth consent screen and ask each channel owner to sign in. Your app then stores and refreshes their tokens, uploads videos with the resumable upload protocol and handles every error Google sends back.

Two parts tend to slow teams down. The first is the YouTube API quota: every project gets a daily allowance, reads and writes are counted against it, and uploads have their own limit. The second is the compliance audit. A project that has not passed Google's compliance audit stays on the default quota, so a scheduler that works in testing can run out of room once real customers upload. Our YouTube API quota guide explains what each call costs and how to ask for more.

None of this is wrong, it is how Google keeps the platform safe. It just means a YouTube integration is a project of its own, and it has to be maintained as Google changes the rules. If YouTube is one of several networks you need, building each one directly multiplies that work.

  • A Google Cloud project, an OAuth consent screen and app verification
  • A daily YouTube API quota shared by every call your project makes
  • A compliance audit before uploads can be public
  • Token storage, refresh and revoked-access handling for every channel

Upload videos to YouTube with one request

With OnlySocial you upload videos to the media library first, as a file, in chunks for large files, or from a public URL that downloads in the background. MP4 and MOV go up as they are, and other formats are converted before they reach YouTube. Then one request to the posts endpoint names the YouTube channel, the video and the time to publish.

The YouTube settings travel in the post's options. Give the video a title of up to 100 characters, choose public, unlisted or private, mark it as made for kids when it is, and add up to 30 tags. The post's text becomes the description, up to 5,000 characters, and links in it can be shortened with your short link domain.

A video can also go out as a pre-recorded livestream: OnlySocial broadcasts the file as a live video on the channel, which suits premieres and replays of events.

  • Title up to 100 characters, required for every YouTube post
  • Privacy: public, unlisted or private
  • Made for kids, and up to 30 tags
  • Description up to 5,000 characters, from the post text

Video files, formats and thumbnails for the YouTube API

Media goes into the workspace media library before it is attached to a post, and the library takes three routes. Small files upload in one request. Large files upload in chunks, so a dropped connection costs one piece rather than the whole file. Or hand over a public URL and OnlySocial downloads the file in the background, which suits files that already sit in your storage bucket or CMS.

Each upload returns a media ID, and that ID is what goes in the post's media list. The same ID can be used in several posts and on several networks, so one file can go out everywhere without being uploaded again. Folders keep a busy library in order, and the media endpoints list, find and organise what is already there.

Each YouTube post takes exactly one video and no photos. MP4 and MOV files go up as they are; other formats are converted first. OnlySocial then sends the file to YouTube with its resumable upload, so a long video does not have to start again if the connection drops part way.

A cover frame chosen in the OnlySocial composer is uploaded as the thumbnail after the video. Links in the description are run through your short link domain when the post has one, which gives you click counts for the links in every video.

  • Single upload, chunked upload or upload from a public URL
  • One video per YouTube post, no photos
  • MP4 and MOV as they are, other formats converted
  • Resumable upload to YouTube for long videos

Worked example: a weekly lesson

A course platform stores each lesson in its own storage bucket. When a lesson is ready, it passes the file URL to the media upload endpoint, waits for the media ID and creates a post for the YouTube channel with the lesson title, privacy set to unlisted, five tags from the lesson record and a second content item linking back to the course page.

Schedule, queue and first comments

Every post can be published now, scheduled for a date and time in any timezone, or added to the next free slot of the workspace's posting queue. Scheduled videos appear on the same content calendar your team uses, so a video your system creates can still be checked and approved by a person before it goes live.

Add a second content item and OnlySocial posts it as the first comment once the video is up. It is a good place for chapters, a pinned link or a question that starts the conversation. YouTube does not allow comments on made-for-kids videos, so those publish without one.

If YouTube refuses an upload, the post shows YouTube's own error for that channel and the publishing failed webhook tells your system. You can retry that one channel without sending the post to the others again. Read the YouTube scheduler page for the same features in the app.

Repeat a video on a schedule

Give a post a repeat frequency and an end date and it publishes again on that rhythm, for example a weekly trailer until a launch.

Comments in the inbox

Where the inbox is enabled for your workspace, comments on your videos can reach the unified inbox, so your team answers them next to Instagram and TikTok comments. YouTube has no direct messages, so the YouTube side of the inbox is comments only.

YouTube analytics for your reports

The analytics endpoints read the channel's numbers without a second Google API. Overview gives subscribers, views, likes and comments for a period, each compared with the period before, and content and insights break results down by video. Post analytics return how one published video did.

The best time endpoint looks at your posts from the last 180 days and returns the weekdays and hours that did best, ready to pass back when you schedule the next video. Our social media analytics API page covers every network the analytics endpoints read.

  • Subscribers, views, likes and comments with period change
  • Per-video results and post analytics
  • Best times to publish, from your own history

Building a channel report

A reporting job reads the overview for subscribers, views, likes and comments, the content tab for the videos that did best and post analytics for each new upload. Give it a key with read scopes only, so the job can never publish by mistake.

What teams build on the YouTube API

Course and membership sites publish each new lesson as an unlisted video the moment it is ready, then switch it to public on launch day. The title, tags and description come straight from the lesson record, so nobody copies text between tools, and the first comment links back to the lesson page.

Agencies run many client channels from their own portal. The portal sends videos for approval, OnlySocial keeps them on each client calendar, and the YouTube analytics endpoints feed the monthly report. When a client revokes access, the disconnected webhook tells the portal to send them a reconnect link.

Ecommerce and media teams turn one recording into a week of posts: the full video to YouTube, a cut-down Reel to Instagram and a clip to TikTok, each with its own caption, in one request to the YouTube API and the other networks together. Developers building their own SaaS add YouTube publishing to their product without becoming experts in Google Cloud.

  • Lesson and course publishing from your own platform
  • Client portals with approvals and monthly reports
  • One recording, sent to YouTube and every short-video network

Errors, retries and reconnects for YouTube uploads

YouTube can refuse an upload that passed every check, for example when the channel has lost a permission or the file is rejected on YouTube's side. OnlySocial marks the post as failed for that channel, keeps YouTube's own error message on it and sends the publishing.post.publishing_failed webhook. The event is sent once per account, so you know exactly which channel needs attention.

Fix the cause and call the retry endpoint for that channel alone. Networks that already published are not posted again, so a Reel on Instagram does not appear twice because YouTube needed a second try.

When a channel owner revokes access or the connection can no longer be used, OnlySocial sends publishing.account.disconnected. Listen for it, pause new uploads for that channel and send the owner a reconnect link, or a Client Connect link for customer channels, before the next video is due.

  • publishing.post.publishing_failed, once per failed channel
  • Retry one channel without reposting to the others
  • publishing.account.disconnected when a channel must reconnect
  • A delivery log, test events and resends in the webhook hub

Checking webhook deliveries

The webhook hub keeps a delivery log for each endpoint. You can send a test event, resend a delivery your server missed and rotate the signing secret through the same API, so a short outage on your side does not mean lost events.

Quota and the YouTube API

When you publish through OnlySocial, uploads run on OnlySocial's Google project, so the YouTube API quota is not yours to track. If YouTube ever refuses an upload for quota reasons, the failure arrives like any other error, with YouTube's own message, and the post can be retried later for that channel alone.

Webhooks, keys and limits

Rather than polling, subscribe to webhooks. OnlySocial sends an event when a post is scheduled, when it is published on each account, when it is published everywhere and when publishing fails, plus when a channel loses its connection so you can ask the owner to reconnect.

Each workspace key starts with osk_ and carries scopes, so a reporting tool can read analytics without being able to publish. Keys allow 60 requests a minute, which covers scheduling a full week of videos for a channel in seconds. Our social media API page explains keys, scopes and the other APIs.

  • publishing.post.published and publishing_failed per channel
  • publishing.account.disconnected when a channel needs reconnecting
  • Scoped workspace keys, 60 requests a minute each

Wiring the YouTube API into your stack

A typical setup has three parts: a job that uploads videos and creates posts, a webhook endpoint that records each published video's link and flags failures, and a reporting job that reads YouTube analytics once a week. Each part uses its own workspace key with only the scopes it needs, so a leaked reporting key cannot publish.

Connect your customers to the YouTube API with the Partner API

If you build software for other businesses, your customers should not need an OnlySocial login to connect their YouTube accounts. The Partner API covers that side. From your backend you create a customer's account and their own workspace, sign them into OnlySocial from your app with single sign-on, and issue the workspace key your integration then uses for every YouTube API call.

The Client Connect API is the part your customers see. You create a connection for the provider youtube and get back a link that lasts 30 minutes. The customer opens it, signs in with Google and ticks the channels, and the account appears in their workspace ready to publish, and where the workspace has an inbox, to answer comments from. No YouTube token ever reaches your software or their browser.

When a sign-in expires, the same endpoint makes a reconnect link for that account. The account keeps its id, its scheduled posts and its history, and the customer must sign in as the same profile. A webhook, publishing.account.connection.completed or .failed with an error code, tells your code how it went, and an allowance call says whether the customer's plan has room for another account before you show a Connect button.

Both are switched on per partner, so read the Partner API docs and the Client Connect API docs, then ask us for access. White label plans that include the Partner API create the same keys in their own dashboard, and the connect pages carry their brand.

  • Create customers and workspaces from your backend
  • Single sign-on from your app into OnlySocial
  • Hosted connect and reconnect links for YouTube

Let an AI agent run your YouTube channel

The same actions are tools on the OnlySocial MCP server, so Claude, ChatGPT or Cursor can upload videos from your library, write the title and description, schedule them and report on last month's views when you ask in plain words. Actions you mark for approval wait for a person. The social media MCP server page shows how to connect an assistant.

Teams often mix both: code handles the steady jobs, such as publishing every new course lesson, and an assistant handles the one-off requests.

# Claude Code
claude mcp add --transport http onlysocial https://app.onlysocial.io/mcp

# Cursor: ~/.cursor/mcp.json
{
  "mcpServers": {
    "onlysocial": { "url": "https://app.onlysocial.io/mcp" }
  }
}

Start with the YouTube API in four steps

  1. Step 1

    Connect the channel

    Sign in with Google in OnlySocial and pick the YouTube channel. For customer channels, a Client Connect link does it without a dashboard login.

  2. Step 2

    Create a key

    In the workspace's API settings, create a key with the publishing scopes you need and keep the secret on your server.

  3. Step 3

    Upload videos

    Upload the video to the media library, then create a post with the YouTube title, privacy and tags in its options.

  4. Step 4

    Listen for results

    Subscribe a webhook to published and failed events, and read analytics when you build the report.

YouTube Data API directly or through OnlySocial

Both reach the same channel. The difference is how much of the plumbing you build and keep running yourself.

FeatureYouTube Data APIOnlySocial API
Google Cloud project and consent screenYou set them upNot needed
Daily quota and auditYours to manageHandled for you
Scheduling and posting queueNoYes
First comment after uploadSeparate callYes
Other networks in the same callNo15 more
Analytics in the same APISeparate APIYes

What OnlySocial customers say

Rated 4.4 out of 5 from 61 reviews on Trustpilot. Read every review

Best all in one Social Media Automation

I have agency tier. Onlysocial is the best all in one social media manager. … You can automate tasks, social media replies and comments as well as the option to post video, images, or even a selection of selected memes.

Giancarlo BianchiSpain · Jul 2024 on Trustpilot
OnlySocial is Truly a Blessing!!!

I switched to OnlySocial from a major competitor and I have had the best experience in the world. Their customer service is top tier and they're adding new features all the time. I'd recommend OnlySocial to anyone looking to automate their social media experience.

Alvin HillUnited States · Nov 2023 on Trustpilot
GOOD

Infinite accounts, API endpoint, all good.

Alessandro SmedileItaly · Apr 2026 on Trustpilot

YouTube API FAQ

Something else? The help and API docs cover every feature.

Is the YouTube API free?

Google does not charge for the YouTube Data API, but each project has a daily quota, and uploads need an audited project to be public. Through OnlySocial there is no quota for you to manage: API access comes with every OnlySocial plan.

How do I upload videos to YouTube with the API?

Upload the file to the media library, by file, in chunks or from a URL, then create a post for the YouTube account with a title and privacy in its options. Publish it now, schedule it, or add it to the queue. The API docs have the full request.

What happens to the YouTube API quota?

The YouTube API quota belongs to the Google project that makes the calls. When you publish through OnlySocial, the calls run on OnlySocial's project, so your app does not need its own quota or audit.

Can I post YouTube Shorts through the API?

There is no separate Shorts setting. A short vertical video is uploaded like any other video, and YouTube decides whether to show it as a Short.

Can I set a playlist, category or thumbnail?

Not through the API today. Playlists and categories are set in YouTube Studio. A cover frame chosen in the OnlySocial composer is uploaded as the thumbnail.

Which YouTube analytics can I read?

Subscribers, views, likes and comments for a period with the change from the period before, results per video, post analytics and your best times to publish.

Can an AI assistant use the YouTube API for me?

Yes. Connect Claude, ChatGPT or another MCP app to the OnlySocial MCP server and ask it to schedule videos or summarise views. It uses the same actions as the API.

How do I upload large videos with the YouTube API?

Use the chunked upload, or pass a public URL and let OnlySocial download the file in the background. OnlySocial then sends it to YouTube with a resumable upload.

What happens when a YouTube upload fails?

The post shows YouTube's own error for that channel and the publishing.post.publishing_failed webhook fires. Fix the cause and retry that channel alone.

Can I answer YouTube comments through OnlySocial?

Where the inbox is enabled for your workspace, video comments can reach the unified inbox. YouTube has no direct messages, so there are no DMs to read.

Publish to YouTube from your own code

Connect a channel, create a key and send your first video today. The same YouTube API call reaches Instagram, TikTok, LinkedIn and 12 more networks when you are ready.

Scroll to Top