PHPackages                             geocoder-php/google-maps-places-provider - 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. geocoder-php/google-maps-places-provider

ActiveLibrary[API Development](/categories/api)

geocoder-php/google-maps-places-provider
========================================

Geocoder Google Maps Places adapter

1.5.0(1y ago)4678.1k↑11.6%55MITPHPPHP ^8.0CI failing

Since Aug 14Pushed 5mo ago3 watchersCompare

[ Source](https://github.com/geocoder-php/google-maps-places-provider)[ Packagist](https://packagist.org/packages/geocoder-php/google-maps-places-provider)[ Docs](http://geocoder-php.org/Geocoder/)[ RSS](/packages/geocoder-php-google-maps-places-provider/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (8)Dependencies (5)Versions (9)Used By (5)

Google Places Geocoder provider
===============================

[](#google-places-geocoder-provider)

[![Build Status](https://camo.githubusercontent.com/26d345e8133ef301cbe522e7261e7518e54730a4608f161d4498c935bf2dbfb4/68747470733a2f2f7472617669732d63692e6f72672f67656f636f6465722d7068702f676f6f676c652d6d6170732d706c616365732d70726f76696465722e7376673f6272616e63683d6d6173746572)](http://travis-ci.org/geocoder-php/google-maps-places-provider)[![Latest Stable Version](https://camo.githubusercontent.com/e49af42d09def80f10321d62615df953199be04f472b499834693c19f9d9cfe9/68747470733a2f2f706f7365722e707567782e6f72672f67656f636f6465722d7068702f676f6f676c652d6d6170732d706c616365732d70726f76696465722f762f737461626c65)](https://packagist.org/packages/geocoder-php/google-maps-places-provider)[![Total Downloads](https://camo.githubusercontent.com/eedc7291890cda14c2f76f39577ef93d001097256fd67189493657f4242ea0fd/68747470733a2f2f706f7365722e707567782e6f72672f67656f636f6465722d7068702f676f6f676c652d6d6170732d706c616365732d70726f76696465722f646f776e6c6f616473)](https://packagist.org/packages/geocoder-php/google-maps-places-provider)[![Monthly Downloads](https://camo.githubusercontent.com/ac5785815285ccd07c44bbd471928befa7786d7ec4e768cb06b9392027dca55e/68747470733a2f2f706f7365722e707567782e6f72672f67656f636f6465722d7068702f676f6f676c652d6d6170732d706c616365732d70726f76696465722f642f6d6f6e74686c792e706e67)](https://packagist.org/packages/geocoder-php/google-maps-places-provider)[![Code Coverage](https://camo.githubusercontent.com/cc4fce45b5fb42b288dce55e89a06cbecf1c9bb0b82f1e652dd3fd578475bf63/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f67656f636f6465722d7068702f676f6f676c652d6d6170732d706c616365732d70726f76696465722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/geocoder-php/google-maps-places-provider)[![Quality Score](https://camo.githubusercontent.com/653a34690c399bb59586c42a5c48b9d3211f7456c5e598adba6ef0cf9ba33a40/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f67656f636f6465722d7068702f676f6f676c652d6d6170732d706c616365732d70726f76696465722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/geocoder-php/google-maps-places-provider)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)

This is the Google Places provider from the PHP Geocoder. This is a **READ ONLY** repository. See the [main repo](https://github.com/geocoder-php/Geocoder) for information and documentation.

Install
-------

[](#install)

```
composer require geocoder-php/google-maps-places-provider
```

API Documentation
-----------------

[](#api-documentation)

Usage
-----

[](#usage)

This provider often requires extra data when making queries, due to requirements of the underlying Places API.

### Geocoding

[](#geocoding)

This provider supports two different modes of geocoding by text.

#### Find Mode

[](#find-mode)

This is the default mode. It required an exact places name. It's not very forgiving, and generally only returns a single result

```
$results = $provider->geocodeQuery(
    GeocodeQuery::create('Museum of Contemporary Art Australia')
);
```

#### Search Mode

[](#search-mode)

This mode will perform a search based on the input text. It's a lot more forgiving that the `find` mode, but results will contain all fields and thus be billed at the highest rate.

```
$results = $provider->geocodeQuery(
    GeocodeQuery::create('art museum sydney')
        ->withData('mode', GoogleMapsPlaces::GEOCODE_MODE_SEARCH)
);
```

around location (which is similar to reverse geocoding, see below):

```
$results = $provider->geocodeQuery(
    GeocodeQuery::create('bar')
        ->withData('mode', GoogleMapsPlaces::GEOCODE_MODE_SEARCH)
        ->withData('location', '-32.926642, 151.783026')
);
```

country matches a country name or a two letter ISO 3166-1 country code. If you only use the "region" parameter, you will not be guaranteed to have results on the region, as the documentation indicates [Region](https://developers.google.com/maps/documentation/javascript/geocoding#GeocodingRequests):

> The region parameter will only influence, not fully restrict, results from the geocoder.

```
$results = $provider->geocodeQuery(
    GeocodeQuery::create('montpellier')
        ->withData('components', 'country:FR');
);
```

### Reverse Geocoding

[](#reverse-geocoding)

Three options available for reverse geocoding of latlon coordinates:

- mode `search` + type (e.g.) `bar`: uses Google Place API [Text search](https://developers.google.com/places/web-service/search#TextSearchRequests), requires `type`
    - is similar to: Search around location (see previous section)
- mode `nearby` + rankby `distance`: uses Google Place API [Nearby search](https://developers.google.com/places/web-service/search#PlaceSearchRequests), requires `type/keyword/name`
- mode `nearby` + rankby `prominence`: uses Google Place API [Nearby search](https://developers.google.com/places/web-service/search#PlaceSearchRequests), requires `radius`

Default mode: `search` (because of backward compatibility). When using mode `nearby` default rankby: `prominence`. Mode `search` + type and mode `nearby` + type/keyword/name are very similar. Mode `search` gives formatted\_address, mode `nearby` gives vicinity instead. E.g.:

- `search`: has "formatted\_address": "7 Cope St, Redfern NSW 2016"
- `nearby`: has "vicinity" instead: "7 Cope St, Redfern"

Examples

```
$results = $provider->reverseQuery(
    ReverseQuery::fromCoordinates(-33.892674, 151.200727)
        // ->withData('mode', GoogleMapsPlaces::GEOCODE_MODE_SEARCH) // =default
        ->withData('type', 'bar') // requires type
    );
$address = $results->first()->getFormattedAddress();
```

```
$results = $provider->reverseQuery(
    ReverseQuery::fromCoordinates(-33.892674, 151.200727)
        ->withData('mode', GoogleMapsPlaces::GEOCODE_MODE_NEARBY)
        //->withData('rankby','prominence'); // =default
        ->withData('radius', 500) // requires radius (meters)
    );
$vicinity = $results->first()->getVicinity();
```

```
$results = $provider->reverseQuery(
    ReverseQuery::fromCoordinates(-33.892674, 151.200727)
        ->withData('mode', GoogleMapsPlaces::GEOCODE_MODE_NEARBY)
        ->withData('rankby','distance');
        ->withData('keyword', 'bar') // requires type/keyword/name
    );
```

### Contribute

[](#contribute)

Contributions are very welcome! Send a pull request to the [main repository](https://github.com/geocoder-php/Geocoder) or report any issues you find on the [issue tracker](https://github.com/geocoder-php/Geocoder/issues).

###  Health Score

52

—

FairBetter than 96% of packages

Maintenance59

Moderate activity, may be stable

Popularity42

Moderate usage in the ecosystem

Community28

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor1

Top contributor holds 60% 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 ~295 days

Recently: every ~412 days

Total

8

Last Release

398d ago

PHP version history (5 changes)1.0.0PHP ^7.0

1.1.0PHP ^7.2

1.3.0PHP ^7.3 || ^8.0

1.4.0PHP ^7.4 || ^8.0

1.5.0PHP ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/401ccc5eea13c60cf807ae982af00e368e2166e2f26d8eb541dcd881a57385bc?d=identicon)[Nyholm](/maintainers/Nyholm)

![](https://www.gravatar.com/avatar/b434ff5f6f9dcc7095f45c43254299b3cc8f6c83e9a757a80a6b7d229a4c9701?d=identicon)[jbelien](/maintainers/jbelien)

---

Top Contributors

[![jbelien](https://avatars.githubusercontent.com/u/1150563?v=4)](https://github.com/jbelien "jbelien (24 commits)")[![Chris53897](https://avatars.githubusercontent.com/u/7104259?v=4)](https://github.com/Chris53897 "Chris53897 (6 commits)")[![gilles-g](https://avatars.githubusercontent.com/u/377875?v=4)](https://github.com/gilles-g "gilles-g (1 commits)")[![jackff87](https://avatars.githubusercontent.com/u/67412823?v=4)](https://github.com/jackff87 "jackff87 (1 commits)")[![JaZo](https://avatars.githubusercontent.com/u/3475007?v=4)](https://github.com/JaZo "JaZo (1 commits)")[![nicolas-grekas](https://avatars.githubusercontent.com/u/243674?v=4)](https://github.com/nicolas-grekas "nicolas-grekas (1 commits)")[![norkunas](https://avatars.githubusercontent.com/u/2722872?v=4)](https://github.com/norkunas "norkunas (1 commits)")[![Nyholm](https://avatars.githubusercontent.com/u/1275206?v=4)](https://github.com/Nyholm "Nyholm (1 commits)")[![thmsu](https://avatars.githubusercontent.com/u/67536769?v=4)](https://github.com/thmsu "thmsu (1 commits)")[![atymic](https://avatars.githubusercontent.com/u/50683531?v=4)](https://github.com/atymic "atymic (1 commits)")[![wivaku](https://avatars.githubusercontent.com/u/2084872?v=4)](https://github.com/wivaku "wivaku (1 commits)")[![comxd](https://avatars.githubusercontent.com/u/9022239?v=4)](https://github.com/comxd "comxd (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/geocoder-php-google-maps-places-provider/health.svg)

```
[![Health](https://phpackages.com/badges/geocoder-php-google-maps-places-provider/health.svg)](https://phpackages.com/packages/geocoder-php-google-maps-places-provider)
```

###  Alternatives

[willdurand/geocoder-bundle

Integration of Geocoder into Symfony

3226.4M12](/packages/willdurand-geocoder-bundle)[geocoder-php/geo-plugin-provider

Geocoder GeoPlugin adapter

975.0M8](/packages/geocoder-php-geo-plugin-provider)[geocoder-php/chain-provider

Geocoder chain adapter

1046.8M13](/packages/geocoder-php-chain-provider)[geocoder-php/nominatim-provider

Geocoder Nominatim adapter

354.4M27](/packages/geocoder-php-nominatim-provider)[geocoder-php/ipstack-provider

Geocoder Ipstack adapter

60334.1k2](/packages/geocoder-php-ipstack-provider)[swisnl/geocoder-php-nationaal-georegister-provider

PDOK (formerly Nationaal Georegister) provider for Geocoder PHP

28330.8k2](/packages/swisnl-geocoder-php-nationaal-georegister-provider)

PHPackages © 2026

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