PythonAnywhere Forums

Proxy error when using requests in Pythonanywhere

Hi there, I'm using requests library (through Soundcloud module) and I'm having an error:

Caused by ProxyError('Cannot connect to proxy.', error('Tunnel connection failed: 403 Forbidden' when I try to access soundcloud API.

The strange thing was that in interactive mode I was able to connect it successfully with the API, but when I run my app it fails.

Best

That is very strange. Are the interactive mode and the web app definitely using the same API domain for soundcloud?

Disregard the interactive thing, entirely my fault. Just learned that the API endpoint that caused the failure was not the one I was testing in interactive mode.

The API endpoint that caused it is called /oembed (https://developers.soundcloud.com/docs/oembed) and its URL is:

http://soundcloud.com/oembed

I see in PythonAnywhere whitelist api.soundcloud.com but not soundcloud.com/oembed

Is it possible to white list this URL (since it is part of the Soundcloud API)?

Best piqoni

No problem. Try it now?

You guys rock!

It works.

Thanks

sorry for the trouble but could you please add nus.edu.sg on the whitelist because it is used for authentication BTW, i saw ntu on the list.....

If there's an official public API there, we can whitelist it -- just give us a link to the API docs.

https://wiki.nus.edu.sg/display/ivlelapi/Summary

https://wiki.nus.edu.sg/display/ivlelapi/Getting+Started

From that, it looks like ivle.nus.edu.sg is the correct API endpoint. Does that sound right to you?

yes
thanks

may i check when will it be added to the whiteliest. best regards

Would it be possible to add waterlevel.ie/data/ ? I'm trying to generate some graphs for our university kayak club webpage, link to the api docs: https://waterlevel.ie/page/api/

Both of those are whitelisted now.

Could you please whitelist https://api.darksky.net/forecast/ API and ip-api.com/json. I'm using it for rain prediction. Docs link: https://darksky.net/dev/docs

OK, have added those two. let us know if it works oK?

They work fantastically! Thanks!

Could you please whitelist script.googleusercontent.com ? I'm using pythonanywhere with google apps script web app.

ok. I looked into the documentation and I believe script.googleusercontent.com is used when google apps script returns content after you hit script.google.com, and is used as a one-time url.

I've whitelisted script.googleusercontent.com for you.

Thank you so much!!

Hi PythonAnywhere friends!

I am getting a proxy error on a simple subscribe request to the mailchimp api. Is it possible to get this whitelisted?

The endpoint im hitting looks like this: https://us14.api.mailchimp.com/3.0/lists/xxxxxxxxx/members/

Thanks so much and blue skies!

Hi there, I've added *.api.mailchimp.com to the whitelist now, let us know if it works OK!

Hi can anybody help to add api.hunterexpress.com.au into whitelist?

Thanks

I couldn't find any api docs there. Could you send a link to the api docs?

Hi Glenn here is API doc: http://staging.hunterexpress.com.au/apidocs/

Thanks

No problem. I've added both the live and the testing domains to the whitelist.

Work like a charm, thanks Glenn!

Hi guys, can you please white list https://app.asana.com/api ?

Thanks!

okay, we have whitelisted app.asana.com for you!

Hello guys, I see that you have added https://api.darksky.net/forecast/ API to the whitelist can you also please add 'https://darksky.net/details/' as well. I'm using it to get historical weather data.

Thanks.

Hi there, that second url looks designed for human consumption, not machine consumption, so that tends to rule it out from being added to the whitelist I'm afraid.

paid accounts start from just $5 tho!

Hello, Sir, I want to access KiiCloud for a datastore, could you please add it to whitelist? English Doc: https://en.kii.com API: https://api-jp.kii.com

Ok. I've added that to the whitelist.

Hello, Sir, thanks for your quick response. However, when I access the service via KiiCloud SDK, the error "urllib2.URLError: <urlopen error Tunnel connection failed: 403 Forbidden>" remains. (The url is https://api-jp.kii.com/api/oauth2/token) I also restarted the bash console. May you help me ?

Ah. Sorry about that - I didn't finish the process properly. It's working now.

Thanks, it worked.

Hello, Sir, After you set https://api-jp.kii.com into your whitelist, it worked well. But it suddenly does not work now. The request worked well these day, but now it took a very long time, and failed. Is there anything wrong with it? FYI, no problem for accessing the same KiiCloud from my local or from Google.

It seems proxy server is down.

Oh, now it works : )

Doesn't seem to work for me, I get the ProxyError all morning :(

Could you check again now? We just restarted it.

It works now, thank you!

Excellent, thanks for confirming!

It's working now. Thanks.

Thanks for confirming!

Hai, can you whitelist https://xtremetricks.net/ this link? im using it and im getting error('Tunnel connection failed: 403 Forbidden'). Please help

Send us a link to the API documentation and we'll consider it.

Give me your email id or something

please i need it... i use that website to collect information using my python script

Do they have API docs? Where are they?

No it is just a website

Unfortunately we can only whitelist sites with an official public API.