Best way to get Current Weather via API?
Asked Answered
N

5

11

What is the best way to get current weather via API ?

Could you make some example with this API ?

Naif answered 3/9, 2010 at 22:50 Comment(2)
Witch API Service are you using ?Kenon
Press the tick on the question if it helps ya.Topflight
T
3

Global Weather SOAP Webservice API

Using PHP (with the SOAP module enabled in your php.ini):

$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 should then contain an XML document that contains humidity, temperature, sky conditions, wind etc that you can adapt to your needs. You can easily play with the online demo on www.webservice.net anyway to get a feel for things.

Topflight answered 3/9, 2010 at 22:52 Comment(1)
Yep. Old post. The link is dead. Not the best Weather API.Adkinson
R
2

Try Services_Weather on pear. It does Global Weather, METAR, et. al.

Rafi answered 3/9, 2010 at 23:2 Comment(0)
W
1

I made a Weather API available on mashape, and they have a ready to use simple PHP SDK. This api is really simple to use because we use the cool standards that are available nowadays, like JSON and REST.

If you like it please give it a try on mashape

Waterworks answered 30/1, 2013 at 14:14 Comment(1)
This link is also dead.Adkinson
M
1

Programmable Web has a list of Weather API's. There are 26 Weather APIs listed in their directory. The more popular services will have libraries for common platforms so look there for a php library.

Messer answered 9/9, 2013 at 15:16 Comment(1)
Both links are brokenUrania
U
0

Weather Underground (wunderground.com)—found it from a link from weather.com's footer.

FREE: For $0, you get 500 API calls/day or 10 API calls/min

NOTE: It works better when you register an account first, then, while signed in, purchase your API key.

Urania answered 20/5, 2015 at 10:56 Comment(1)
No longer a "free" API.Adkinson

© 2022 - 2024 — McMap. All rights reserved.