Forums

OSError: Tunnel connection failed: 403 Forbidden

urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='nseindia.com', port=443): Max retries exceeded with url: /api/option-chain-indices?symbol= NIFTY (Caused by ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 403 Forbidden')))

requests.exceptions.ProxyError: HTTPSConnectionPool(host='nseindia.com', port=443): Max retries exceeded with url: /api/option-chain-indices?symbol=NI FTY (Caused by ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 403 Forbidden')))

getting above errors to access this site https://nseindia.com/api/option-chain-indices?symbol=NIFTY please advice.

hi there- you are seeing this error for free users. please provide the public api documentations and we can add it to the whitelist.

hi dont have public api documentation , if on paid setup will it work. the script works fine on my local pc.

In general that particular error can normally be fixed by upgrading to a paid account; what it means is that our firewall is blocking a free account from accessing a non-whitelisted site.

However, it's worth noting that while we don't block anything for paid accounts, it's entirely possible for other servers to block incoming connections based on where the connection is coming from. I mention this because in the past we've heard from other users that the nseindia.com site actively blocks attempts to connect to it from outside India. If this is still the case, you might still not be able to run your code successfully on PythonAnywhere.

Hi giles, its not working on paid account also. its just timing out, this is the error : RequestExcepton: HTTPSConnectionPool(host='nseindia.com', port=443): Read timed out. (read timeout=10).. below is the code

url = "https://nseindia.com/api/option-chain-indices?symbol=NIFTY"
headers = {'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) '
                    'Chrome/62.0.3202.94 Safari/537.36'}
def fetch_oi():
try:
    a = requests.get(url, headers=headers,timeout=10)
    a.raise_for_status()
except requests.exceptions.RequestException as e:
    print("RequestExcepton:",e)
except requests.exceptions.HTTPError as err:
    print("HttpError:",err)
except requests.exceptions.ConnectionError as errC:
    print("ConnectionError:",errC)
r = a.json()
print(r)

Make sure that's in a new console or, if the code is in a web app, that you've reloaded the web app after the upgrade. After that, if it's still not working, look at the content of the response you're getting back to determine what the problem may be.

HTTPSConnectionPool(host='apiv2.shiprocket.in', port=443): Max retries exceeded with url: /v1/external/auth/login (Caused by ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 403 Forbidden')))

getting this error on getting api token from shiprocket : https://apidocs.shiprocket.in/#8a56b4d6-b418-43cf-be25-ead62532aa18

can i get this whitelisted?

please provide the public api documentations and we can add it to the whitelist.

Could you please whitelist https://contract.mexc.com, the public api documentation is here:

https://mxcdevelop.github.io/apidocs/contract_v1_en/#update-log

Thanks

@inflim It's done for you.

@permalink Great, it works, thank you!

Glad to hear that!

Hi, facing same issue, Can you please whitelist it for me too ?

@ajaysekhri What do you want us to whitelist?

Hi Team,

Please whitelist - https://a3.aliceblueonline.com/rest/AliceBlueAPIService

Please help. Its stopping us to work with our APIs.

@tradingninja08 If you would like the above domain to be considered for the whitelist , please send us a link to the API documentation. Please note we can only whitelist sites with an official public API.

Hi Team,

Official API Documentation public link - https://v2api.aliceblueonline.com/introduction

Please whitelist - https://a3.aliceblueonline.com/rest/AliceBlueAPIService

Please help. It's stopping us to work with the APIs.

Thanks

@tradingninja08 a3.aliceblueonline.com has been added to the whitelist.

Hi Team,

Thanks for whitelisting the above link. I am still getting the below error - requests.exceptions.ProxyError: HTTPSConnectionPool(host='v2api.aliceblueonline.com', port=443): Max retries exceeded with url: /restpy/contract_master?exch=INDICES (Caused by ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 403 Forbidden',)

Can you please whitelist this link as well --> v2api.aliceblueonline.com

Official API Documentation public link - https://v2api.aliceblueonline.com/introduction

Thank you!

@tradingninja08 Looking at the message above, it looks like you are trying to connect to the domain link rather than the endpoint. Please note the documentation only mentions a3.aliceblueonline.com and not v2api.aliceblueonline.com

@hmalik - But the error message above shows that it's not able to access host='v2api.aliceblueonline.com'

Please do the needful. Thanks

The documentation does not mention v2api.aliceblueonline.com, only a3.aliceblueonline.com. Use the documented API.

Hello team, I am getting the following error when trying to generate API token on Etsy:

HTTPSConnectionPool(host='api.etsy.com', port=443): Max retries exceeded with url: /v3/public/oauth/token (Caused by ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 403 Forbidden')))

Is it possible to whitelist https://api.etsy.com? The official API documentation is under https://developers.etsy.com/documentation

Thanks dearly.

@esmanhoto Hi, Thank you for your request. Can you please send us a direct link to the documentation which states the endpoint you would like us to consider adding.

Can you please add this api endpoint to the whitelist? https://fdo.rocketlaunch.live/json/launches/next/5

Their documentation: https://rocketlaunch.live/api

If you would like us to whitelist a site, you can submit a request on this page:

https://support.anaconda.com/hc/en-us/requests/new

Select the "Anaconda Notebooks/PythonAnywhere Allow List Request" option. You will need to provide:

  • Your email address, so that we can let you know when it's done, or if we have questions.
  • A link to the API documentation. Particularly to documentation that states the domain where the API is published.
  • The domain or domains (including subdomains) that the API is served from.

Hello everyone, I'm facing an issue with my web app that I hope you can help me with. I've built a web app that scans and parses feeds, and it works fine on my localhost. However, when I uploaded it to pythonanywhere.com, I encountered the following error: 'Error code: 502-backend',OSError: write error'

I'm not sure what's causing this error, and I would really appreciate any insights or suggestions on how to solve it. I suspect that my web app may be limited in some way, but I'm not sure where to start troubleshooting.

Has anyone experienced a similar issue before, or does anyone have any tips on how to troubleshoot this error code? I would be grateful for any help or advice you can provide. Thank you in advance

There are many things that can cause that error, so we have help page to help you to identify what may be the problem for you: https://help.pythonanywhere.com/pages/502BadGateway/

hi, can you whitelist the below too? https://github.com/jdepoix/youtube-transcript-api https://spacy.io/api

If you would like us to whitelist a site, you can submit a request on this page:

https://support.anaconda.com/hc/en-us/requests/new

Select the "Anaconda Notebooks/PythonAnywhere Allow List Request" option. You will need to provide:

  • Your email address, so that we can let you know when it's done, or if we have questions.
  • A link to the API documentation. Particularly to documentation that states the domain where the API is published.
  • The domain or domains (including subdomains) that the API is served from.

hi! have error 500 Internal Server Error: logs: raise MaxRetryError(_pool, url, error or ResponseError(cause)) urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='identity.nexar.com', port=443): Max retries exceeded with url: /connect/token (Caused by ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 403 Forbidden'))) NO MATCH

try this api https://api.nexar.com/

@ecomponents

If you would like us to whitelist api.nexar.com you can submit a request on this page:

https://support.anaconda.com/hc/en-us/requests/new

Select the "Anaconda Notebooks/PythonAnywhere Allow List Request" option. You will need to provide:

  • Your email address, so that we can let you know when it's done, or if we have questions.
  • A link to the API documentation. Particularly to documentation that states the domain where the API is published.
  • The domain or domains (including subdomains) that the API is served from.

Hey can you please whitelist this https://apidoc.tatum.io/

@deadshot If you would like us to whitelist a domian you can submit a request on this page:

https://support.anaconda.com/hc/en-us/requests/new