Forums

Whitelisted api still returning ProxyError

My code uses an API from genius.com to extract web info. I have checked the list of whitelisted sites and the genius api is whitelisted. For some reason whenever I run my code, I am getting a ProxyError and "OSError: Tunnel connection failed: 403 forbidden." Also, if it helps narrow down the problem, I am using an api request twice for genius. It works successfully the first time. But it won't go through the second time, in which I use a library called lyricsgenius to web-scrape some info. I have checked the library, and it too only uses the genius api. Does anyone know what is causing this? Is this from the API request or could it be from something else? It works fine when I run the code locally.

See the part about setting proxy details here. Maybe that library isn't automatically using the proxy.

I am also getting the same error with genius

What is the specific hostname that you're using to connect to it?

My bad, i was using lyricsgenius which connects to genius.com and not api.genius.com. Thanks for pointing it out

Is there any chance that genius.com can be whitelisted? I cant find a way to obtain lyrics of a song from their api endpoints.

There are instructions on how to request the allow-list addition here.