forecast data

GET https://api.weatherstack.com/forecast?query=New York&forecast_days=7

The weatherstack is capable of returning weather forecast data for up to 14 days into the future. To get weather forecasts, simply use the API's forecast endpoint and define your preferred number of forecast days using the forecast_days parameter.

Request Params

KeyDatatypeRequiredDescription
querystring[Required] Use this parameter to pass a single location or multiple semicolon-separated location identifiers to the API. Learn more about the Query Parameter.
forecast_daysnumber[Optional] Use this parameter to specify the number of days for which the API returns forecast data. (Default: 7 or 14 days, depending on your subscription)

RESPONSES

status: OK

{"request":{"type":"City","query":"New York, United States of America","language":"en","unit":"m"},"location":{"name":"New York","country":"United States of America","region":"New York","lat":"40.714","lon":"-74.006","timezone_id":"America/New_York","localtime":"2024-03-18 08:50","localtime_epoch":1710751800,"utc_offset":"-4.0"},"current":{"observation_time":"12:50 PM","temperature":6,"weather_code":113,"weather_icons":["https://cdn.worldweatheronline.com/images/wsymbols01_png_64/wsymbol_0001_sunny.png"],"weather_descriptions":["Sunny"],"wind_speed":4,"wind_degree":296,"wind_dir":"WNW","pressure":1008,"precip":0,"humidity":45,"cloudcover":0,"feelslike":3,"uv_index":3,"visibility":16,"is_day":"yes"},"forecast":{"2024-03-18":{"date":"2024-03-18","date_epoch":1710720000,"astro":{"sunrise":"07:02 AM","sunset":"07:07 PM","moonrise":"12:36 PM","moonset":"03:52 AM","moon_phase":"Waxing Gibbous","moon_illumination":58},"mintemp":5,"maxtemp":10,"avgtemp":8,"totalsnow":0,"sunhour":11,"uv_index":4},"2024-03-19":{"date":"2024-03-19","date_epoch":1710806400,"astro":{"sunrise":"07:00 AM","sunset":"07:08 PM","moonrise":"01:39 PM","moonset":"04:36 AM","moon_phase":"Waxing Gibbous","moon_illumination":68},"mintemp":1,"maxtemp":8,"avgtemp":5,"totalsnow":0,"sunhour":12.1,"uv_index":4},"2024-03-20":{"date":"2024-03-20","date_epoch":1710892800,"astro":{"sunrise":"06:59 AM","sunset":"07:09 PM","moonrise":"02:43 PM","moonset":"05:11 AM","moon_phase":"Waxing Gibbous","moon_illumination":77},"mintemp":4,"maxtemp":10,"avgtemp":7,"totalsnow":0,"sunhour":11.5,"uv_index":4},"2024-03-21":{"date":"2024-03-21","date_epoch":1710979200,"astro":{"sunrise":"06:57 AM","sunset":"07:10 PM","moonrise":"03:47 PM","moonset":"05:40 AM","moon_phase":"Waxing Gibbous","moon_illumination":84},"mintemp":0,"maxtemp":7,"avgtemp":3,"totalsnow":0,"sunhour":12.5,"uv_index":5},"2024-03-22":{"date":"2024-03-22","date_epoch":1711065600,"astro":{"sunrise":"06:55 AM","sunset":"07:11 PM","moonrise":"04:48 PM","moonset":"06:03 AM","moon_phase":"Waxing Gibbous","moon_illumination":91},"mintemp":-2,"maxtemp":6,"avgtemp":2,"totalsnow":0,"sunhour":12.6,"uv_index":1},"2024-03-23":{"date":"2024-03-23","date_epoch":1711152000,"astro":{"sunrise":"06:53 AM","sunset":"07:12 PM","moonrise":"05:49 PM","moonset":"06:24 AM","moon_phase":"Waxing Gibbous","moon_illumination":95},"mintemp":1,"maxtemp":9,"avgtemp":6,"totalsnow":0,"sunhour":7.6,"uv_index":2},"2024-03-24":{"date":"2024-03-24","date_epoch":1711238400,"astro":{"sunrise":"06:52 AM","sunset":"07:13 PM","moonrise":"06:48 PM","moonset":"06:43 AM","moon_phase":"Waxing Gibbous","moon_illumination":98},"mintemp":-3,"maxtemp":7,"avgtemp":2,"totalsnow":0,"sunhour":11.6,"uv_index":2}}}