PHPackages                             baspa/zip-code-location-lookup - 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. baspa/zip-code-location-lookup

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

baspa/zip-code-location-lookup
==============================

y

v0.1.7(5mo ago)139MITPHPPHP ^8.1||^8.2CI passing

Since Jan 22Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/Baspa/zip-code-location-lookup)[ Packagist](https://packagist.org/packages/baspa/zip-code-location-lookup)[ Docs](https://github.com/baspa/zip-code-location-lookup)[ GitHub Sponsors](https://github.com/baspa)[ RSS](/packages/baspa-zip-code-location-lookup/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (12)Versions (10)Used By (0)

Zip Code Location Lookup
========================

[](#zip-code-location-lookup)

[![Latest Version on Packagist](https://camo.githubusercontent.com/2e946f0cfe7b07c052d06342004617f76b36cbaa6827203994e5f46c4b2f3aab/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f62617370612f7a69702d636f64652d6c6f636174696f6e2d6c6f6f6b75702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/baspa/zip-code-location-lookup)[![GitHub Tests Action Status](https://camo.githubusercontent.com/f817750aa24dfa6aeb1cbac1aed65f3ecf7f2ae13fc16379be32979d4ed616ae/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f62617370612f7a69702d636f64652d6c6f636174696f6e2d6c6f6f6b75702f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/baspa/zip-code-location-lookup/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/e8c9d9e16493fa8030972b031be13ad466afc437e4a23cea1964ef059ee04094/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f62617370612f7a69702d636f64652d6c6f636174696f6e2d6c6f6f6b75702f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/baspa/zip-code-location-lookup/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/0dbd2de0657f0e4c830916874df2431c2f9ce066e4cddb63bd5eb6bf33fab646/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f62617370612f7a69702d636f64652d6c6f636174696f6e2d6c6f6f6b75702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/baspa/zip-code-location-lookup)

This package allows you to lookup the geographic location of a zip code by combining the [Postcode.tech](https://postcode.tech/) API with the [Google Geocoding API](https://developers.google.com/maps/documentation/geocoding/overview).

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

[](#installation)

You can install the package via composer:

```
composer require baspa/zip-code-location-lookup
```

Then add the Google Maps API and Postcode.tech API keys to your `.env` file:

```
GOOGLE_MAPS_API_KEY=your_api_key
POSTCODE_TECH_API_KEY=your_api_key

```

Then add those keys to the `services.php` config file:

```
return [

    // ...

    'google' => [
        'api_key' => env('GOOGLE_MAPS_API_KEY'),
    ],

    'postcode_tech' => [
        'api_key' => env('POSTCODE_TECH_API_KEY'),
    ],
];
```

Usage
-----

[](#usage)

```
use Baspa\ZipCodeLocationLookup\ZipCodeLocationLookup;

// With Google Maps integration (default)
$lookup = new ZipCodeLocationLookup();

// Without Google Maps integration
$lookup = new ZipCodeLocationLookup(false);

// Lookup a zip code
$result = $lookup->lookup(zipCode: '1011AB', number: 1);

// Returns an array containing:
// - postcode: The normalized postcode
// - street: Street name
// - city: City name
// - municipality: Municipality name
// - province: Province name
// - lat: Latitude coordinate
// - lng: Longitude coordinate
$result = [
    'postcode' => '1011 AB',
    'street' => 'Dam',
    'city' => 'Amsterdam',
    'municipality' => 'Amsterdam',
    'province' => 'Noord-Holland',
    'lat' => 52.373169,
    'lng' => 4.893379
];
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Baspa](https://github.com/Baspa)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance83

Actively maintained with recent releases

Popularity10

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 67.4% 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 ~45 days

Recently: every ~51 days

Total

8

Last Release

157d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1b4c1c73be31056bf9c8f132938f77de518259ed02f5675e4339bc7dfab5b13c?d=identicon)[Baspa](/maintainers/Baspa)

---

Top Contributors

[![Baspa](https://avatars.githubusercontent.com/u/10845460?v=4)](https://github.com/Baspa "Baspa (31 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (10 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (5 commits)")

---

Tags

geolocationgooglegoogle-geocoding-apipostcode-lookup-servicelaravelBaspazip-code-location-lookup

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/baspa-zip-code-location-lookup/health.svg)

```
[![Health](https://phpackages.com/badges/baspa-zip-code-location-lookup/health.svg)](https://phpackages.com/packages/baspa-zip-code-location-lookup)
```

###  Alternatives

[spatie/laravel-data

Create unified resources and data transfer objects

1.7k28.9M626](/packages/spatie-laravel-data)[spatie/laravel-livewire-wizard

Build wizards using Livewire

4061.0M4](/packages/spatie-laravel-livewire-wizard)[hirethunk/verbs

An event sourcing package that feels nice.

513162.9k6](/packages/hirethunk-verbs)[worksome/exchange

Check Exchange Rates for any currency in Laravel.

123544.7k](/packages/worksome-exchange)[ralphjsmit/livewire-urls

Get the previous and current url in Livewire.

82270.3k4](/packages/ralphjsmit-livewire-urls)[hydrat/filament-table-layout-toggle

Filament plugin adding a toggle button to tables, allowing user to switch between Grid and Table layouts.

6292.3k1](/packages/hydrat-filament-table-layout-toggle)

PHPackages © 2026

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