I've been using JupyterLab to take notes in class, we making simple calls with the youtube api and I was the only person that kept getting this error. For reference this is the code that causes the error
request = youtube.search().list(
part="snippet",
maxResults=5,
q="pewdiepie",
type="channel"
)
response = request.execute()
response
and this is the error message
---------------------------------------------------------------------------
HttpError Traceback (most recent call last)
Cell In[7], line 7
1 request = youtube.search().list(
2 part="snippet",
3 maxResults=5,
4 q="pewdiepie",
5 type="channel"
6 )
----> 7 response = request.execute()
8 response
File ~\pyenv\socialmining\Lib\site-packages\googleapiclient\_helpers.py:130, in positional.<locals>.positional_decorator.<locals>.positional_wrapper(*args, **kwargs)
128 elif positional_parameters_enforcement == POSITIONAL_WARNING:
129 logger.warning(message)
--> 130 return wrapped(*args, **kwargs)
File ~\pyenv\socialmining\Lib\site-packages\googleapiclient\http.py:938, in HttpRequest.execute(self, http, num_retries)
936 callback(resp)
937 if resp.status >= 300:
--> 938 raise HttpError(resp, content, uri=self.uri)
939 return self.postproc(resp, content)
HttpError: <HttpError 403 when requesting https://youtube.googleapis.com/youtube/v3/search?part=snippet&maxResults=5&q=pewdiepie&type=channel&key=AIzaSyBX-q53U3O7s61AtwOSegJsxG-ZtQvHiJE&alt=json returned "The request cannot be completed because you have exceeded your <a href="/youtube/v3/getting-started#quota">quota</a>.". Details: "[{'message': 'The request cannot be completed because you have exceeded your <a href="/youtube/v3/getting-started#quota">quota</a>.', 'domain': 'youtube.quota', 'reason': 'quotaExceeded'}]">
I am running jupyter in a virtual environment, still the teacher was also running it in a virtual environment and had no problem, as I said my quota is 0 on the API so I can't wrap my head around this.
Apparently when I went to enable the api I also enabled all other services, after disabling them everything worked, don't have a single clue how i managed to do that.