With Serenum API, you will get a detailed overview over the current weather and weather forecast for a place. You will also get detailed information about a place's local date and time, including astronomical data like the current positions of the Sun and the Moon. And the best part: Serenum API are completely open sourced and you can install it on your own server!
The API are divided in 2 sections: getting all the data about a single place (
index.php), and see the difference between 2 places (
Before you can use Serenum API, you must get your own API key from OpenWeatherMap.
[your-api-key]for the variable
domain.com/api?coor=59.38079,13.50239in your browser.
Now go to
https://domain.com/api and follow the instructions which will say that you need to append the coordinates for the place you want to fetch the weather data for. You can get the coordinates for the place by go to OpenStreetMap or use the default ones that the API gives you.
If you choose to get coordinates from OSM, go to the place of choice and right-click on the place and choose "Centre map here". Now copy the coordinates from the URL and append them to
domain.com/api/diff. Follow the example in Serenum API for how it must look like.
,for the coordinates before you continue.
Serenum API only provides data in JSON.
|Your own API key from OpenWeatherMap.|
|Exclude stuff from the API call, seperated with a comma and no spaces. Available values: |
Despite the API itself are very self-explainable, there are fields that aren't and those are listed below. Other fields that needs more information are included.
Fields with the same name that can be found on more than 1 place, are listed with a wildcard (*).
|Shows the entered API key.|
|Geographical coordinates of the place in latitude (truncated to 5 digits).|
|Geographical coordinates of the place in longitude (truncated to 5 digits).|
|Shows the time in 24h format for the chosen place.|
|Shows the time in 12h format for the chosen place.|
|Cloud cover in percentage (%)|
|Humidity in percentage (%)|
|The probability of precipitation in percentage (%)|
|How many days, hours, and minutes there are left until the moon phase occures. The countdown goes after the chosen place's date and time.|
When an error occurs in Serenum API, you will get the error code, a message saying what the error means in short, and (depending on the error) 1 or 2 other variable(s) that will help you getting on the right path. All errors are listed below with further explaination.
|The geographical coordinates (latitude and longitude) are missing in the URL. You need to specify these in order to get the data from OpenWeatherMap. Please see "Get the weather data" for how to get the coordinates for a place.|
|The geographical coordinates (latitude and longitude) are not valid. To get a valid latitude och longitude, they need to be 5 or more digits and with |
|The API key from OpenWeatherMap are missing in the URL. You need to login to your account at openweathermap.org and retrieve your API key from there. See "Get the API key" for more information.|
|The API key from OpenWeatherMap are not valid. Go to openweathermap.org and login to your account and either create a new API key or confirm that the entered API key are activated.|
|At least 1 excluded variable are missing in the URL. See "Get started" for more information.|
|The API were not able to fetch the data from OpenWeatherMap. This can occur if the API key from OSM are not valid based on their standards or not activated.|
If you have stumbled upon any issues, feel free to contact us on either Codeberg or Telegram.