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

Missing a Valid API Key for Youtube Data API v3 using Python

$
0
0

I was trying to work with the Youtube API to collect video statistics from a channel (that I don't own) using the requests python library to make an API call and save it as a pandas dataframe.

# Import librariesimport requestsimport pandas as pd#  Keysapi_key = "Key generated by Google for me"channel_id = "ID of any YouTube channel I want to explore" # make API callss_url = "https://www.googleapis.com/youtube/v3/search?key="+api_key+"&channelId="+channel_id+"&part=snippet,id&order=date&maxResults=500"ss_response = requests.get(ss_url).json()ss_response

Each time I execute the above Python code it returns the following message:

{'error': {'code': 403,
'errors': [{'domain': 'global',
'message': 'The request is missing a valid API key.',
'reason': 'forbidden'}],
'message': 'The request is missing a valid API key.',
'status': 'PERMISSION_DENIED'}}

Can anybody help me resolve this error, please?


Viewing all articles
Browse latest Browse all 3645

Trending Articles



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