PHP USPS API Address Validation: Get the details of a given address using USPS API

Recommend this page to a friend!
  Info   Example   View files (4)   Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 72 This week: 1All time: 9,639 This week: 261
Version License PHP version Categories
usps-address-valid 1.1GNU General Publi...5HTTP, PHP 5, Web services
Description Author
This package is specific mainly for applications used in United States United States .

This class can get the details of a given address using USPS API.

It can send a HTTP request to the USPS API Web server to get the details of a given United States address.

The class returns an array with the street address, city, state, and the 5 digit postal code.

Picture of Jason Olson
  Performance   Level  
Name: Jason Olson is available for providing paid consulting. Contact Jason Olson .
Classes: 4 packages by
Country: United States United States
Age: ???
All time rank: 3530431 in United States United States
Week rank: 261 24 in United States United States
Innovation award
Innovation award
Nominee: 1x



This CLASS is designed to take advantage of the USPS API for looking up the corrected (normalized) address for a given physical address. There is very little examples of implementing the USPS API in PHP.


When you instantiate the class, include the API key. See the example.php file for usage. If you don't have a valid API, you can get one free at

Revision History:

  • 1.0 Initial Release
  • 1.1 Bugfix 500 error.

This code was written by request by another developer on because Streetlayers is going away very soon.


GNU General Public License v3.0 (GNU GPLv3)

File Role Description
example.php Example Example script
LICENSE Lic. License text Doc. Documentation
USPS.php Class Class source

 Version Control Unique User Downloads Download Rankings  
This week:1
All time:9,639
This week:261

For more information send a message to info at phpclasses dot org.