PHPackages                             webreinvent/laravel-usps - 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. webreinvent/laravel-usps

ActiveLibrary[API Development](/categories/api)

webreinvent/laravel-usps
========================

USPS API wrapper for Laravel framework

v1.1.2(3y ago)14.3k↓78.9%1MITPHP

Since Jun 9Pushed 3y ago1 watchersCompare

[ Source](https://github.com/webreinvent/laravel-usps)[ Packagist](https://packagist.org/packages/webreinvent/laravel-usps)[ RSS](/packages/webreinvent-laravel-usps/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (5)Dependencies (3)Versions (7)Used By (0)

Laravel-Usps
============

[](#laravel-usps)

This package provides a very simple wrapper for the United States Postal Service API. Currently, this package only provides address validation features, but will soon comprise all features offered by the USPS API.

### Prerequisites

[](#prerequisites)

Be sure to register at [www.usps.com/webtools/](www.usps.com/webtools/) to receive your unique user ID from the United States Postal Service. This user ID is required to use this package.

### Installation

[](#installation)

```
composer require webreinvent/laravel-usps

```

Configuration
-------------

[](#configuration)

There are three important configurations.

1. Your USPS user ID:

    - If you have not received your USPS user ID, follow the link in the [prerequisites](#Prerequisites) section to register with the United States Postal Service. It is required to use this package.
2. Whether you want SSL verification enabled for API requests:

    - This setting is set to `true` by default for security reasons. You can override this behavior by setting the `verrifyssl` config setting to `false`. Do this at your own risk.
3. Which environment you are working in:

    - The options are `'local' and 'production'` which tell the package which API url to use, testing or production respectively. If no configuration is found for `env`, it will default to the environment recognized by laravel. This setting takes precedence over `APP_ENV` from your `.env` file.

We recommend placing all configuration settings in your `.env` file and use Laravel's `env()` helper function to access these values.

In `config/services.php` add these three settings.

```
'usps' => [

    'userid' => env('USPS_USER_ID'), // string
    'verifyssl' => env('USPS_VERIFY_SSL'), // bool
    'env' => env('USPS_ENV') //string
];
```

Usage
-----

[](#usage)

The current features offered by this package are:

- [Address Validation](#Address-Validation)

Address Validation
------------------

[](#address-validation)

The `Address` class handles creating and formatting address data. Pass the constructor an associative array of address details. Array keys are case-sensitive. Below is an example of creating an address and making an api request for validation.

```
use WebReinvent\Usps\Address;

$address = new Address([
    'Address2' => '6406 Ivy Lane',
    'City' => 'Greenbelt',
    'State' => 'MD',
    'Zip5' => 20770
]);

$response = $address->validate();
```

The USPS api supports up to 5 address validations per request. If you need to validate more than one address at a time, pass an array of addresses to the `Address` constructor.

```
use WebReinvent\Usps\Address;

$address1 = [
    'Address2' => '6406 Ivy Lane',
    'City' => 'Greenbelt',
    'State' => 'MD',
    'Zip5' => 20770
];

$address2 = [
    'Address2' => '2185 Sandy Drive',
    'City' => 'Franklin',
    'State' => 'VA',
    'Zip5' => 32050
];

$addresses = new Address([$address1, $address2]);

$response = $addresses->validate();
```

The response will contain the [corrected address](https://www.usps.com/business/web-tools-apis/address-information-api.pdf), or an error if not enough information was given or the address does not exists.

Response Formatting
-------------------

[](#response-formatting)

You can specify the format of the response by passing an optional, case-insensitive parameter to the validate method. The default format is an associative array.

```
$address = new Address([/* address info */ ]);

$json = $address->validate('json');
$object = $address->validate('object');
$string = $address->validate('string');
```

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 78.8% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~372 days

Total

4

Last Release

1101d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/45572020?v=4)[WebReinvent Technologies Pvt Ltd](/maintainers/webreinvent)[@webreinvent](https://github.com/webreinvent)

---

Top Contributors

[![ctwillie](https://avatars.githubusercontent.com/u/32856661?v=4)](https://github.com/ctwillie "ctwillie (41 commits)")[![themodernpk](https://avatars.githubusercontent.com/u/3604392?v=4)](https://github.com/themodernpk "themodernpk (10 commits)")[![aknud](https://avatars.githubusercontent.com/u/38897196?v=4)](https://github.com/aknud "aknud (1 commits)")

---

Tags

laravellaravel-7laravel-7-packagelaravel-frameworkusps-packageslaravellaravel 7uspslaravel uspsusps apilaravel 7 usps

### Embed Badge

![Health badge](/badges/webreinvent-laravel-usps/health.svg)

```
[![Health](https://phpackages.com/badges/webreinvent-laravel-usps/health.svg)](https://phpackages.com/packages/webreinvent-laravel-usps)
```

###  Alternatives

[craftcms/cms

Craft CMS

3.6k3.6M3.1k](/packages/craftcms-cms)[simplestats-io/laravel-client

Server-side analytics for Laravel that follows the full funnel from visit to registration to payment, attributed to the channel that drove it. Revenue, MRR, churn and ad-spend profit (ROAS/CAC) per channel. GDPR compliant, ad-blocker proof.

5022.0k](/packages/simplestats-io-laravel-client)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

273.0k](/packages/eslazarev-wildberries-sdk)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
