Story:

MoosunMv is a personal project I started a few months ago to store and have a repository of weather information. The project is still on beta and new features are added. The Weather data is live data from Maldives meteorology. So far the API holds 71 days worth of weather data from all the meteorology stations and 63 days of satellite images.

A couple of days ago I wrote up a PHP Client to interact with MoosunMv API. I am still trying to improve the code base of the library and refactoring it a bit more.

Here are some of the sample data points that API offers:

image alt text

Installation:

composer require jinas/moosunmv-api

Usage:

Getting the latest weather data of the station:

<?php

namespace MMVClient;

require_once '../vendor/autoload.php';

use MMVClient\Client;


$rp = new Client();

$data = $rp->getLatest("hanimaadhoo");

echo $data["humidity"];

Getting all the weather data from the selected station:

namespace MMVClient;

require_once '../vendor/autoload.php';

use MMVClient\Client;


$rp = new Client();

$stationdata = $rp->getWeather('kahdhoo');

var_dump($stationdata);

The following code will return an array of weather data from the station. By default, the API will return 25 data points per request. I will add a more dynamic way of paginating it in a later release. I am currently working on to give out a public API endpoint to access the satellite images. And also been working on building a console application to build on top of the API Client. I will make a blog post about it once I finish writing up the codes for it.

Here is some of the satellite image timelapse made with the images collected:

  • Maldives Meteorology:

image alt text

  • Rain images:

image alt text