{"id":36970964,"url":"https://github.com/rakibdevs/openweather-laravel-api","last_synced_at":"2026-01-13T21:51:27.971Z","repository":{"id":48307163,"uuid":"328006212","full_name":"rakibdevs/openweather-laravel-api","owner":"rakibdevs","description":"Laravel OpenWeather API  is a Laravel package to connect Open Weather Map API and get wether data in your own format laravel app.","archived":false,"fork":false,"pushed_at":"2023-06-12T10:21:00.000Z","size":67,"stargazers_count":75,"open_issues_count":2,"forks_count":9,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-24T02:22:01.841Z","etag":null,"topics":["api","laravel","openweathermap-api","package","weather"],"latest_commit_sha":null,"homepage":"","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/rakibdevs.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-01-08T20:32:53.000Z","updated_at":"2025-08-27T19:51:25.000Z","dependencies_parsed_at":"2024-06-19T06:11:11.962Z","dependency_job_id":"bb658807-9b4a-43a1-bdbb-3569c400ad5d","html_url":"https://github.com/rakibdevs/openweather-laravel-api","commit_stats":{"total_commits":52,"total_committers":7,"mean_commits":7.428571428571429,"dds":0.6346153846153846,"last_synced_commit":"7d771c3c4e8f1d401df582ce9d28411e72acbfd2"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/rakibdevs/openweather-laravel-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rakibdevs%2Fopenweather-laravel-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rakibdevs%2Fopenweather-laravel-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rakibdevs%2Fopenweather-laravel-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rakibdevs%2Fopenweather-laravel-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rakibdevs","download_url":"https://codeload.github.com/rakibdevs/openweather-laravel-api/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rakibdevs%2Fopenweather-laravel-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28401607,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-13T14:36:09.778Z","status":"ssl_error","status_checked_at":"2026-01-13T14:35:19.697Z","response_time":56,"last_error":"SSL_read: 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":["api","laravel","openweathermap-api","package","weather"],"created_at":"2026-01-13T21:51:27.355Z","updated_at":"2026-01-13T21:51:27.963Z","avatar_url":"https://github.com/rakibdevs.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Laravel [Open Weather](https://openweathermap.org/) API\n\n![Packagist](https://img.shields.io/packagist/dt/rakibdevs/openweather-laravel-api)\n[![GitHub stars](https://img.shields.io/github/stars/rakibdevs/openweather-laravel-api)](https://github.com/rakibdevs/openweather-laravel-api/stargazers)\n[![GitHub forks](https://img.shields.io/github/forks/rakibdevs/openweather-laravel-api)](https://github.com/rakibdevs/openweather-laravel-api/network)\n[![GitHub issues](https://img.shields.io/github/issues/rakibdevs/openweather-laravel-api)](https://github.com/rakibdevs/openweather-laravel-api/issues)\n[![GitHub license](https://img.shields.io/github/license/rakibdevs/openweather-laravel-api)](https://github.com/rakibdevs/openweather-laravel-api/blob/master/LICENSE)\n\n Laravel OpenWeather API (openweather-laravel-api) is a Laravel package to connect Open Weather Map APIs ( https://openweathermap.org/api ) and access free API services (current weather, weather forecast, weather history) easily.\n\n## Supported APIs\n| APIs | Get data by | \n| --- | --- |\n| [Current Weather](https://openweathermap.org/current) | By city name, city ID, geographic coordinates, ZIP code |\n| [One Call API](https://openweathermap.org/api/one-call-api) | By geographic coordinates|\n| [4 Day 3 Hour Forecast](https://openweathermap.org/forecast5) | By city name, city ID, geographic coordinates, ZIP code |\n| [5 Day Historical](https://openweathermap.org/api/one-call-api#history) | By geographic coordinates |\n| [Air Pollution](https://openweathermap.org/api/air-pollution) | By geographic coordinates |\n| [Geocoding API](https://openweathermap.org/api/geocoding-api) | By geographic coordinates |\n\n\n## Installation\n\nInstall the package through [Composer](http://getcomposer.org).\nOn the command line:\n\n```\ncomposer require rakibdevs/openweather-laravel-api\n\n```\n\n\n## Configuration \nIf Laravel \u003e 7, no need to add provider\n\nAdd the following to your `providers` array in `config/app.php`:\n\n```php\n'providers' =\u003e [\n    // ...\n    RakibDevs\\Weather\\WeatherServiceProvider::class,\n],\n'aliases' =\u003e [\n    //...\n    'Weather' =\u003e RakibDevs\\Weather\\Weather::class,\t\n];\n\n\n```\nAdd API key and desired language in `.env`\n```\nOPENWEATHER_API_KEY=\nOPENWEATHER_API_LANG=en\n```\n\nPublish the required package configuration file using the artisan command:\n```\n\t$ php artisan vendor:publish\n```\nEdit the `config/openweather.php` file and modify the `api_key` value with your Open Weather Map api key.\n```php\n\treturn [\n\t    'api_key' \t        =\u003e env('OPENWEATHER_API_KEY', ''),\n    \t    'onecall_api_version' =\u003e '2.5',\n            'historical_api_version' =\u003e '2.5',\n            'forecast_api_version' =\u003e '2.5',\n            'polution_api_version' =\u003e '2.5',\n            'geo_api_version' =\u003e '1.0',\n\t    'lang' \t\t=\u003e env('OPENWEATHER_API_LANG', 'en'),\n\t    'date_format'       =\u003e 'm/d/Y',\n\t    'time_format'       =\u003e 'h:i A',\n\t    'day_format'        =\u003e 'l',\n\t    'temp_format'       =\u003e 'c'         // c for celcius, f for farenheit, k for kelvin\n\t];\n```\n\nNow you can configure API version from config as [One Call API](https://openweathermap.org/price) is upgraded to version 3.0. Please set available api version in config. \n\n\n## Usage\nHere you can see some example of just how simple this package is to use.\n\n```php\nuse RakibDevs\\Weather\\Weather;\n\n$wt = new Weather();\n\n$info = $wt-\u003egetCurrentByCity('dhaka');    // Get current weather by city name\n\n\n```\n\n### [Current weather](https://openweathermap.org/current) \nAccess current weather data for any location on Earth including over 200,000 cities! [OpenWeather](https://openweathermap.org/) collect and process weather data from different sources such as global and local weather models, satellites, radars and vast network of weather stations\n\n```php\n\n// By city name\n$info = $wt-\u003egetCurrentByCity('dhaka'); \n\n// By city ID - download list of city id here http://bulk.openweathermap.org/sample/\n$info = $wt-\u003egetCurrentByCity(1185241); \n\n// By Zip Code - string with country code \n$info = $wt-\u003egetCurrentByZip('94040,us');  // If no country code specified, us will be default\n\n// By coordinates : latitude and longitude\n$info = $wt-\u003egetCurrentByCord(23.7104, 90.4074);\n\n```\n\n#### Output:\n```\n{\n  \"coord\": {\n    \"lon\": 90.4074\n    \"lat\": 23.7104\n  }\n  \"weather\":[\n    0 =\u003e { \n      \"id\": 721\n      \"main\": \"Haze\"\n      \"description\": \"haze\"\n      \"icon\": \"50d\"\n    }\n  ]\n  \"base\": \"stations\"\n  \"main\": {\n    \"temp\": 26\n    \"feels_like\": 25.42\n    \"temp_min\": 26\n    \"temp_max\": 26\n    \"pressure\": 1009\n    \"humidity\": 57\n  }\n  \"visibility\": 3500\n  \"wind\": {\n    \"speed\": 4.12\n    \"deg\": 280\n  }\n  \"clouds\": {\n    \"all\": 85\n  }\n  \"dt\": \"01/09/2021 04:16 PM\"\n  \"sys\": {\n    \"type\": 1\n    \"id\": 9145\n    \"country\": \"BD\"\n    \"sunrise\": \"01/09/2021 06:42 AM\"\n    \"sunset\": \"01/09/2021 05:28 PM\"\n  }\n  \"timezone\": 21600\n  \"id\": 1185241\n  \"name\": \"Dhaka\"\n  \"cod\": 200\n}\n\n```\n\n### [One Call API](https://openweathermap.org/api/one-call-api) \nMake just one API call and get all your essential weather data for a specific location with OpenWeather One Call API.\n\n```php\n// By coordinates : latitude and longitude\n$info = $wt-\u003egetOneCallByCord(23.7104, 90.4074);\n\n```\n\n### [4 Day 3 Hour Forecast](https://openweathermap.org/forecast5) \n4 day forecast is available at any location or city. It includes weather forecast data with 3-hour step.\n\n```php\n// By city name\n$info = $wt-\u003eget3HourlyByCity('dhaka'); \n\n// By city ID - download list of city id here http://bulk.openweathermap.org/sample/\n$info = $wt-\u003eget3HourlyByCity(1185241); \n\n// By Zip Code - string with country code \n$info = $wt-\u003eget3HourlyByZip('94040,us');  // If no country code specified, us will be default\n\n// By coordinates : latitude and longitude\n$info = $wt-\u003eget3HourlyByCord(23.7104, 90.4074);\n\n```\n\n### [5 Day Historical](https://openweathermap.org/api/one-call-api#history) \nGet access to historical weather data for the previous 5 days.\n\n```php\n\n// By coordinates : latitude, longitude and date\n$info = $wt-\u003egetHistoryByCord(23.7104, 90.4074, '2020-01-09');\n\n```\n\n### [Air Pollution](https://openweathermap.org/api/one-call-api#history) \nAir Pollution API provides current, forecast and historical air pollution data for any coordinates on the globe\n\nBesides basic Air Quality Index, the API returns data about polluting gases, such as Carbon monoxide (CO), Nitrogen monoxide (NO), Nitrogen dioxide (NO2), Ozone (O3), Sulphur dioxide (SO2), Ammonia (NH3), and particulates (PM2.5 and PM10).\n\nAir pollution forecast is available for 5 days with hourly granularity. Historical data is accessible from 27th November 2020.\n\n```php\n\n// By coordinates : latitude, longitude and date\n$info = $wt-\u003egetAirPollutionByCord(23.7104, 90.4074);\n\n```\n\n### [Geocoding API](https://openweathermap.org/api/one-call-api#history) \nGeocoding API is a simple tool that we have developed to ease the search for locations while working with geographic names and coordinates.\n-\u003e Direct geocoding converts the specified name of a location or area into the exact geographical coordinates;\n-\u003e Reverse geocoding converts the geographical coordinates into the names of the nearby locations.\n\n```php\n// By city name\n$info = $wt-\u003egetGeoByCity('dhaka');\n\n// By coordinates : latitude, longitude and date\n$info = $wt-\u003egetGeoByCity(23.7104, 90.4074);\n\n```\n\n### [Free API Limitations](https://openweathermap.org/api/one-call-api#history) \n- 60 calls/minute \n- 1,000,000 calls/month\n- 1000 calls/day when using Onecall requests\n\n\n\n## License\n\nLaravel Open Weather API is licensed under [The MIT License (MIT)](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frakibdevs%2Fopenweather-laravel-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frakibdevs%2Fopenweather-laravel-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frakibdevs%2Fopenweather-laravel-api/lists"}