Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

260
Views
Uploading a YouTube Video Using YouTube Data API V3 using Google API Client JavaScript

I visited the Youtube Data v3 API docs to know about how to upload videos using the client library

I got to this page

https://developers.google.com/youtube/v3/docs/videos/insert

but it doesn't seem to explain where to put the video in the request And Also API explorer just gives the code for request, it doesn't let me execute the code for that page

I also read the resource structure page but didn't find where to put the video

https://developers.google.com/youtube/v3/docs/videos#resource

here's my current code

let req = gapi.client.youtube.videos.insert({
  part: 'snippet,status',
  snippet: {
    title: "Test Video",
    description: "Test Description",
    categoryId: 28,
    defaultLanguage: 'en',
    defaultAudioLanguage: 'en'
  },
  status: {
    privacyStatus: "private"
  },
});
console.log(req)
try {
  req.execute(function (response) {
    console.log(response);
  });
} catch (e) {
  console.error(e);
}

Now, where do I put the video in the request? do I have to put that as buffer? I am fetching video from fetch API for uploading via API

and whenever I run the code I get the Error: 400 in the console

code: 400
data: [{…}]
error: {code: 400, data: Array(1), message: 'Request contains an invalid argument.'}
message: "Request contains an invalid argument."

so can you provide a working example of uploading a video using the client library that is fetched from the fetch API and show to structure the request body when using the client library?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!