PHPackages                             codescheme/postcodes - 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. codescheme/postcodes

AbandonedLibrary[API Development](/categories/api)

codescheme/postcodes
====================

UK Postcode API Facade for Laravel

v1.4(8y ago)1215.3k↓100%8[4 PRs](https://github.com/codescheme/postcodes/pulls)MITPHPPHP ^5.5 || ^7.0

Since Feb 9Pushed 2y ago2 watchersCompare

[ Source](https://github.com/codescheme/postcodes)[ Packagist](https://packagist.org/packages/codescheme/postcodes)[ RSS](/packages/codescheme-postcodes/feed)WikiDiscussions master Synced today

READMEChangelog (3)Dependencies (4)Versions (4)Used By (0)

Postcodes
=========

[](#postcodes)

A Laravel 5+ facade/service provider for the API methods at `postcodes.io` - useful for UK postcode validation and reverse geocoding: that is, determining postcode from lat, long coordinates. **No fiddling around with api keys, authentication, necessary...**

With thanks to

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

[](#installation)

```
composer require codescheme/postcodes

```

For Laravel 5.5 *Postcodes* will be automatically discovered.

Edit `/config/app.php` and add the service provider to your `providers` array.

```
'providers' => [
	Codescheme\Postcodes\PostcodeServiceProvider::class,
]
```

Also here, add the alias:

```
'aliases' => [
	'Postcode' => Codescheme\Postcodes\Facades\Postcode::class,
]
```

Basic Example Laravel Usage
---------------------------

[](#basic-example-laravel-usage)

Return data for a given postcode

```
Route::get('/postcode', function(){
    $data = Postcode::postcodeLookup('SE21 8JL');
    print_r($data);
    return null;
});
```

Methods
-------

[](#methods)

```
Postcode::validate('SE31 9AX'); //returns boolean
Postcode::postcodeLookup('SE21 8JL');
Postcode::nearest('SE21 8JL');
Postcode::reverseGeocode(-0.397913, 51.44015); // long,lat
Postcode::autocomplete('RG1 3');
Postcode::outcodeLookup('SE21');

$postcodes = ['OX49 5NU', 'M32 0JG', 'NE30 1DP'];
Postcode::postcodeLookupBulk($postcodes);

$coordinates = [
    ['longitude' =>  0.629834723775309, 'latitude' => 51.7923246977375],
    ['longitude' => -2.49690382054704, 	'latitude' => 53.5351312861402]
    ];
Postcode::reverseGeocodeBulk($coordinates);

```

Testing
-------

[](#testing)

```
$ composer test
```

###  Health Score

35

↑

LowBetter than 81% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity32

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 92.9% 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 ~129 days

Total

3

Last Release

3070d ago

PHP version history (2 changes)v1.2PHP &gt;=5.5.0

v1.3PHP ^5.5 || ^7.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/d3a273bb230ecadae9101655554fb55f3b0f4babe5d40d050a0f7541dbc195e0?d=identicon)[codescheme](/maintainers/codescheme)

---

Top Contributors

[![codescheme](https://avatars.githubusercontent.com/u/2902565?v=4)](https://github.com/codescheme "codescheme (13 commits)")[![jmsfwk](https://avatars.githubusercontent.com/u/9892048?v=4)](https://github.com/jmsfwk "jmsfwk (1 commits)")

---

Tags

laravellaravel-5-packagephppostcodepostcodesjsonapilaravellaravel5postcodepostcodes

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/codescheme-postcodes/health.svg)

```
[![Health](https://phpackages.com/badges/codescheme-postcodes/health.svg)](https://phpackages.com/packages/codescheme-postcodes)
```

###  Alternatives

[nilportugues/laravel5-json-api

Laravel 5 JSON API Transformer Package

31032.4k1](/packages/nilportugues-laravel5-json-api)[obiefy/api-response

Simple Laravel package to return Json responses.

17324.4k](/packages/obiefy-api-response)[nilportugues/laravel5-json-api-dingo

Laravel5 JSONAPI and Dingo together to build APIs fast

311.5k](/packages/nilportugues-laravel5-json-api-dingo)[dragon-code/laravel-json-response

Automatically always return a response in JSON format

1118.1k1](/packages/dragon-code-laravel-json-response)[nilportugues/laravel5-haljson

Laravel 5 HAL+JSON API Transformer Package

151.0k](/packages/nilportugues-laravel5-haljson)

PHPackages © 2026

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