PHPackages                             jberns88/metoffice - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. jberns88/metoffice

ActiveLibrary[API Development](/categories/api)

jberns88/metoffice
==================

SDK for the UK MetOffice DataPoint API

0.0.3(4y ago)0682MITPHP

Since Mar 12Pushed 4y ago1 watchersCompare

[ Source](https://github.com/jberns88/metoffice)[ Packagist](https://packagist.org/packages/jberns88/metoffice)[ RSS](/packages/jberns88-metoffice/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (1)Versions (4)Used By (0)

metoffice
=========

[](#metoffice)

PHP SDK for the UK MetOffice DataPoint API

### Install

[](#install)

```
composer require jberns88/metoffice

```

### Examples

[](#examples)

#### Forecasts

[](#forecasts)

```
//You're API key from the MetOffice
$client = new \Jberns88\MetOffice\Client(['key' => '']);
// Grab all the locations where forecast data is available.
$locations = $client->getForecastLocations();
// Find the nearest location from some geo coordinates
$location = $locations->getNearest(51.509865, -0.118092);
// Get the daily forecasts for this location
$forecasts = $location->getDailyForecasts();
// Get the forecast day
$day = $forecasts->getByDate(new \DateTime('tomorrow'));

// Echo out the location name
echo 'Location: ' . $location->getName() . PHP_EOL;
// Echo out the forecast date
echo 'Date: ' . $day->getDate()->format('Y-m-d') . PHP_EOL;
// Echo our the day temperature. Also caontains $day->getNight()->temperature()
echo 'Temp: ' . $day->getDay()->getTemperature() . PHP_EOL;
// Gust Speed
echo 'Gust: ' . $day->getDay()->getGustSpeed() . PHP_EOL;
// Wind speed
echo 'Wind: ' . $day->getDay()->getWindSpeed() . PHP_EOL;
// Weather type based on the meta offices API (https://www.metoffice.gov.uk/datapoint/support/documentation/code-definitions)
echo 'Weather type: ' . $day->getDay()->getWeatherType() . PHP_EOL;
echo PHP_EOL;
```

#### Observerations

[](#observerations)

```
//You're API key from the MetOffice
$client = new \Jberns88\MetOffice\Client(['key' => '']);
// Grab all the locations where observation data is available.
$locations = $client->getObservationLocations();
// Find the nearest location from some geo coordinates
$location = $locations->getNearest(51.509865, -0.118092);
// Get the observations
$observations = $location->getHourlyObservations();
// get the observation day
$day = $observations->getByDate(new \DateTime('yesterday'));

echo 'Location: ' . $location->getName() . PHP_EOL;
// Grab the highest and lowest temperatures from the day
echo 'Temp: ' . $day->getLowestTemperature() . '-' . $day->getHighestTemperature() . PHP_EOL;
// Grab the highest and lowest gust speeds for the day
echo 'Gust: ' . $day->getHighestGustSpeed() . '-' . $day->getLowestGustSpeed() . PHP_EOL;
// Grab the highest and lowest wind speeds for the day
echo 'Wind: ' . $day->getHighestWindSpeed() . '-' . $day->getLowestWindSpeed() . PHP_EOL;

//Get the observation time peroid. It will find the nearest one if an exact hour isn't given. THe met office don't hold the data for long so I've set the time quite late for this example
$period = $day->getByTime(new \DateTime('11pm'));
// Weather type based on the meta offices API (https://www.metoffice.gov.uk/datapoint/support/documentation/code-definitions)
echo 'Weather type: ' . $period->getWeatherType() . PHP_EOL;
```

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~621 days

Total

3

Last Release

1788d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/62212617?v=4)[Matvey Shemyakin](/maintainers/MrAvenger)[@MrAvenger](https://github.com/MrAvenger)

---

Top Contributors

[![jberns88](https://avatars.githubusercontent.com/u/4931463?v=4)](https://github.com/jberns88 "jberns88 (9 commits)")

### Embed Badge

![Health badge](/badges/jberns88-metoffice/health.svg)

```
[![Health](https://phpackages.com/badges/jberns88-metoffice/health.svg)](https://phpackages.com/packages/jberns88-metoffice)
```

###  Alternatives

[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3661.2M46](/packages/tencentcloud-tencentcloud-sdk-php)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k496.1k33](/packages/neuron-core-neuron-ai)[avalara/avataxclient

Client library for Avalara's AvaTax suite of business tax calculation and processing services. Uses the REST v2 API.

528.3M7](/packages/avalara-avataxclient)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

252.5k](/packages/eslazarev-wildberries-sdk)[files.com/files-php-sdk

Files.com PHP SDK

2478.1k](/packages/filescom-files-php-sdk)[aimeos/prisma

A powerful PHP package for integrating media related Large Language Models (LLMs) into your applications

1942.4k4](/packages/aimeos-prisma)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
