2016-11-22 56 views
0

我想在一个API调用中获取一个或多个位置的天气信息?可这有可能在http://api.worldweatheronline.com/free/v1/weather.ashx我们可以从Worldweatheronline api获得多个天气数据吗?

http://api.worldweatheronline.com/premium/v1/weather.ashx?key=[APIKey]&q=London&format=json&num_of_days=5 返回的结果为伦敦城市 但是当我的PaaS数据像 http://api.worldweatheronline.com/premium/v1/weather.ashx?key=[APIKey]&q=London,India&format=json&num_of_days=5

那么它是不是对伦敦和提供JSON逗号分隔值印度,坚果提供与伦敦城市仅相同的上述链接。

有人可以告诉我api调用还是可以在一次调用中获取所有城市的数据?

由于

+1

发送多个请求? – ChrisBint

+0

你在接听或询问吗? – SigarDave

+0

@ChrisBint我总共有20条记录来获取天气,所以我需要去20次URL调用吗? – SigarDave

回答

0

的文档建议你只能有在请求中定义的单个位置;

https://developer.worldweatheronline.com/api/docs/local-city-town-weather-api.aspx#qparameter

在此基础上,你将需要提交您要检查每个位置的请求。

+0

这是参数q对吗?所以如果我把它作为伦敦发送,印度会认为它是伦敦的城市,印度的国家是正确的? – SigarDave

+0

是的,我会这么说。 – ChrisBint

+0

好的,非常感谢克里斯我会试试这个,让你知道并接受答案,然后 – SigarDave

相关问题