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

246
Views
Google Apps Script: YouTube search is not working with location parameter

I'm trying to pull some data using the YouTube Data API via Google Apps Script.

This is what I have done so far and it's working without any issue.

   var searchParameter = {
    q: 'javascript',
    maxResults: 50,
    type:'videos'
   }

   var results = YouTube.Search.list('id,snippet', searchParameter);

Now I want add location filter to this query. According to docs I added location and locationRadius parameters:

   var searchParameter = {
    q: 'javascript',
    maxResults: 50,
    type:'videos',
    location: "37.42307,-122.08427",
    locationRadius: "999km",
   }

   var results = YouTube.Search.list('id,snippet', searchParameter);

But after adding these 2 parameters, it's not working anymore and I'm getting following error:

{ [GoogleJsonResponseException: API call to youtube.search.list failed with error: Request contains an invalid argument.] details: { errors: [ [Object] ], message: 'Request contains an invalid argument.', code: 400 }, name: 'GoogleJsonResponseException' }.

I'm following this guide:

https://developers.google.com/youtube/v3/docs/search/list#location.

What am I doing wrong here?

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!