Skip to content

Instantly share code, notes, and snippets.

@spyoungtech
Created March 1, 2017 02:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spyoungtech/498c0f0bd78ad506940915fb8effd8c8 to your computer and use it in GitHub Desktop.
Save spyoungtech/498c0f0bd78ad506940915fb8effd8c8 to your computer and use it in GitHub Desktop.
example api response
data = {'forecast': {'simpleforecast': {'forecastday': [{'avehumidity': 87,
'avewind': {'degrees': 161,
'dir': 'SSE',
'kph': 5,
'mph': 3},
'conditions': 'Clear',
'date': {'ampm': 'PM',
'day': 28,
'epoch': '1488326400',
'hour': 19,
'isdst': '0',
'min': '00',
'month': 2,
'monthname': 'February',
'monthname_short': 'Feb',
'pretty': '7:00 PM '
'EST on '
'February '
'28, 2017',
'sec': 0,
'tz_long': 'America/New_York',
'tz_short': 'EST',
'weekday': 'Tuesday',
'weekday_short': 'Tue',
'yday': 58,
'year': 2017},
'high': {'celsius': '29',
'fahrenheit': '85'},
'icon': 'clear',
'icon_url': 'http://icons.wxug.com/i/c/k/clear.gif',
'low': {'celsius': '19',
'fahrenheit': '66'},
'maxhumidity': 0,
'maxwind': {'degrees': 0,
'dir': '',
'kph': 24,
'mph': 15},
'minhumidity': 0,
'period': 1,
'pop': 10,
'qpf_allday': {'in': 0.0,
'mm': 0},
'qpf_day': {'in': None,
'mm': None},
'qpf_night': {'in': 0.0,
'mm': 0},
'skyicon': '',
'snow_allday': {'cm': 0.0,
'in': 0.0},
'snow_day': {'cm': None,
'in': None},
'snow_night': {'cm': 0.0,
'in': 0.0}},
{'avehumidity': 62,
'avewind': {'degrees': 176,
'dir': 'S',
'kph': 14,
'mph': 9},
'conditions': 'Partly Cloudy',
'date': {'ampm': 'PM',
'day': 1,
'epoch': '1488412800',
'hour': 19,
'isdst': '0',
'min': '00',
'month': 3,
'monthname': 'March',
'monthname_short': 'Mar',
'pretty': '7:00 PM '
'EST on '
'March '
'01, 2017',
'sec': 0,
'tz_long': 'America/New_York',
'tz_short': 'EST',
'weekday': 'Wednesday',
'weekday_short': 'Wed',
'yday': 59,
'year': 2017},
'high': {'celsius': '31',
'fahrenheit': '88'},
'icon': 'partlycloudy',
'icon_url': 'http://icons.wxug.com/i/c/k/partlycloudy.gif',
'low': {'celsius': '19',
'fahrenheit': '66'},
'maxhumidity': 0,
'maxwind': {'degrees': 176,
'dir': 'S',
'kph': 16,
'mph': 10},
'minhumidity': 0,
'period': 2,
'pop': 10,
'qpf_allday': {'in': 0.0,
'mm': 0},
'qpf_day': {'in': 0.0,
'mm': 0},
'qpf_night': {'in': 0.0,
'mm': 0},
'skyicon': '',
'snow_allday': {'cm': 0.0,
'in': 0.0},
'snow_day': {'cm': 0.0,
'in': 0.0},
'snow_night': {'cm': 0.0,
'in': 0.0}},
{'avehumidity': 65,
'avewind': {'degrees': 279,
'dir': 'W',
'kph': 19,
'mph': 12},
'conditions': 'Partly Cloudy',
'date': {'ampm': 'PM',
'day': 2,
'epoch': '1488499200',
'hour': 19,
'isdst': '0',
'min': '00',
'month': 3,
'monthname': 'March',
'monthname_short': 'Mar',
'pretty': '7:00 PM '
'EST on '
'March '
'02, 2017',
'sec': 0,
'tz_long': 'America/New_York',
'tz_short': 'EST',
'weekday': 'Thursday',
'weekday_short': 'Thu',
'yday': 60,
'year': 2017},
'high': {'celsius': '29',
'fahrenheit': '84'},
'icon': 'partlycloudy',
'icon_url': 'http://icons.wxug.com/i/c/k/partlycloudy.gif',
'low': {'celsius': '16',
'fahrenheit': '60'},
'maxhumidity': 0,
'maxwind': {'degrees': 279,
'dir': 'W',
'kph': 24,
'mph': 15},
'minhumidity': 0,
'period': 3,
'pop': 20,
'qpf_allday': {'in': 0.0,
'mm': 0},
'qpf_day': {'in': 0.0,
'mm': 0},
'qpf_night': {'in': 0.0,
'mm': 0},
'skyicon': '',
'snow_allday': {'cm': 0.0,
'in': 0.0},
'snow_day': {'cm': 0.0,
'in': 0.0},
'snow_night': {'cm': 0.0,
'in': 0.0}},
{'avehumidity': 49,
'avewind': {'degrees': 19,
'dir': 'NNE',
'kph': 27,
'mph': 17},
'conditions': 'Partly Cloudy',
'date': {'ampm': 'PM',
'day': 3,
'epoch': '1488585600',
'hour': 19,
'isdst': '0',
'min': '00',
'month': 3,
'monthname': 'March',
'monthname_short': 'Mar',
'pretty': '7:00 PM '
'EST on '
'March '
'03, 2017',
'sec': 0,
'tz_long': 'America/New_York',
'tz_short': 'EST',
'weekday': 'Friday',
'weekday_short': 'Fri',
'yday': 61,
'year': 2017},
'high': {'celsius': '22',
'fahrenheit': '72'},
'icon': 'partlycloudy',
'icon_url': 'http://icons.wxug.com/i/c/k/partlycloudy.gif',
'low': {'celsius': '12',
'fahrenheit': '53'},
'maxhumidity': 0,
'maxwind': {'degrees': 19,
'dir': 'NNE',
'kph': 40,
'mph': 25},
'minhumidity': 0,
'period': 4,
'pop': 0,
'qpf_allday': {'in': 0.0,
'mm': 0},
'qpf_day': {'in': 0.0,
'mm': 0},
'qpf_night': {'in': 0.0,
'mm': 0},
'skyicon': '',
'snow_allday': {'cm': 0.0,
'in': 0.0},
'snow_day': {'cm': 0.0,
'in': 0.0},
'snow_night': {'cm': 0.0,
'in': 0.0}}]},
'txt_forecast': {'date': '8:02 PM EST',
'forecastday': [{'fcttext': 'Mainly clear. Lows '
'overnight in the '
'mid 60s.',
'fcttext_metric': 'Mostly '
'clear. Low '
'19C.',
'icon': 'clear',
'icon_url': 'http://icons.wxug.com/i/c/k/clear.gif',
'period': 0,
'pop': '10',
'title': 'Tuesday'},
{'fcttext': 'A few passing '
'clouds. Low 66F. '
'Winds SSE at 5 to '
'10 mph.',
'fcttext_metric': 'A few '
'passing '
'clouds, '
'otherwise '
'generally '
'clear. Low '
'19C. Winds '
'SSE at 10 '
'to 15 km/h.',
'icon': 'nt_clear',
'icon_url': 'http://icons.wxug.com/i/c/k/nt_clear.gif',
'period': 1,
'pop': '10',
'title': 'Tuesday Night'},
{'fcttext': 'Partly cloudy '
'skies. High 88F. '
'Winds S at 5 to 10 '
'mph.',
'fcttext_metric': 'Sunshine '
'and clouds '
'mixed. High '
'31C. Winds '
'S at 10 to '
'15 km/h.',
'icon': 'partlycloudy',
'icon_url': 'http://icons.wxug.com/i/c/k/partlycloudy.gif',
'period': 2,
'pop': '10',
'title': 'Wednesday'},
{'fcttext': 'A few clouds from '
'time to time. '
'Slight chance of a '
'rain shower. Low '
'66F. Winds light '
'and variable.',
'fcttext_metric': 'A few '
'clouds from '
'time to '
'time. '
'Slight '
'chance of a '
'rain '
'shower. Low '
'19C. Winds '
'light and '
'variable.',
'icon': 'nt_partlycloudy',
'icon_url': 'http://icons.wxug.com/i/c/k/nt_partlycloudy.gif',
'period': 3,
'pop': '20',
'title': 'Wednesday Night'},
{'fcttext': 'Some sun in the '
'morning with '
'increasing clouds '
'during the '
'afternoon. A stray '
'shower or '
'thunderstorm is '
'possible. High '
'84F. Winds W at 10 '
'to 15 mph.',
'fcttext_metric': 'Intervals '
'of clouds '
'and '
'sunshine in '
'the morning '
'with more '
'clouds for '
'later in '
'the day. A '
'stray '
'shower or '
'thunderstorm '
'is '
'possible. '
'High 29C. '
'Winds W at '
'15 to 25 '
'km/h.',
'icon': 'partlycloudy',
'icon_url': 'http://icons.wxug.com/i/c/k/partlycloudy.gif',
'period': 4,
'pop': '20',
'title': 'Thursday'},
{'fcttext': 'Partly cloudy '
'skies early will '
'become overcast '
'later during the '
'night. Low near '
'60F. Winds N at 10 '
'to 15 mph.',
'fcttext_metric': 'Partly '
'cloudy '
'skies in '
'the '
'evening, '
'then '
'becoming '
'cloudy '
'overnight. '
'Low near '
'15C. Winds '
'N at 15 to '
'25 km/h.',
'icon': 'nt_mostlycloudy',
'icon_url': 'http://icons.wxug.com/i/c/k/nt_mostlycloudy.gif',
'period': 5,
'pop': '20',
'title': 'Thursday Night'},
{'fcttext': 'Partly cloudy '
'skies. High 72F. '
'Winds NNE at 15 to '
'25 mph.',
'fcttext_metric': 'Intervals '
'of clouds '
'and '
'sunshine. '
'High 22C. '
'Winds NNE '
'at 25 to 40 '
'km/h.',
'icon': 'partlycloudy',
'icon_url': 'http://icons.wxug.com/i/c/k/partlycloudy.gif',
'period': 6,
'pop': '0',
'title': 'Friday'},
{'fcttext': 'Clear skies. Low '
'53F. Winds N at 10 '
'to 15 mph.',
'fcttext_metric': 'Clear. Low '
'12C. Winds '
'N at 15 to '
'25 km/h.',
'icon': 'nt_clear',
'icon_url': 'http://icons.wxug.com/i/c/k/nt_clear.gif',
'period': 7,
'pop': '0',
'title': 'Friday Night'}]}},
'response': {'features': {'forecast': 1},
'termsofService': 'http://www.wunderground.com/weather/api/d/terms.html',
'version': '0.1'}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment