|
1 | 1 | ## Laravel [Open Weather](https://openweathermap.org/) API
|
2 |
| - |
| 2 | + 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 easily. |
3 | 3 |
|
4 | 4 | ## Supported APIs
|
5 |
| -| Operation | English Input | |
| 5 | +| APIs | Get data by | |
6 | 6 | | --- | --- |
|
7 | 7 | | [Current Weather](https://openweathermap.org/current) | By city name, city ID, geographic coordinates, ZIP code |
|
8 | 8 | | [One Call API](https://openweathermap.org/api/one-call-api) | By geographic coordinates|
|
@@ -167,6 +167,49 @@ $info = $wt->get3HourlyByCord(23.7104, 90.4074);
|
167 | 167 |
|
168 | 168 | ```
|
169 | 169 |
|
| 170 | +### [5 Day Historical](https://openweathermap.org/api/one-call-api#history) |
| 171 | +Get access to historical weather data for the previous 5 days. |
| 172 | + |
| 173 | +```php |
| 174 | + |
| 175 | +// By coordinates : latitude, longitude and date |
| 176 | +$info = $wt->getHistoryByCord(23.7104, 90.4074, '2020-01-09'); |
| 177 | + |
| 178 | +``` |
| 179 | + |
| 180 | +### [Air Pollution](https://openweathermap.org/api/one-call-api#history) |
| 181 | +Air Pollution API provides current, forecast and historical air pollution data for any coordinates on the globe |
| 182 | + |
| 183 | +Besides 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). |
| 184 | + |
| 185 | +Air pollution forecast is available for 5 days with hourly granularity. Historical data is accessible from 27th November 2020. |
| 186 | + |
| 187 | +```php |
| 188 | + |
| 189 | +// By coordinates : latitude, longitude and date |
| 190 | +$info = $wt->getAirPollutionByCord(23.7104, 90.4074); |
| 191 | + |
| 192 | +``` |
| 193 | + |
| 194 | +### [Geocoding API](https://openweathermap.org/api/one-call-api#history) |
| 195 | +Geocoding API is a simple tool that we have developed to ease the search for locations while working with geographic names and coordinates. |
| 196 | +-> Direct geocoding converts the specified name of a location or area into the exact geographical coordinates; |
| 197 | +-> Reverse geocoding converts the geographical coordinates into the names of the nearby locations. |
| 198 | + |
| 199 | +```php |
| 200 | +// By city name |
| 201 | +$info = $wt->getGeoByCity('dhaka'); |
| 202 | + |
| 203 | +// By coordinates : latitude, longitude and date |
| 204 | +$info = $wt->getGeoByCity(23.7104, 90.4074); |
| 205 | + |
| 206 | +``` |
| 207 | + |
| 208 | +### [Free API Limitations](https://openweathermap.org/api/one-call-api#history) |
| 209 | +- 60 calls/minute |
| 210 | +- 1,000,000 calls/month |
| 211 | +- 1000 calls/day when using Onecall requests |
| 212 | + |
170 | 213 |
|
171 | 214 |
|
172 | 215 | ## License
|
|
0 commit comments