5 Day Weather

API Documentation


Our API allows you to retrieve weather information from our website via GET request. It supports the following query parameters:

Name Description
city This parameter queries a city in order to retrieve weather informations, and will return the following: city (the requested city), temperature (the temperature in Fahrenheit degrees), skytext (the sky conditions), humidity (the humidity), wind (the wind speed in Imperial units (MPH) & direction), date (the date when temperature was measured), and the day (the day name when temperature was measured) value.


URL parameter

Here is an example of a GET request on our API:

https://5dayweather.org/api.php?city=London

This is the output that our API will return when you query for an url:
{
   "apiVersion":"1.0",
   "data":{
      "location":"London, GBR",
      "temperature":"61",
      "skytext":"Mostly Cloudy",
      "humidity":"59",
      "wind":"16 mph",
      "date":"2013-10-09",
      "day":"Wednesday"
   }
}
	
An example of json decoding would be the following PHP code:

<?php
header('Content-Type: text/plain; charset=utf-8;');
$file = file_get_contents("https://5dayweather.org/api.php?city=London");
print_r(json_decode($file));
?>