{"id":37009264,"url":"https://github.com/dnsimmons/openweather","last_synced_at":"2026-01-14T00:52:50.516Z","repository":{"id":47338958,"uuid":"172308194","full_name":"dnsimmons/openweather","owner":"dnsimmons","description":"OpenWeather is a Laravel package simplifying working with the free Open Weather Map APIs.","archived":false,"fork":false,"pushed_at":"2024-01-25T19:44:42.000Z","size":32,"stargazers_count":20,"open_issues_count":0,"forks_count":9,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-20T01:22:40.679Z","etag":null,"topics":["laravel","openweather","php","weather","weather-api"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dnsimmons.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-02-24T07:19:11.000Z","updated_at":"2024-02-28T22:03:15.000Z","dependencies_parsed_at":"2024-06-20T21:48:50.148Z","dependency_job_id":null,"html_url":"https://github.com/dnsimmons/openweather","commit_stats":{"total_commits":36,"total_committers":3,"mean_commits":12.0,"dds":"0.11111111111111116","last_synced_commit":"83c6e530d21cd154231ee3eb8c719fdc30c69031"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/dnsimmons/openweather","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dnsimmons%2Fopenweather","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dnsimmons%2Fopenweather/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dnsimmons%2Fopenweather/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dnsimmons%2Fopenweather/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dnsimmons","download_url":"https://codeload.github.com/dnsimmons/openweather/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dnsimmons%2Fopenweather/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28407445,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T00:40:43.272Z","status":"ssl_error","status_checked_at":"2026-01-14T00:40:42.636Z","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":["laravel","openweather","php","weather","weather-api"],"created_at":"2026-01-14T00:52:50.441Z","updated_at":"2026-01-14T00:52:50.506Z","avatar_url":"https://github.com/dnsimmons.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OpenWeather\n\n\n[![Latest Stable Version](https://poser.pugx.org/dnsimmons/openweather/v/stable)](https://packagist.org/packages/dnsimmons/openweather)\n[![Latest Unstable Version](https://poser.pugx.org/dnsimmons/openweather/v/unstable)](https://packagist.org/packages/dnsimmons/openweather)\n[![Total Downloads](https://poser.pugx.org/dnsimmons/openweather/downloads)](https://packagist.org/packages/dnsimmons/openweather)\n[![License](https://poser.pugx.org/dnsimmons/openweather/license)](https://packagist.org/packages/dnsimmons/openweather)\n\n\n## About\n\nOpenWeather is a [Laravel](https://laravel.com) package simplifying working with the free [Open Weather Map](https://openweathermap.org) APIs. \n\nOpenWeather takes care of making requests to various free Open Weather Map APIs and\nreturns well-structured easy to use weather data including conditions, temperatures, humidity, \npressure, wind, location, and timestamp data.\n\nTake a look at the Example Usage section output below for a typical structured response.\n\n### Supported APIs\n\nThe package supports the following free Open Weather Map APIs:\n\n- [Current Weather](https://openweathermap.org/current)\n- [4 Day 3 Hour Forecast](https://openweathermap.org/api/hourly-forecast)\n- [Onecall Forecast](https://openweathermap.org/api/one-call-api)\n- [5 Day Historical](https://openweathermap.org/api/one-call-api#history)\n\n### Free API Limitations\n\n- 60 calls/minute up to 1,000,000 calls/month\n- 1000 calls/day when using Onecall requests\n\n### Requirements\n\n- A valid Open Weather Maps API Key (AppID).\n\n## Install\n\nUse [composer](http://getcomposer.org) to install the package\n\n\t$ composer require dnsimmons/openweather\n\nFor Laravel \u003e= 5.5 the package is auto-discovered.\n\nFor older Laravel versions prior to 5.5 add the service provider to your `config/app.php` along with an alias:\n\n    'providers' =\u003e [\n\t\t...\n        Dnsimmons\\OpenWeather\\OpenWeatherServiceProvider::class,\n\t];\n\n    'aliases' =\u003e [\n\t\t...\n\t    'OpenWeather' =\u003e Dnsimmons\\OpenWeather\\OpenWeather::class,\t\n\t];\n\n\nPublish the required package configuration file using the artisan command:\n\n\t$ php artisan vendor:publish\n\nEdit the `.env` file in your Laravel instance add the following environment variables and add your OpenWeather API key:\n\n\tOPENWEATHER_API_KEY=\"your-api-key\"\n\tOPENWEATHER_API_LANG=\"en\"\n\tOPENWEATHER_API_DATE_FORMAT=\"m/d/Y\"\n\tOPENWEATHER_API_TIME_FORMAT=\"h:i A\"\n\tOPENWEATHER_API_DAY_FORMAT=\"l\"\n\n## Example Usage\n\nIn the example below we fetch the current weather by postal code.\n\n\t$weather = new OpenWeather();\n\t$current = $weather-\u003egetCurrentWeatherByPostal('02111');\n\tprint_r($current);\n\n**Output**\n\n    Array\n    (\n        [formats] =\u003e Array\n            (\n                [lang] =\u003e en\n                [date] =\u003e m/d/Y\n                [day] =\u003e l\n                [time] =\u003e h:i A\n                [units] =\u003e imperial\n            )\n    \n        [datetime] =\u003e Array\n            (\n                [timestamp] =\u003e 1593387767\n                [timestamp_sunrise] =\u003e 1593335394\n                [timestamp_sunset] =\u003e 1593390304\n                [formatted_date] =\u003e 06/28/2020\n                [formatted_day] =\u003e Sunday\n                [formatted_time] =\u003e 11:42 PM\n                [formatted_sunrise] =\u003e 09:09 AM\n                [formatted_sunset] =\u003e 12:25 AM\n            )\n    \n        [location] =\u003e Array\n            (\n                [id] =\u003e 4930956\n                [name] =\u003e Boston\n                [country] =\u003e US\n                [latitude] =\u003e 42.36\n                [longitude] =\u003e -71.06\n            )\n    \n        [condition] =\u003e Array\n            (\n                [id]   =\u003e 801\n                [name] =\u003e Rain\n                [desc] =\u003e light rain\n                [icon] =\u003e https://openweathermap.org/img/w/10d.png\n            )\n\n        [wind] =\u003e Array\n            (\n                [speed] =\u003e 11.5\n                [deg] =\u003e 113\n                [direction] =\u003e SE\n            )\n    \n        [forecast] =\u003e Array\n            (\n                [temp] =\u003e 67\n                [temp_min] =\u003e 64\n                [temp_max] =\u003e 68\n                [pressure] =\u003e 1007\n                [humidity] =\u003e 88\n            )\n    \n    )\n\n## Methods\n\nAll methods return an array on success and FALSE on failure.\n\n### Current Weather Methods\n\n**getCurrentWeatherByCityName**(*string $city*, *string $units*)\n\n**Params**\n- City Name (example: Boston)\n- Units (imperial (default), metric, or kelvin)\n\n**getCurrentWeatherByCityId**(*int $id*, *string $units*)\n\n**Params**\n- City ID\n- Units (imperial (default), metric, or kelvin)\n\n**getCurrentWeatherByCoords**(*string $latitude*, *string $longitude*, *string $units*)\n\n**Params**\n- Latitude\n- Longitude\n- Units (imperial (default), metric, or kelvin)\n\n**getCurrentWeatherByPostal**(*string $postal*, *string $units*)\n\n**Params**\n- US Postal Code\n- Units (imperial (default), metric, or kelvin)\n\n### 4 Day 3 Hour Forecast Methods\n\n**getForecastWeatherByCityName**(*string $city*, *string $units*)\n\n**Params**\n- City Name (example: Boston)\n- Units (imperial (default), metric, or kelvin)\n\n**getForecastWeatherByCityId**(*int $id*, *string $units*)\n\n**Params**\n- City ID\n- Units (imperial (default), metric, or kelvin)\n\n**getForecastWeatherByCoords**(*string $latitude*, *string $longitude*, *string $units*)\n\n**Params**\n- Latitude\n- Longitude\n- Units (imperial (default), metric, or kelvin)\n\n**getForecastWeatherByPostal**(*string $postal*, *string $units*)\n\n**Params**\n- US Postal Code\n- Units (imperial (default), metric, or kelvin)\n\n### Onecall Request Methods\n\n**getOnecallWeatherByCoords**(*string $latitude*, *string $longitude*, *string $units*, *string $exclude*)\n\n**Params**\n- Latitude\n- Longitude\n- Units (imperial (default), metric, or kelvin)\n- Exclude (optional comma separated values: current,hourly,daily) \n\n### Onecall Historical Request Methods\n\n**getHistoricalWeatherByCoords**(*string $latitude*, *string $longitude*, *string $date*, *string $units*)\n\n**Params**\n- Latitude\n- Longitude\n- Date (example: 7/12/2020)\n- Units (imperial (default), metric, or kelvin)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdnsimmons%2Fopenweather","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdnsimmons%2Fopenweather","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdnsimmons%2Fopenweather/lists"}