What is the best way to get current weather via API ?
Could you make some example with this API ?
Open-Meteo collaborates with National Weather Services providing Open Data with 2 to 11 km resolution. Our high performance APIs select the best weather model for your location and provide data as a simple JSON API. APIs are free without any API key for open-source developers and non-commercial use.
Overview. The National Weather Service (NWS) API allows developers access to critical forecasts, alerts, and observations, along with other weather data. The API was designed with a cache-friendly approach that expires content based upon the information life cycle.
Google does not have its own weather API, it fetches data from weather.com and shows it when you search on Google.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With