Using external API in the application

I have a problem with my application.

I am using apiadvisor for weather in my application. Localhost the request works, but in the host pythonanywhere it has error.

How can I solve this problem?

If you are a free user your outbound internet access is limited to a whitelist. If you show the API documentation for that site we can consider adding it to the whitelist.


The api authentication is required and documentation is available only to users. I dont know if this help, but this is the link

thanks- I've been trying to figure out what apiadvisor is. Is it something that generates api documentation from api endpoints?


Advisor is Weather forecast API, integrates high-quality meteorological data and accuracy into applications.


api documentation:

endpoint GET: "{id}/current?token={token}".format()

I see! Great! We have added to the whitelist for you.


Thanks for this.

I too have such similar issues. I am using the Alphavantage API (It's a stock data API), documentation link as follows:

I am using a Hacker's account $5/month

It would be nice if anyone could help out too.


And this is how I get the stock data using account API key (written in ak.txt):

In Python

with open('ak.txt', 'r') as myFile:
    ts=TimeSeries(key=keys, output_format='pandas')

aapl_day, meta_data=ts.get_daily(symbol=tick_name, outputsize='full')

[edit by admin: formatting]

What error messages do you get when you run that code?

Django Version: 3.0.3 Exception Type: ValueError Exception Value:
max() arg is an empty sequence

But it works on local device (laptop), does'nt work when using pythonanywhere

Or is it that I have to write it similar to format below in order for it to work or it should work anyway: endpoint GET: "{id}/current?token={token}".format() [example from previous post above]


sorry- what is the full error stacktrace? not just the first / last line etc?

Please I am also facing this issue,

Could you also add Ipstack to the whitelist? Here is a link to the documentation.

Thank you. Babatunde.

It looks like, the documented endpoint, is already on the whitelist. Are you getting errors accessing it?

I didn't get any errors, the endpoint is supposed to return user location from their IP information, the hosted version just returns None. Works fine on my local.

Thank you.

What IP address are you passing in?

Ipstack has an option to just use a check keyword in the URL to indicate that it has to check user IP information on request. See below: here:{access_key}&fields=city,country_name,zip

Hi! It seems like I have the same issue with external API. I send a post request to link: for sending SMS verification code to the android client. But the log only shows me response 403. Can you please add the link to the whitelist is not whitelisted. You need to provide official docs of the public API.

Here is a link for the docs of API

Thanks, we've whitelisted

Hi, I need to call this api "" , can this be whitelisted? API docs: is already in the whitelist

can twilio-video api be used on pythonanywhere?

It would depend heavily on how it is implemented but, at a guess, I'd say probably not.

Hello PythonAnywhere, am having some issues on a Django Web app which is base on Crypto Currency.Am making use of the python requests library to get the data I want to scrape which doesn't violate their rights.

My point here is that am having some issues with Fetching those data with the requests library but this doesn't happen in development mode.I think the website am trying to fetch data doesn't appears on your whitelist.

The website are as follows:

Am on Free account, so if I can get pass the error with your support I promise to purchase a paid account.

I will be waiting for your feedbacks.


Send us a link to the API documentation for the sites that shows the URL where that API is available and we'll consider them for he whitelist.

They are not API but a Website, I scraped data from them.

You can do a little research about them. Although they provide consumable API's but web scraping was the easiest and preferable for me.

Here are their links


Is web scraping supported on a Paid Account.

Paid accounts have unrestricted Internet access, which means that you can connect to any site that allows incoming connections from our servers. That means that in general, web scraping will work, but if the site that you are trying to scrape blocks connections from us, it will stop working.

thanks for the feedback.

Wow, it worked on a paid account.

To anyone that will need this information. If you face any issues concerning get data from other website in your python web app(and you don't see this issues in development) consider purchasing a paid plan.

Glad to hear that you made it work!