{"id":36992944,"url":"https://github.com/decole/yr.no-api-client-php","last_synced_at":"2026-01-13T23:45:06.835Z","repository":{"id":56964559,"uuid":"420794788","full_name":"decole/yr.no-api-client-php","owner":"decole","description":null,"archived":false,"fork":false,"pushed_at":"2021-10-31T19:21:28.000Z","size":12,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-09T12:42:25.783Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/decole.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-10-24T21:00:09.000Z","updated_at":"2021-10-31T19:21:31.000Z","dependencies_parsed_at":"2022-08-21T06:10:15.422Z","dependency_job_id":null,"html_url":"https://github.com/decole/yr.no-api-client-php","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/decole/yr.no-api-client-php","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/decole%2Fyr.no-api-client-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/decole%2Fyr.no-api-client-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/decole%2Fyr.no-api-client-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/decole%2Fyr.no-api-client-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/decole","download_url":"https://codeload.github.com/decole/yr.no-api-client-php/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/decole%2Fyr.no-api-client-php/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28405275,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-13T21:51:37.118Z","status":"ssl_error","status_checked_at":"2026-01-13T21:45:14.585Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-13T23:45:06.779Z","updated_at":"2026-01-13T23:45:06.830Z","avatar_url":"https://github.com/decole.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Yr.no API Client PHP\n\nInstall by composer\n\n``` bash\n$ composer require decole/yr-no\n```\n\nA client library written in PHP with Laravel support.\n\n\u003e This library uses unofficial publicly accessible API endpoints of the website https://www.yr.no, so keep in mind that some endpoints could stop working anytime. Anyway, open an issue if something is broken or missing.\n\nOptionally, if you use **Laravel**, you can publish the config file of this package with this command:\n\n``` bash\n$ php artisan vendor:publish --provider=\"Decole\\YrNo\\Adapters\\Laravel\\YrNoServiceProvider\" --tag=config\n```\n\n## Configuration\nThe following config file will be published in `config/yrno.php`, set `location` and `language`. Example configuration is already set in the default settings.\n\n```php\nreturn [  \n    'location' =\u003e '2-553287',\n    'language' =\u003e 'en',\n];\n```\n\n## Possible languages:\n```\n 'language' =\u003e 'nb', - Ireland\n 'language' =\u003e 'nn', - Norwegian\n 'language' =\u003e 'en', - English\n```\n\n## Find city location id by city name. For example, it`s 'moscow'\n```php\n(new YrNoClient('2-553287', 'en'))-\u003elocation()-\u003esuggest('moscow');\n```\n\nResponse: you need to find the will **\"id\"**. In this example, this is **2-553287**\n\n\u003e find id:  **_embedded** -\u003e **location** -\u003e object element -\u003e **id**  -  (\"2-524901\") \n\u003e \n\u003e find region:  **_embedded** -\u003e **location** -\u003e object element -\u003e **region** -\u003e **id**  -  (\"RU/48\")\n\nResponse json:\n```json\n{\n  \"totalResults\": 5,\n  \"_links\": {\n    \"self\": {\n      \"href\": \"/api/v0/locations\"\n    },\n    \"page\": {\n      \"href\": \"/api/v0/locations{?page}\",\n      \"templated\": true\n    },\n    \"search\": {\n      \"href\": \"/api/v0/locations/search{?q}\",\n      \"templated\": true\n    },\n    \"location\": [\n      {\n        \"href\": \"/api/v0/locations/2-524901\"\n      },\n      ...\n    ]\n  },\n  \"_embedded\": {\n    \"location\": [\n      {\n        \"category\": {\n          \"id\": \"CA01\",\n          \"name\": \"Capital\"\n        },\n        \"id\": \"2-524901\",\n        \"name\": \"Moscow\",\n        \"position\": {\n          \"lat\": 55.75222,\n          \"lon\": 37.61556\n        },\n        \"elevation\": 144,\n        \"timeZone\": \"Europe/Moscow\",\n        \"urlPath\": \"Russia/Moscow/Moscow\",\n        \"country\": {\n          \"id\": \"RU\",\n          \"name\": \"Russia\"\n        },\n        \"region\": {\n          \"id\": \"RU/48\",\n          \"name\": \"Moscow\"\n        },\n        \"isInOcean\": false,\n        \"_links\": {\n          \"self\": {\n            \"href\": \"/api/v0/locations/2-524901\"\n          },\n          \"celestialevents\": {\n            \"href\": \"/api/v0/locations/2-524901/celestialevents\"\n          },\n          \"forecast\": {\n            \"href\": \"/api/v0/locations/2-524901/forecast\"\n          },\n          \"mapfeature\": {\n            \"href\": \"/api/v0/locations/2-524901/mapfeature\"\n          },\n          \"currenthour\": {\n            \"href\": \"/api/v0/locations/2-524901/forecast/currenthour\"\n          },\n          \"observations\": {\n            \"href\": \"/api/v0/locations/2-524901/observations\"\n          },\n          \"auroraforecast\": {\n            \"href\": \"/api/v0/locations/2-524901/auroraforecast\"\n          }\n        }\n      },\n      ...\n    ]\n  }\n}\n```\n\n## How to use\n\nExample:\n```php\nuse Decole\\YrNo\\YrNoClient;\n\n$location = '2-553287';  \n$lang = 'en';  \n$api = new YrNoClient($location, $lang);  \n$data = $api-\u003elocation()-\u003esuggest('moscow'); // Read on to explore all available methods\n```\n\n##API methods using Laravel facades:\n\n**Location**\n```php\n//Get locations by current city\nYrNoClient::location()-\u003eget();\n\n//Forecast by current city\nYrNoClient::location()-\u003eforeCast();\n\n//Weather forecast current hour by current city\nYrNoClient::location()-\u003ecurrentHour();\n\n//Celestial events by current city\nYrNoClient::location()-\u003ecelestialEvents();\n\n//Search city id, region id and another city params \nYrNoClient::location()-\u003esuggest('some city');\n```\n\n**Article**\n```php\n//get article\nYrNoClient::article()-\u003eget();\n```\n\n**Region**\n```php\n//Get region by region id\nYrNoClient::region()-\u003eget('NO');\n\n//Get region water temperatures\nYrNoClient::region()-\u003ewaterTemperatures('NO-42');\n```\n\n**ServiceAnnouncement**\n```php\n//Service Announcement app by yr.no cite\nYrNoClient::serviceAnnouncement()-\u003eget();\n```\n\n## License\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdecole%2Fyr.no-api-client-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdecole%2Fyr.no-api-client-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdecole%2Fyr.no-api-client-php/lists"}