PHPackages                             benjaminhansen/nws-php - 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. [API Development](/categories/api)
4. /
5. benjaminhansen/nws-php

ActiveLibrary[API Development](/categories/api)

benjaminhansen/nws-php
======================

A wrapper for the National Weather Service REST API (https://api.weather.gov).

v1.2.3(8mo ago)144MITPHPPHP ^8.2

Since Apr 15Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/benjaminhansen/nws-php)[ Packagist](https://packagist.org/packages/benjaminhansen/nws-php)[ Docs](https://github.com/benjaminhansen/nws-php)[ RSS](/packages/benjaminhansen-nws-php/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (6)Versions (19)Used By (0)

PHP Library for the National Weather Service REST API
=====================================================

[](#php-library-for-the-national-weather-service-rest-api)

Provides an intuitive interface to use the NWS REST API () in any PHP application.

Pairs well with my ArcGIS Geocode API wrapper as well.

NWS Documentation
-----------------

[](#nws-documentation)

Installation
------------

[](#installation)

```
composer require benjaminhansen/nws-php

```

Usage
-----

[](#usage)

Notes

- Requires PHP 8.2 or greater
- All requests can be cached locally to reduce outbound requests to the API endpoint
- All datetime fields are automatically returned as a `Carbon` object
- Any timezone fields are automatically returned as a PHP `DateTimeZone` object
- A `raw()` method is available on most calls to print out the raw API data

### Example

[](#example)

```
