PHPackages                             muzzaopencopy/postcodes-io-laravel - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. muzzaopencopy/postcodes-io-laravel

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

muzzaopencopy/postcodes-io-laravel
==================================

2.1(11y ago)039MITPHPPHP &gt;=5.4.0

Since Nov 20Pushed 10y ago2 watchersCompare

[ Source](https://github.com/MuzzaOpenCopy/postcodes-io-laravel)[ Packagist](https://packagist.org/packages/muzzaopencopy/postcodes-io-laravel)[ RSS](/packages/muzzaopencopy-postcodes-io-laravel/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (6)Used By (0)

PostcodesIo Laravel Package
===========================

[](#postcodesio-laravel-package)

This is a fork of chadanuk/postcodes-io-laravel.

A laravel package for querying the [postcodes.io](http://postcodes.io) web service.

Most of the Guzzle layer code was taken from @BoxUk's [Symfony bundle](https://github.com/BoxUk/postcodes-io-bundle), many props!

[License](LICENSE)

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

[](#installation)

Installation is handled via [Composer](http://getcomposer.org).

1. Run the following command:

    ```
    $ composer require muzzaopencopy/postcodes-io dev-master
    ```

    This should add the following to your project's `composer.json` file:

    ```
    "require": {
        "muzzaopencopy/postcodes-io-laravel": "dev-master"
    }
    ```
2. Add the Service Provider to your `app/config/app.php` file:

    ```
    'providers' => array('MuzzaOpenCopy\PostcodesIo\PostcodesIoServiceProvider')
    ```
3. Add the Facade in the same file:

    ```
    'aliases' => array('PostcodesIo' => 'MuzzaOpenCopy\PostcodesIo\Facade')
    ```

Usage
-----

[](#usage)

Use the `PostcodesIo` facade with any of the methods below to get data from the service. For example: `PostcodesIo::lookup('CF10 1DD')`.

Methods
-------

[](#methods)

lookup()
--------

[](#lookup)

[API documentation](http://postcodes.io/docs#Postcode-Lookup)

Lookup data about a particular postcode.

**Parameters:**

- `postcode` *(Required)*: The postcode.

**Example:**

```
$response = $client->lookup(array('postcode' => 'CF10 1DD'));
```

bulkLookup()
------------

[](#bulklookup)

[API documentation](http://postcodes.io/docs#Bulk-Postcode-Lookup)

Lookup data about a set of postcodes.

**Parameters:**

- `postcodes` *(Required)*: An array of postcodes (max 100).

**Example:**

```
$response = $client->bulkLookup(array('postcodes' => array('CF10 1DD', 'W1B 4BD'));
```

reverseGeocode()
----------------

[](#reversegeocode)

[API documentation](http://postcodes.io/docs#Geocode-Postcode)

Get data for postcodes nearest a given latitude/longitude coordinate.

**Parameters:**

- `latitude` *(Required)*: The latitude.
- `longitude` *(Required)*: The longitude.
- `limit` *(Optional)*: The maximum number of postcodes to return (default 10, max 100).
- `radius` *(Optional)*: The radius in metres in which to find postcodes (default 100, max 1000).

**Example:**

```
$response = $client->reverseGeocode(array('latitude' => 51.481667, 'longitude' => -3.182155);
```

bulkReverseGeocode()
--------------------

[](#bulkreversegeocode)

[API documentation](http://postcodes.io/docs#Geocode-Postcode)

Bulk translation of latitude/longitude coordinates into postcode data.

**Parameters:**

- `geolocations` *(Required)*: The geolocations to look up (maximum 100). This parameter should be an array, each element with the following keys:

    - `latitude` *(Required)*: The latitude.
    - `longitude` *(Required)*: The longitude.
    - `limit` *(Optional)*: The maximum number of postcodes to return (default 10, max 100).
    - `radius` *(Optional)*: The radius in metres in which to find postcodes (default 100, max 1000).

**Example:**

```
$response = $client->bulkReverseGeocode(
    array(
        'geolocations' => array(
            array('latitude' => 51.481667, 'longitude' => -3.182155),
            array('latitude' => 51.88328, 'longitude' => -3.43684, 'limit' => 5, 'radius' => 500)
        )
    )
);
```

matching()
----------

[](#matching)

[API documentation](http://postcodes.io/docs#Postcode-Query)

Find postcodes matching a given query.

**Parameters:**

- `query` *(Optional)*: The postcode query, e.g. 'CF10'.
- `limit` *(Optional)*: The maximum number of postcodes to return (default 10, max 100).

**Example:**

```
$response = $client->matching(array('query' => 'CF10', 'limit' => 20);
```

validate()
----------

[](#validate)

[API documentation](http://postcodes.io/docs#Postcode-Validation)

Validate a postcode.

**Parameters:**

- `postcode` *(Required)*: The postcode to validate.

**Example:**

```
$response = $client->validate(array('postcode' => 'CF10 1DD');
```

autocomplete()
--------------

[](#autocomplete)

[API documentation](http://postcodes.io/docs#Postcode-Autocomplete)

Get a list of postcodes to autocomplete a partial postcode.

**Parameters:**

- `postcode` *(Required)*: The postcode to autocomplete.
- `limit` *(Optional)*: The maximum number of postcodes to return (default 10, max 100).

**Example:**

```
$response = $client->autocomplete(array('postcode' => 'CF10', 'limit' => 20);
```

random()
--------

[](#random)

[API documentation](http://postcodes.io/docs#Random-Postcode)

Get data for a random postcode.

**Parameters:**None.

**Example:**

```
$response = $client->random();
```

outwardCodeLookup()
-------------------

[](#outwardcodelookup)

[API documentation](http://postcodes.io/docs#Show-Outcode)

Get data for the specified "outward code" (first half of postcode).

**Parameters:**

- `outcode` *(Required)*: The outward code (first half of postcode) to get location data for.

**Example:**

```
$response = $client->outwardCodeLookup(array('outcode' => 'CF10');
```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 62.5% 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 ~39 days

Total

5

Last Release

4031d ago

Major Versions

1.0.2 → 2.02015-04-21

### Community

Maintainers

![](https://www.gravatar.com/avatar/8701b234617497cc37d1804a116fbb10d8dc4c5d549926c67b27dcd83a617ce4?d=identicon)[murrayopencopy](/maintainers/murrayopencopy)

---

Top Contributors

[![adityamenon](https://avatars.githubusercontent.com/u/640815?v=4)](https://github.com/adityamenon "adityamenon (15 commits)")[![chadanuk](https://avatars.githubusercontent.com/u/234815?v=4)](https://github.com/chadanuk "chadanuk (7 commits)")[![MuzzaOpenCopy](https://avatars.githubusercontent.com/u/12904383?v=4)](https://github.com/MuzzaOpenCopy "MuzzaOpenCopy (2 commits)")

### Embed Badge

![Health badge](/badges/muzzaopencopy-postcodes-io-laravel/health.svg)

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

###  Alternatives

[amstaffix/pagination

Simple pagination

46290.4k6](/packages/amstaffix-pagination)[faonni/module-smart-category

SmartCategory module is a base of Smart Categories functionality.

8289.3k3](/packages/faonni-module-smart-category)[sitegeist/silhouettes

Preconfigure property-silhuettes that can be applied to various properties of multiple NodeTypes.

16157.5k](/packages/sitegeist-silhouettes)[michaeljennings/refinery

A php class to refine data into a set format.

129.5k2](/packages/michaeljennings-refinery)

PHPackages © 2026

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