konradbaron / redline13
PHP package for the ZipCodeAPI by RedLine13
Installs: 67
Dependents: 0
Suggesters: 0
Security: 0
Stars: 13
Watchers: 3
Forks: 0
Open Issues: 0
Type:package
Requires
- guzzlehttp/guzzle: ~6.2
This package is not auto-updated.
Last update: 2025-06-22 09:36:48 UTC
README
PHP-ZipCode-API-RedLine13 is a PHP class for ZipCodeApi.com by RedLine13. You must first register an account to receive an API key. The API allows a free subscription, but limits the API usage to 250 requests per hour for that level.
The API currently returns your data in three formats; JSON, CSV and XML. This class has set JSON as the default return format.
Requirements
This library requires the use of Composer.
composer require konradbaron/redline13:dev-master
Example Usage
Instantiate the class
use KonradBaron\RedLine13\RedLine13; $zipCode = new RedLine13(YOUR_API_KEY);
Distance between two zip codes
echo $zipCode->getZipcodeDistance(ZIP_CODE, ZIP_CODE2);
Find all zip codes within a given radius of a zip code
echo $zipCode->getZipcodesByRadius(ZIP_CODE,RADIUS_DISTANCE);
Find city, state, latitude, longitude, and time zone information for a zip code
echo $zipCode->getLocationInfoByZipcode(ZIP_CODE);
Find out possible zip codes for a city
echo $zipCode->getZipcodesByLocation(CITY, STATE);
Find out possible zip codes for a state
echo $zipCode->getZipcodesByState(STATE);
Find distance between one zip code and multiple other zip codes
echo $zipCode->getMultipleZipcodesDistance(ZIP_CODE,OTHER_ZIP_CODES);