{"id":25009104,"url":"https://github.com/baspa/zip-code-location-lookup","last_synced_at":"2025-04-12T18:44:58.597Z","repository":{"id":274606706,"uuid":"920096280","full_name":"Baspa/zip-code-location-lookup","owner":"Baspa","description":"Look up geolocation (Google) based on an address using Google and Postcode.tech","archived":false,"fork":false,"pushed_at":"2025-02-03T20:37:19.000Z","size":39,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-06T04:59:47.495Z","etag":null,"topics":["geolocation","google","google-geocoding-api","postcode-lookup-service"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Baspa.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"baspa"}},"created_at":"2025-01-21T15:01:19.000Z","updated_at":"2025-02-03T20:37:16.000Z","dependencies_parsed_at":"2025-01-28T10:42:17.001Z","dependency_job_id":null,"html_url":"https://github.com/Baspa/zip-code-location-lookup","commit_stats":null,"previous_names":["baspa/zip-code-location-lookup"],"tags_count":2,"template":false,"template_full_name":"vormkracht10/laravel-package-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Baspa%2Fzip-code-location-lookup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Baspa%2Fzip-code-location-lookup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Baspa%2Fzip-code-location-lookup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Baspa%2Fzip-code-location-lookup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Baspa","download_url":"https://codeload.github.com/Baspa/zip-code-location-lookup/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247713294,"owners_count":20983681,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["geolocation","google","google-geocoding-api","postcode-lookup-service"],"created_at":"2025-02-05T04:12:28.618Z","updated_at":"2025-04-12T18:44:58.575Z","avatar_url":"https://github.com/Baspa.png","language":"PHP","funding_links":["https://github.com/sponsors/baspa"],"categories":[],"sub_categories":[],"readme":"# Zip Code Location Lookup\n\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/baspa/zip-code-location-lookup.svg?style=flat-square)](https://packagist.org/packages/baspa/zip-code-location-lookup)\n[![GitHub Tests Action Status](https://img.shields.io/github/actions/workflow/status/baspa/zip-code-location-lookup/run-tests.yml?branch=main\u0026label=tests\u0026style=flat-square)](https://github.com/baspa/zip-code-location-lookup/actions?query=workflow%3Arun-tests+branch%3Amain)\n[![GitHub Code Style Action Status](https://img.shields.io/github/actions/workflow/status/baspa/zip-code-location-lookup/fix-php-code-style-issues.yml?branch=main\u0026label=code%20style\u0026style=flat-square)](https://github.com/baspa/zip-code-location-lookup/actions?query=workflow%3A\"Fix+PHP+code+style+issues\"+branch%3Amain)\n[![Total Downloads](https://img.shields.io/packagist/dt/baspa/zip-code-location-lookup.svg?style=flat-square)](https://packagist.org/packages/baspa/zip-code-location-lookup)\n\nThis 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).\n\n## Installation\n\nYou can install the package via composer:\n\n```bash\ncomposer require baspa/zip-code-location-lookup\n```\n\nThen add the Google Maps API and Postcode.tech API keys to your `.env` file:\n\n```\nGOOGLE_MAPS_API_KEY=your_api_key\nPOSTCODE_TECH_API_KEY=your_api_key\n```\n\nThen add those keys to the `services.php` config file:\n\n```php\nreturn [\n\n    // ...\n\n    'google' =\u003e [\n        'api_key' =\u003e env('GOOGLE_MAPS_API_KEY'),\n    ],\n\n    'postcode_tech' =\u003e [\n        'api_key' =\u003e env('POSTCODE_TECH_API_KEY'),\n    ],\n];\n```\n\n## Usage\n\n```php\nuse Baspa\\ZipCodeLocationLookup\\ZipCodeLocationLookup;\n\n// With Google Maps integration (default)\n$lookup = new ZipCodeLocationLookup();\n\n// Without Google Maps integration\n$lookup = new ZipCodeLocationLookup(false);\n\n// Lookup a zip code\n$result = $lookup-\u003elookup(zipCode: '1011AB', number: 1);\n\n// Returns an array containing:\n// - postcode: The normalized postcode\n// - street: Street name\n// - city: City name\n// - municipality: Municipality name\n// - province: Province name\n// - lat: Latitude coordinate\n// - lng: Longitude coordinate\n$result = [\n    'postcode' =\u003e '1011 AB',\n    'street' =\u003e 'Dam',\n    'city' =\u003e 'Amsterdam',\n    'municipality' =\u003e 'Amsterdam',\n    'province' =\u003e 'Noord-Holland',\n    'lat' =\u003e 52.373169,\n    'lng' =\u003e 4.893379\n];\n```\n\n## Testing\n\n```bash\ncomposer test\n```\n\n## Changelog\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.\n\n## Contributing\n\nPlease see [CONTRIBUTING](CONTRIBUTING.md) for details.\n\n## Security Vulnerabilities\n\nPlease review [our security policy](../../security/policy) on how to report security vulnerabilities.\n\n## Credits\n\n-   [Baspa](https://github.com/Baspa)\n-   [All Contributors](../../contributors)\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbaspa%2Fzip-code-location-lookup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbaspa%2Fzip-code-location-lookup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbaspa%2Fzip-code-location-lookup/lists"}