Dev HH
Dev HH

Reputation: 91

openweathermap api to get TODAY and rest of the WEEK DAYS?

I'm wondering if I can call in one request using openweathermap api to get data about (today & all weekdays) at once! I tried this >>

http://api.openweathermap.org/data/2.5/weather?q=london&units=metric&APPID=value

and it gives data for only today

then I tried forecast

http://api.openweathermap.org/data/2.5/forecast/?q=london%2&cnt=7&units=metric&APPID=value

and also this gives me data about some weekdays.

is there any way to get all (today & weekdays ) in one request ?

Upvotes: 3

Views: 12728

Answers (2)

Arto
Arto

Reputation: 109

16 day forecasts is available at any location or city. Forecasts include daily weather and available in JSON or XML format. It is only available for all paid accounts.

https://openweathermap.org/forecast16

Upvotes: 0

GreyBeardedGeek
GreyBeardedGeek

Reputation: 30088

The api docs at http://openweathermap.org show that there's a "forecast16" api, documented at http://openweathermap.org/forecast16.

The docs say that you can call

api.openweathermap.org/data/2.5/forecast/daily?q={city name},{country code}&cnt={cnt}

and that {cnt} is number of day's worth of data that you are requesting (from 1 to 16)

So, in your case,

http://api.openweathermap.org/data/2.5/forecast/daily?q=london&units=metric&APPID=value&cnt=7

should give you 7 day's data.

Upvotes: 3

Related Questions