Dashboard Tutorial chapter 6

Regarding https://anvil.works/learn/tutorials/dashboard/chapter-6

Dark Sky weather data returns 403 Forbidden Error

Following along to the example, using anvil.http, I observed in the output window ERROR 403.

This morning writing a Python script running locally on my pc (using the requests module), I also see the Error 403 ‘daily usage limit exceeded’.

I made a total of three requests.

Please can you confirm if your chapter 6 still works (I’m wondering if an alternative weather api is now required)?

I was able to do the equivalent of this using the open weather api (need to create an account and get a key).

location is a string eg. “London,uk”
key is obtained from openweathermap.org

url = “https://api.openweathermap.org/data/2.5/forecast?q={}&units=metric&appid={}”.format(location, api_key)
resp = anvil.http.request(url, json=True)

forecast_list = resp[‘list’]
temp = [x[‘main’][‘temp’] for x in forecast_list]
date_dtime = [x[‘dt_txt’] for x in forecast_list]

return { ‘date_time’ : date_dtime, ‘temp’: temp }

2 Likes

Hi @neil.vine,

Welcome to the forum! The DarkSky API key that we use for the tutorial has a limit on API requests per month. Looks like our quota has been exceeded which is why you’re seeing the error message.

Glad to hear you found an alternative solution!

Hi @bridget

I’m learning how to use Anvil from some of the tutorials you authored. Following the exact procedures has proven excellent to understand many concepts. However, I’m stuck in Ch 6 because https://darksky.net/dev is closing (joining Apple) and not accepting new users. This means I can’t reproduce the REST API exercise you created.

I’ve tried with your key (https://api.darksky.net/forecast/a2666092e36a5888c01e9f3b829fc332/52.2053,%200.1218), but I get a {“code”:403,“error”:“daily usage limit exceeded”}.

Could you share a JSON output from darksky.net so that I can understand the structure and what we’re doing in Ch. 6? I believe Darksky will continue to work for existing users until 1st August 2020, but not accepting new users. So, I can’t try this on my own.

Alternatively, it would be great if anyone could share another REST API example that could be used in the fourth chart of the Dashboard Tutorial.

Thanks!

Hi @luis.satch,

I’ve merged these threads so you can see the alternative API that @neil.vine suggested :slight_smile:

There are plenty of examples of the JSON output from DarkSky in their documentation

1 Like

Thank you @bridget! I’ll give it a go :slight_smile: