Quantcast
Channel: Active questions tagged youtube-api - Stack Overflow
Viewing all articles
Browse latest Browse all 3831

Request contains an invalid argument Location paramter Youtube API

$
0
0

Hi all im trying to make a simple python script that will return all videos created in a certain year near a ceratin latiude and longiute within 1km radius. however im getting this error saying Request contains an invalid argument when i use location paramter in the query.Anybody know how to fix this?

Request contains an invalid argument.

import googleapiclient.discoveryapi_service_name = "youtube"api_version = "v3"DEVELOPER_KEY = 'key'# API clientyoutube = googleapiclient.discovery.build(        api_service_name, api_version, developerKey = DEVELOPER_KEY)request = youtube.search().list(        part="id,snippet",        type='video',        videoDuration='short',        videoDefinition='high',        publishedAfter='2012-07-05T11:10:04Z',        publishedBefore='2013-07-05T11:10:04Z',        location='37.42307,-122.08427',        locationRadius='1km')response = request.execute()for item in response['items']:    # Getting the id    vidId = item['id']['videoId']    # Getting stats of the video    print("Publish date:",item ['snippet']['publishedAt'])

Viewing all articles
Browse latest Browse all 3831

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>