PHPackages                             vladshut/postcode-api-client - 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. vladshut/postcode-api-client

ActiveLibrary[API Development](/categories/api)

vladshut/postcode-api-client
============================

Client library for the postcodeapi.nu web service.

1.0(7y ago)02131MITPHP &gt;=5.4.0

Since May 11Compare

[ Source](https://github.com/vladshut/postcode-api-client)[ Packagist](https://packagist.org/packages/vladshut/postcode-api-client)[ Docs](http://www.postcodeapi.nu)[ RSS](/packages/vladshut-postcode-api-client/feed)WikiDiscussions Synced 4d ago

READMEChangelog (1)Dependencies (4)Versions (2)Used By (1)

PostcodeAPIClient
=================

[](#postcodeapiclient)

PostcodeAPIClient is a PHP client library for the PostcodeAPI.nu web service.

- [More information](https://www.postcodeapi.nu)
- [API documentation](https://swaggerhub.com/api/apiwise/postcode-api)

Requirements
------------

[](#requirements)

PostcodeAPIClient works with PHP 5.5.0 or up. This library depends on the [HTTPPlug](http://httplug.io/), see .

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

[](#installation)

PostcodeAPIClient can easily be installed using [Composer](https://getcomposer.org/):

```
composer require vladshut/postcode-api-client
```

Usage
-----

[](#usage)

Instantiate the client and replace the API key with your personal credentials:

```
// Use the composer autoloader to load dependencies
require_once 'vendor/autoload.php';

// initiate client
$apiKey = 'replace_with_your_own_api_key';
// In this example we made use of the Guzzle6 as HTTPClient in combination with an HTTPPlug compatible adapter.
$client = new \VS\PostcodeAPI\Client(
    new Http\Adapter\Guzzle6\Client(
        new GuzzleHttp\Client([
            'headers' => [
                'X-Api-Key' => $apiKey
            ]
        ])
    )
);

// call endpoints
$response = $client->getAddresses('5041EB', 21);
$response = $client->getAddress('0855200000061001');
$response = $client->getPostcode('5041EB');

// Note that this call is only available with a premium account
$response = $client->getPostcodes('51.566405', '5.077171');
```

Note that to be able to run the example above you should have ran the following command, to have Guzzle6 and the Adapter available.

```
composer require php-http/guzzle6-adapter
```

Within Symfony project
----------------------

[](#within-symfony-project)

We recommend to use [Guzzle](https://github.com/guzzle/guzzle), to be able to use Guzzle in combination with the PostcodeApiClient you should also make use of the [Guzzle6Adapter](https://github.com/php-http/guzzle6-adapter). By running the following command you automatically install Guzzle aswel.

```
composer require php-http/guzzle6-adapter
```

And add the following service definitions:

```
project.http.guzzle.client:
    class: GuzzleHttp\Client
    arguments:
        - { headers: { X-Api-Key: 'replace_with_your_own_api_key' } }

project.http.adapter.guzzle.client:
    class: Http\Adapter\Guzzle6\Client
    arguments:
        - '@project.http.guzzle.client'

project.client.postal_code:
    class: VS\PostcodeAPI\Client
    arguments:
        - '@project.http.adapter.guzzle.client'
```

You should now be able use the `project.client.postal_code` service to make requests to the PostcodeAPI.

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community5

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

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

Unknown

Total

1

Last Release

2609d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/10393656?v=4)[Vladyslav Shut](/maintainers/vladshut)[@vladshut](https://github.com/vladshut)

---

Tags

apiclientpostcode

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/vladshut-postcode-api-client/health.svg)

```
[![Health](https://phpackages.com/badges/vladshut-postcode-api-client/health.svg)](https://phpackages.com/packages/vladshut-postcode-api-client)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.5k5.9M728](/packages/sylius-sylius)[algolia/algoliasearch-client-php

API powering the features of Algolia.

69735.1M153](/packages/algolia-algoliasearch-client-php)[theodo-group/llphant

LLPhant is a library to help you build Generative AI applications.

1.7k409.0k6](/packages/theodo-group-llphant)[apigee/apigee-client-php

Client library for connecting to the Apigee Edge API.

27584.5k4](/packages/apigee-apigee-client-php)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

252.5k](/packages/eslazarev-wildberries-sdk)[bushlanov-dev/max-bot-api-client-php

Max Bot API Client library

486.3k](/packages/bushlanov-dev-max-bot-api-client-php)

PHPackages © 2026

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