{"id":37008077,"url":"https://github.com/zero-archive/gmaps-geocode-php","last_synced_at":"2026-01-14T00:49:38.306Z","repository":{"id":1224650,"uuid":"1152549","full_name":"zero-archive/gmaps-geocode-php","owner":"zero-archive","description":"A PHP5 library implements Geocoding and Reverse geocoding through The Google Maps Geocoding API","archived":true,"fork":false,"pushed_at":"2019-11-09T02:31:48.000Z","size":20,"stargazers_count":3,"open_issues_count":1,"forks_count":6,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-04T09:22:03.837Z","etag":null,"topics":["geocoding","google","php"],"latest_commit_sha":null,"homepage":"https://github.com/dotzero/gmaps-geocode-php","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/zero-archive.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2010-12-09T09:00:27.000Z","updated_at":"2023-01-28T00:14:33.000Z","dependencies_parsed_at":"2022-07-19T08:29:46.754Z","dependency_job_id":null,"html_url":"https://github.com/zero-archive/gmaps-geocode-php","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/zero-archive/gmaps-geocode-php","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zero-archive%2Fgmaps-geocode-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zero-archive%2Fgmaps-geocode-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zero-archive%2Fgmaps-geocode-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zero-archive%2Fgmaps-geocode-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zero-archive","download_url":"https://codeload.github.com/zero-archive/gmaps-geocode-php/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zero-archive%2Fgmaps-geocode-php/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28407016,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T00:40:43.272Z","status":"ssl_error","status_checked_at":"2026-01-14T00:40:42.636Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["geocoding","google","php"],"created_at":"2026-01-14T00:49:37.566Z","updated_at":"2026-01-14T00:49:38.290Z","avatar_url":"https://github.com/zero-archive.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PHP Google Maps Geocode\n\n[![Build Status](https://travis-ci.org/dotzero/gmaps-geocode-php.svg?branch=master)](https://travis-ci.org/dotzero/gmaps-geocode-php)\n[![Latest Stable Version](https://poser.pugx.org/dotzero/gmaps-geocode/version)](https://packagist.org/packages/dotzero/gmaps-geocode)\n[![License](https://poser.pugx.org/dotzero/gmaps-geocode/license)](https://packagist.org/packages/dotzero/gmaps-geocode)\n\nA PHP5 library implements Geocoding and Reverse geocoding through The Google Maps Geocoding API.\n\nGeocoding is the process of converting addresses (like \"1600 Amphitheatre Parkway, Mountain View, CA\") into geographic coordinates (like latitude 37.423021 and longitude -122.083739). Reverse geocoding is the process of converting geographic coordinates into a human-readable address.\n\n## Usage\n\nTo use the Google Maps Geocoding API, you need an API key. To acquire an API key follow [the instructions](https://developers.google.com/maps/documentation/geocoding/get-api-key).\n\n### Geocoding (Latitude/Longitude Lookup)\n\n```php\ntry {\n    $result = (new GMapsGeocode('YOUR_GOOGLE_API'))\n        -\u003esetAddress('Helsinki')\n//        -\u003esetRegion('FI')\n        -\u003esetComponents(array(\n            'route' =\u003e 'Annegatan',\n            'administrative_area' =\u003e 'Helsinki',\n            'country' =\u003e 'Finland'\n        ))\n        -\u003esearch();\n\n    print_r($result);\n} catch (GMapsException $e) {\n    printf('Error (%d): %s', $e-\u003egetCode(), $e-\u003egetMessage());\n}\n```\n\nRequired method are `setAddress` or `setComponents` in a geocoding request and `setRegion` is optional.\n\n[Official documentation](https://developers.google.com/maps/documentation/geocoding/intro?hl=en#ComponentFiltering) contains more about Component Filtering.\n\n### Reverse Geocoding (Address Lookup)\n\n```php\ntry {\n    $geo = (new GMapsGeocodeReverse('YOUR_GOOGLE_API'))\n        -\u003esetLatLng('40.714224', '-73.961452')\n//        -\u003esetPlaceId('ChIJd8BlQ2BZwokRAFUEcm_qrcA')\n        -\u003esearch();\n\n    print_r($result);\n} catch (GMapsException $e) {\n    printf('Error (%d): %s', $e-\u003egetCode(), $e-\u003egetMessage());\n}\n```\n\nRequired method are `setLatLng` or `setPlaceId` in a reverse geocoding request.\n\n## Install\n\n### Via composer:\n\n```bash\n$ composer require dotzero/gmaps-geocode\n```\n\n### Without composer\n\nClone the project using:\n\n```bash\n$ git clone https://github.com/dotzero/gmaps-geocode-php/\n```\n\nand include the source files with:\n\n```php\n    require_once(\"gmaps-geocode-php/src/GMapsException.php\");\n    require_once(\"gmaps-geocode-php/src/GMapsGeocodeBase.php\");\n    require_once(\"gmaps-geocode-php/src/GMapsGeocode.php\");\n    require_once(\"gmaps-geocode-php/src/GMapsGeocodeReverse.php\");\n```\n\n## Test\n\nFirst install the dependencies, and after you can run:\n\n```bash\nGOOGLE_API=YOUR_GOOGLE_API vendor/bin/phpunit\n```\n\n## License\n\nLicensed under the MIT license: http://www.opensource.org/licenses/mit-license.php\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzero-archive%2Fgmaps-geocode-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzero-archive%2Fgmaps-geocode-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzero-archive%2Fgmaps-geocode-php/lists"}