Forums

ConnectionRefusedError at /scraper

[Errno 111] Connection refused

/usr/lib/python3.7/socket.py, line 716, in create_connection

I am trying to use two rapid,api APIS (which I believe are whitelisted) but I get this error. You guys probably hear this a lot but it works when I try to run it locally but not on the server. Is there anything I should define (such as the correct proxy) even when just using the requests library?

Regards

Have you checked this help page already https://help.pythonanywhere.com/pages/403ForbiddenError/ ?

Hi, thanks for replying. I did and also previously asked about the specific APIs I am trying to use just to make sure they were whitelisted.

APIs (from rapidapi):

https://rapidapi.com/contextualwebsearch/api/web-search?endpoint=apiendpoint_b8b43008-dd94-4b86-8fd0-26d70a4e870b

https://rapidapi.com/newscatcher-api-newscatcher-api-default/api/newscatcher?endpoint=apiendpoint_8218240c-8c08-420b-8cfe-36a56759f524

Documentation:

https://english.api.rakuten.net/contextualwebsearch/api/web-search/details

https://www.notion.so/News-API-46632a5cd61548919ff0132b15b0f0fa

The address to the request is something like <api_name>.p.rapidapi.com. Maybe I am missing something and the issue is not related to the whitelist but I am 100% certain that it is related to the API call.

.p.rapidapi.com is already on the whitelist and that would include all forms of <api_name>.p.rapidapi.com.