Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

YouTube API to upload to Business Channel

Tags:

Is there any way of using the YouTube API so that users can upload videos directly to my business YouTube channel? Users would grant permission to upload to my channel on the website. I want to avoid uploading to another server, then to YouTube if possible. Thanks

like image 478
Allison Cairns Avatar asked Jan 22 '15 13:01

Allison Cairns


People also ask

Can I upload video to YouTube with API?

There are two ways to upload videos to YouTube. You can do it manually though the YouTube web application or you can do it programmatically though the YouTube data api. The YouTube data api has a cost based quota system.

Is YouTube data API free to use?

YouTube Data API costs are based on quota usage, and all requests will incur at least a 1-point quota cost. For each project, you're allowed 10,000 free quota units per day.

What can I do with YouTube API?

The API provides the ability to retrieve feeds related to videos, users, and playlists. It also provides the ability to manipulate these feeds, such as creating new playlists, adding videos as favorites, and sending messsages. The API is also able to upload videos.


1 Answers

You can use service account OAuth2 to authorize requests from your app on your behalf to a channel that your account is authorized to access/the owner of.

  1. Create service account credentials: (documentation here) and make sure the YouTube Data API v3 is enabled on your API project (getting started guide here, if you're new to the API).

  2. Use your service account OAuth credentials to call the upload API: (documentation here) use the auth in step 1 to upload the video your users share with you and specify your business YouTube channel ID in the video resource. Sample code in various languages here (just search for upload examples after you choose your preferred language).

Things to keep in mind:

  • If you enable uploads to your channel by end users but don't do any checking/validation there is potential for abuse
  • service account OAuth is valid for 1 year, so you'd need to refresh the service account credentials every year
  • It will look like these videos are being uploaded by your business channel and not other user's channels (because that's what's happening via the API).
like image 57
matthewayne Avatar answered Sep 28 '22 09:09

matthewayne