Skip to content

omnilab/brightsky API reference

Floor
Provider · Omnilab
Version
1.x
Conformance suite
not wired
Verified for real
Its README does not say
Licence
MIT
composer require omnilab/brightsky:1.x-dev

Read from the package's own PHP files at the commit e4e6e6e16b27: its namespaces, classes, interfaces and enums, their public constants, properties and methods with their PHPDoc, and the options its factories take. Nothing of it is run.

Omnilab\BrightSky

  • BrightSkySource class

    The Deutscher Wetterdienst's open data through Bright Sky (api.brightsky.dev): hourly weather at a point or at a DWD station - observations back to 2010 (the station records, today's reports) joined to the MOSMIX forecasts ten days ahead - temperature, dew point, humidity, precipitation, pressure, wind and gusts, cloud cover, visibility, sunshine, solar irradiation, the probability of precipitation; and a station as an entity.

    5 methods · 2 constants

  • BrightSkySourceFactory class

    Bright Sky: the Deutscher Wetterdienst's observations and MOSMIX forecasts, hourly, at a point or a station - no key.

    3 options

Omnilab\BrightSky

BrightSkySource class

final class BrightSkySource extends HttpSource BrightSkySource.php:31

The Deutscher Wetterdienst's open data through Bright Sky (api.brightsky.dev): hourly weather at a point or at a DWD station - observations back to 2010 (the station records, today's reports) joined to the MOSMIX forecasts ten days ahead - temperature, dew point, humidity, precipitation, pressure, wind and gusts, cloud cover, visibility, sunshine, solar irradiation, the probability of precipitation; and a station as an entity.

No key. Observations are dense in Germany; the forecasts cover the world, sparsely outside it.

const BASE_URI = 'https://api.brightsky.dev/'
const VARIABLES = ['temperature' => '°C', 'dew_point' => '°C', 'relative_humidity' => '%', 'precipitation' => 'mm', 'precipitation_probability' => '%', 'pressure_msl' => 'hPa'…

The variables series() serves, with their unit (Bright Sky's "dwd" units).

BrightSkySource::__construct()

public function __construct(HttpClientInterface $http, readonly ?int $maxDistance = null, string $baseUri = self::BASE_URI, array $headers = [], float $throttle = 0.0)
$maxDistance

how far from a Point a record may come, in metres (null: Bright Sky's default)

BrightSkySource::getName()

public function getName(): string

BrightSkySource::capabilities()

public function capabilities(): array

BrightSkySource::entity()

public function entity(Identifier|string $id): ?Entity

A DWD station (dwd:01420) or a WMO station (wmo:10637): its name, place and height, the period of its records and the kinds of records Bright Sky has of it (historical, current, synop, forecast). One call; null when unknown.

BrightSkySource::series()

public function series(SeriesQuery $query): array

The hourly weather at a Point (Bright Sky picks the nearest records within max_dist, a station's observations then a forecast) or at a station (dwd.station, or wigos for a WMO index), one series per variable asked, in one call: hourly as given, or the days made from the hours (SeriesQuery::DAILY with Series::MEAN, MAX, MIN or SUM) in the query's time zone (UTC by default). The period defaults to today; a date without a time is the whole day. A series is a forecast when every hour comes from MOSMIX, observed when none does, null when mixed.

BrightSkySourceFactory class

final class BrightSkySourceFactory extends SourceFactory BrightSkySourceFactory.php:20

Bright Sky: the Deutscher Wetterdienst's observations and MOSMIX forecasts, hourly, at a point or a station - no key.

options: mailto: 'support@glitchr.io' # in the User-Agent max_distance: ~ # metres: how far from a Point a record may come (null: Bright Sky's default) throttle: 0 # seconds between two calls: Bright Sky publishes no figure base_uri: 'https://api.brightsky.dev/' # or a self-hosted instance

Options

OptionDefault
max_distancenull
throttle0.0
base_uriBrightSkySource::BASE_URI