Forums

Proxy Error

Error: Caused by ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 403 Forbidden'))

I am making requests to api.worldnewsapi.com for their extract api (api.worldnewsapi.com/extract?url={url}&analyze=false&api-key{my_api_key}) however, I am getting the error above. Is there any fix? Thank you so much for your time.

You're hitting the api whitelist - more info

I tried using the proxy instructed by PythonAnywhere but I am still getting the same error.

Code:

proxies = {'http': 'proxy.server:3128', 'https': 'proxy.server:3128'}

article_content = requests.get(f'https://api.worldnewsapi.com/extract-news?url={response["results"][article_index]["link"]}&analyze=false&api-key={extract_content_key}', proxies=proxies).json()

Error: requests.exceptions.ProxyError: HTTPSConnectionPool(host='api.worldnewsapi.com', port=443): Max retries exceeded with url: /extract-news?url=https://investorplace.com/market360/2023/08/bypassing-bitcoin-how-mara-stock-offers-an-alternative-crypto-play/&analyze=false&api-key={mykey} (Caused by ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 403 Forbidden')))

If you click on the link in the help page that @sboyd linked to, there's a form you can fill in there to request an addition to the allowlist.

Thanks, I have submitted for the white list of WorldNewsAPI.com. How long does it take to put APIs on the allow list?

Thank you for your time.

It can vary, but the requests are usually handled within a few days.

Thank you, my request to white list WorldNewsAPI.com was satisfied. Thank you guys for the help!

Glad we could help!