Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

242
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda