PHPackages                             decole/yr-no - 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. decole/yr-no

ActiveLibrary

decole/yr-no
============

yr.no api php client

1.0.1(4y ago)081MITPHPPHP ^7.4||^8.0

Since Oct 31Pushed 4y ago1 watchersCompare

[ Source](https://github.com/decole/yr.no-api-client-php)[ Packagist](https://packagist.org/packages/decole/yr-no)[ RSS](/packages/decole-yr-no/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (2)Dependencies (1)Versions (2)Used By (0)

Yr.no API Client PHP
====================

[](#yrno-api-client-php)

Install by composer

```
$ composer require decole/yr-no
```

A client library written in PHP with Laravel support.

> This library uses unofficial publicly accessible API endpoints of the website , so keep in mind that some endpoints could stop working anytime. Anyway, open an issue if something is broken or missing.

Optionally, if you use **Laravel**, you can publish the config file of this package with this command:

```
$ php artisan vendor:publish --provider="Decole\YrNo\Adapters\Laravel\YrNoServiceProvider" --tag=config
```

Configuration
-------------

[](#configuration)

The following config file will be published in `config/yrno.php`, set `location` and `language`. Example configuration is already set in the default settings.

```
return [
    'location' => '2-553287',
    'language' => 'en',
];
```

Possible languages:
-------------------

[](#possible-languages)

```
 'language' => 'nb', - Ireland
 'language' => 'nn', - Norwegian
 'language' => 'en', - English

```

Find city location id by city name. For example, it`s 'moscow'
--------------------------------------------------------------

[](#find-city-location-id-by-city-name-for-example-its-moscow)

```
(new YrNoClient('2-553287', 'en'))->location()->suggest('moscow');
```

Response: you need to find the will **"id"**. In this example, this is **2-553287**

> find id: **\_embedded** -&gt; **location** -&gt; object element -&gt; **id** - ("2-524901")
>
> find region: **\_embedded** -&gt; **location** -&gt; object element -&gt; **region** -&gt; **id** - ("RU/48")

Response json:

```
{
  "totalResults": 5,
  "_links": {
    "self": {
      "href": "/api/v0/locations"
    },
    "page": {
      "href": "/api/v0/locations{?page}",
      "templated": true
    },
    "search": {
      "href": "/api/v0/locations/search{?q}",
      "templated": true
    },
    "location": [
      {
        "href": "/api/v0/locations/2-524901"
      },
      ...
    ]
  },
  "_embedded": {
    "location": [
      {
        "category": {
          "id": "CA01",
          "name": "Capital"
        },
        "id": "2-524901",
        "name": "Moscow",
        "position": {
          "lat": 55.75222,
          "lon": 37.61556
        },
        "elevation": 144,
        "timeZone": "Europe/Moscow",
        "urlPath": "Russia/Moscow/Moscow",
        "country": {
          "id": "RU",
          "name": "Russia"
        },
        "region": {
          "id": "RU/48",
          "name": "Moscow"
        },
        "isInOcean": false,
        "_links": {
          "self": {
            "href": "/api/v0/locations/2-524901"
          },
          "celestialevents": {
            "href": "/api/v0/locations/2-524901/celestialevents"
          },
          "forecast": {
            "href": "/api/v0/locations/2-524901/forecast"
          },
          "mapfeature": {
            "href": "/api/v0/locations/2-524901/mapfeature"
          },
          "currenthour": {
            "href": "/api/v0/locations/2-524901/forecast/currenthour"
          },
          "observations": {
            "href": "/api/v0/locations/2-524901/observations"
          },
          "auroraforecast": {
            "href": "/api/v0/locations/2-524901/auroraforecast"
          }
        }
      },
      ...
    ]
  }
}
```

How to use
----------

[](#how-to-use)

Example:

```
use Decole\YrNo\YrNoClient;

$location = '2-553287';
$lang = 'en';
$api = new YrNoClient($location, $lang);
$data = $api->location()->suggest('moscow'); // Read on to explore all available methods
```

\##API methods using Laravel facades:

**Location**

```
//Get locations by current city
YrNoClient::location()->get();

//Forecast by current city
YrNoClient::location()->foreCast();

//Weather forecast current hour by current city
YrNoClient::location()->currentHour();

//Celestial events by current city
YrNoClient::location()->celestialEvents();

//Search city id, region id and another city params
YrNoClient::location()->suggest('some city');
```

**Article**

```
//get article
YrNoClient::article()->get();
```

**Region**

```
//Get region by region id
YrNoClient::region()->get('NO');

//Get region water temperatures
YrNoClient::region()->waterTemperatures('NO-42');
```

**ServiceAnnouncement**

```
//Service Announcement app by yr.no cite
YrNoClient::serviceAnnouncement()->get();
```

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community5

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

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

Unknown

Total

1

Last Release

1658d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/fbf53a02a7c880c262486d8a27a517da8f3fde3373532ff5e59c0c822d586c48?d=identicon)[decole](/maintainers/decole)

### Embed Badge

![Health badge](/badges/decole-yr-no/health.svg)

```
[![Health](https://phpackages.com/badges/decole-yr-no/health.svg)](https://phpackages.com/packages/decole-yr-no)
```

###  Alternatives

[neuron-core/neuron-ai

The PHP Agentic Framework.

1.8k245.3k21](/packages/neuron-core-neuron-ai)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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