2010-09-03 59 views

回答

2

Global Weather SOAP Webservice API

使用PHP(与你的php.ini启用SOAP模块):

$client = new SoapClient("http://www.webservicex.net/globalweather.asmx?wsdl"); 
$params = new stdClass; 
$params->CityName= 'Auckland'; 
$params->CountryName= 'New Zealand'; 
$result = $client->GetWeather($params); 
// Check for errors... 
$weatherXML = $result->GetWeatherResponse; 

$ weatherXML则应该包含一个含有湿度,温度,天空状况,风等的XML文档你可以适应你的需求。无论如何,您都可以轻松使用www.webservice.net上的在线演示来体验一些东西。

+6

链接已损坏 – 2014-09-26 14:02:05

1

我在mashape上提供了一个Weather API,他们准备使用简单的PHP SDK。 这个api的使用非常简单,因为我们使用现今可用的酷标准,如JSON和REST。

如果你喜欢它,请给它mashape

1

Programmable Weblist of Weather API's一试。目录中列出了26种天气API。更受欢迎的服务将有用于常见平台的库,因此请在这里查找php库。

+0

这两个链接都已损坏 – kevnk 2015-05-20 10:46:43

0

Weather Underground (wunderground.com) - 从weather.com页脚的链接中找到它。

FREE:对于$ 0时,你会得到500个API调用/天或10个API调用/分钟

注:当你第一次注册一个帐号它工作得更好,然后,同时签署,购买您的API密钥。

相关问题