{"id":16749621,"url":"https://github.com/alexpechkarev/google-geocoder","last_synced_at":"2025-04-13T08:26:24.744Z","repository":{"id":18571017,"uuid":"21773755","full_name":"alexpechkarev/google-geocoder","owner":"alexpechkarev","description":"Google Geocoder API v3 for Laravel","archived":false,"fork":false,"pushed_at":"2017-09-27T12:56:26.000Z","size":131,"stargazers_count":74,"open_issues_count":0,"forks_count":13,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-05T04:14:21.171Z","etag":null,"topics":["geocoding-responses","google-geocoder","laravel","php"],"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/alexpechkarev.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":"2014-07-12T18:32:57.000Z","updated_at":"2024-06-13T11:24:07.000Z","dependencies_parsed_at":"2022-08-05T00:15:31.744Z","dependency_job_id":null,"html_url":"https://github.com/alexpechkarev/google-geocoder","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexpechkarev%2Fgoogle-geocoder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexpechkarev%2Fgoogle-geocoder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexpechkarev%2Fgoogle-geocoder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexpechkarev%2Fgoogle-geocoder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alexpechkarev","download_url":"https://codeload.github.com/alexpechkarev/google-geocoder/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248682807,"owners_count":21144826,"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":["geocoding-responses","google-geocoder","laravel","php"],"created_at":"2024-10-13T02:25:25.140Z","updated_at":"2025-04-13T08:26:24.723Z","avatar_url":"https://github.com/alexpechkarev.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"Google Geocoder API\n======================\n[![Build Status](https://travis-ci.org/alexpechkarev/google-geocoder.svg?branch=master)](https://travis-ci.org/alexpechkarev/google-geocoder)\n\nThis package provides simple facility to make [**The Google Geocoding API v3**](https://developers.google.com/maps/documentation/geocoding/) calls with [**Laravel 5**](http://laravel.com/).\n\nSee [*Collection of Google Maps API Web Services for Laravel*](https://github.com/alexpechkarev/google-maps) that also includes Google Geocoding API v3.\n\n**Laravel 5**\n======================\n\nDependency\n------------\n[**PHP cURL**](http://php.net/manual/en/curl.installation.php) required\n\n\nInstallation\n------------\n\nTo install edit `composer.json` and add following line:\n\n```javascript\n\"alexpechkarev/google-geocoder\": \"dev-master\"\n```\n\nRun `composer update`\n\n\nConfiguration\n-------------\n\nOnce installed, register Laravel service provider, in your `config/app.php`:\n\n```php\n'providers' =\u003e array(\n\t...\n    'Alexpechkarev\\GoogleGeocoder\\GoogleGeocoderServiceProvider',\n)\n```\n\nNext, create a `config/google-geocoder.php`, containing:\n\n```php\n\u003c?php\n\nreturn [\n\n    /*\n    |--------------------------------------------------------------------------\n    | Google Geocoder\n    |--------------------------------------------------------------------------\n    | Geocoding is the process of converting addresses (like \"1600 Amphitheatre Parkway, Mountain View, CA\")\n    | into geographic coordinates (like latitude 37.423021 and longitude -122.083739),\n    | which you can use to place markers or position the map.\n    |\n    */\n\n    /*\n    |--------------------------------------------------------------------------\n    | Application Key\n    |--------------------------------------------------------------------------\n    |\n    | Your application's API key. This key identifies your application for\n    | purposes of quota management. Learn how to get a key from the APIs Console.\n    */\n    'applicationKey' =\u003e 'my-api-key',\n\n    /*\n    |--------------------------------------------------------------------------\n    | Request URL\n    |--------------------------------------------------------------------------\n    |\n    */\n    'requestUrl' =\u003e [\n        'json' =\u003e 'https://maps.googleapis.com/maps/api/geocode/json?',\n        'xml'  =\u003e 'https://maps.googleapis.com/maps/api/geocode/xml?'\n    ],\n];\n```\n\n**Slim 3**\n======================\nSettings\n-------------\n```php\nreturn [\n    'settings' =\u003e [\n      /* slim settings */\n      'displayErrorDetails' =\u003e true,\n\n      'determineRouteBeforeAppMiddleware' =\u003e true,\n\n        'google' =\u003e [\n          'geocoder' =\u003e [\n            'applicationKey' =\u003e 'my-api-key',\n            'requestUrl' =\u003e [\n                'json' =\u003e 'https://maps.googleapis.com/maps/api/geocode/json?',\n                'xml'  =\u003e 'https://maps.googleapis.com/maps/api/geocode/xml?'\n            ]\n          ]\n        ]\n    ]\n];\n```\n\nContainer Dependency\n-------------\n```php\nuse GoogleGeocoder\\GoogleGeocoder;\n\n$container['GeoCoder'] = function ($container) {\n\n  return new GoogleGeocoder($container-\u003eget('settings')['google']['geocoder']);\n\n};\n\n```\n\n\nUsing\n------\n```php\n$gc = $this-\u003econtainer['GeoCoder'];\n```\n\n\nUsage\n======================\n\nBefore making calls please ensure you obtain API Key to identify your application and add this key in the configuration file.\nMore information on API Key please refer to [**The Google Geocoding API**](https://developers.google.com/maps/documentation/geocoding/#api_key).\n\n```php\n'applicationKey' =\u003e 'your-api-key',\n```\n\nCreate an array with key=\u003evalue pairs specifying address you would like to geocode:\n\n```php\n$param = array(\"address\"=\u003e\"76 Buckingham Palace Road London SW1W 9TQ\");\n```\n\nUse following command to receive Geocoding response in json format, use xml as first parameter for XML response.\n\n```php\n$response = \\Geocoder::geocode('json', $param);\n```\n\nTo restrict your results to a specific area use component filter [**Component Filtering**](https://developers.google.com/maps/documentation/geocoding/#ComponentFiltering)\nby adding it's filters to parameter array.\n\n```php\n$param = array(\n                \"address\"=\u003e\"76 Buckingham Palace Road London SW1W 9TQ\",\n                \"components\"=\u003e\"country:GB\"\n            );\n```\n\nGeocoding API supports translation of map coordinates into human-readable address\nby reverse geocoding using latitude and longitude parameters. For more details\nrefer to [**Reverse Geocoding**](https://developers.google.com/maps/documentation/geocoding/#ReverseGeocoding)\nTo make reverse geocoding request use following:\n\n```php\n$param = array(\"latlng\"=\u003e\"40.714224,-73.961452\");\n$response = \\Geocoder::geocode('json', $param);\n```\n\nAll requests will return `string` value. For Response example, Status Codes,\nError Messages and Results please refer to [**Geocoding Responses**]\n(https://developers.google.com/maps/documentation/geocoding/#GeocodingResponses)\n\n\n\nSupport\n-------\n\n[Please open an issue on GitHub](https://github.com/alexpechkarev/google-geocoder/issues)\n\n\nLicense\n-------\n\nGoogle Geocoder for Laravel 5 is released under the MIT License. See the bundled\n[LICENSE](https://github.com/alexpechkarev/google-geocoder/blob/master/LICENSE)\nfile for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexpechkarev%2Fgoogle-geocoder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexpechkarev%2Fgoogle-geocoder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexpechkarev%2Fgoogle-geocoder/lists"}