Forums

Problem connecting to the Elsevier API --- whitelist request

I have just started using a free PythonAnywhere account. So far, so good! But I have just gotten this error:

OSError: Tunnel connection failed: 403 Forbidden

I am trying to connect to api.elsevier.com, which is the API for one of the big databases of scientific abstracts. Could I be getting this error because the API is not among the "whitelisted" sites for free PythonAnywhere accounts?

If so, would it be possible to "whitelist" this site? Please see https://dev.elsevier.com for more information. I will probably upgrade to a paid account, if I can get a prototype up and running, but first I want to know whether this is a problem with "whitelisting" at PythonAnywhere or a problem at Elsevier (perhaps to do with authentication, since I am now trying to access the API from PythonAnywhere, rather than accessing it from a computer on the network at my university).

Many thanks!

Tempted to refuse based on Elsevier's bad reputation! But I suppose their API meets our requirements. I've added it now, let us know if it works OK?

Thanks, Harry! It works! I can connect to the API and get the "standard" search results from Scopus, but not the "complete" search results (I suspect this is now a remote authentication problem that I will need to solve with Elsevier, since the "standard" search results should be available even to non-authenticated users).

right-o. let us know if you need anything else!

This seems to have stopped working. Has it been taken off the whitelist? The same script is still working when run from my local computer (as opposed to running it from a bash console on PythonAnywhere), and I've solved the authentication problems with some help from Elsevier.

requests.exceptions.ProxyError: HTTPSConnectionPool(host='api.elsevier.com', port=443): Max retries exceeded with url: /content/search/scopus?query=TITLE-ABS-KEY%28%22nuclear%20winter%22%29&view=STANDARD (Caused by ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 403 Forbidden',)))

Many thanks in advance!

Sorry about that, not sure why it dropped off the list, is back on now.

I went ahead and upgraded to a paid account, which solved the problem, but it will be useful for free-account users in the future to have access to Elsevier. Thanks, again!