PHPackages                             2amigos/google-places-library - 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. 2amigos/google-places-library

AbandonedArchivedLibrary[API Development](/categories/api)

2amigos/google-places-library
=============================

Google Places API Library

1.0.2(7y ago)998.7k↓40%21BSD-3-ClausePHPPHP &gt;=5.5.0

Since Aug 23Pushed 7y ago16 watchersCompare

[ Source](https://github.com/2amigos/google-places-library)[ Packagist](https://packagist.org/packages/2amigos/google-places-library)[ Docs](https://github.com/2amigos/google-places-library)[ RSS](/packages/2amigos-google-places-library/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (5)Versions (4)Used By (1)

Google Places API Library
=========================

[](#google-places-api-library)

[![Latest Version](https://camo.githubusercontent.com/7478be22770e1d798a1d73772e030e93eb4864f4c2c92dddcea91a7125a1e7aa/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f7461672f32616d69676f732f676f6f676c652d706c616365732d6c6962726172792e7376673f7374796c653d666c61742d737175617265266c6162656c3d72656c65617365)](https://github.com/2amigos/google-places-library/tags)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/c71b4f912f35aadc0af0f8aa212857f67439d13b582f91be7dcc1c08cabaf95f/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f32616d69676f732f676f6f676c652d706c616365732d6c6962726172792f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/2amigos/google-places-library)[![Coverage Status](https://camo.githubusercontent.com/777bc7c87a8cfe55386bd63155dc6a4c65a63a05a07b5583bbb39462c61a7516/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f32616d69676f732f676f6f676c652d706c616365732d6c6962726172792e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/2amigos/google-places-library/code-structure)[![Quality Score](https://camo.githubusercontent.com/b6b7053948dc27c83ff41246a1616faaec02fd99f529eceb8c0f1bb21d913399/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f32616d69676f732f676f6f676c652d706c616365732d6c6962726172792e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/2amigos/google-places-library)[![Total Downloads](https://camo.githubusercontent.com/983b30b96b69dc0067f89594bf9c0a86a0be2f7139cc5344b4f83c871cd27e77/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f32616d69676f732f676f6f676c652d706c616365732d6c6962726172792e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/2amigos/google-places-library)

Extension library to interact with [Google Places API](https://developers.google.com/places/documentation/index)

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

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
$ composer require 2amigos/google-places-library
```

or add

```
"2amigos/google-places-library": "*"

```

to the `require` section of your `composer.json` file.

Usage
-----

[](#usage)

Using `SearchClient` class:

```
use Da\Google\Places\Client\SearchClient

$search = new SearchClient('{YOURGOOGLEAPIKEY}');

// $search->forceJsonArrayResponse(); // if you want to get arrays instead of objects
// $search = new SearchClient('{YOURGOOGLEAPIKEY}', 'xml'); // if you wish to handle XML responses (JSON is highly recommended)

// If you setup the format in 'xml', the returned value will be an array.
// The library will decode the response automatically
var_dump($search->text('restaurants in Inca Mallorca'));

```

Using `PlaceClient` class:

```
use Da\Google\Places\Client\PlaceClient

$place = new PlaceClient('{YOURGOOGLEAPIKEY}');

// $place = new PlaceClient('{YOURGOOGLEAPIKEY}', 'xml'); // if you wish to handle XML responses (JSON is highly recommended)

$place->details('{REFERENCEIDOFPLACE}'));

```

Further Information
-------------------

[](#further-information)

For further information regarding the multiple parameters of Google Places please visit [its API reference](https://developers.google.com/places/documentation/index)

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

[](#contributing)

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

Clean code
----------

[](#clean-code)

We have added some development tools for you to contribute to the library with clean code:

- PHP mess detector: Takes a given PHP source code base and look for several potential problems within that source.
- PHP code sniffer: Tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.
- PHP code fixer: Analyzes some PHP source code and tries to fix coding standards issues.

And you should use them in that order.

### Using php mess detector

[](#using-php-mess-detector)

Sample with all options available:

```
 ./vendor/bin/phpmd ./src text codesize,unusedcode,naming,design,controversial,cleancode
```

### Using code sniffer

[](#using-code-sniffer)

```
 ./vendor/bin/phpcs -s --report=source --standard=PSR2 ./src
```

### Using code fixer

[](#using-code-fixer)

We have added a PHP code fixer to standardize our code. It includes Symfony, PSR2 and some contributors rules.

```
./vendor/bin/php-cs-fixer fix ./src
```

Testing
-------

[](#testing)

```
$ ./vendor/bin/phpunit
```

Credits
-------

[](#credits)

- [Antonio Ramirez](https://github.com/tonydspaniard)
- [All Contributors](https://github.com/2amigos/google-places-library/graphs/contributors)

License
-------

[](#license)

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

> [![](https://camo.githubusercontent.com/9fd8f1de41dc23003bb2a54034cb6658dde5be97092e195a62d629d0d7fa7f6c/687474703a2f2f7777772e67726176617461722e636f6d2f6176617461722f35353336333339346437323934356666376564333132353536656330343165302e706e67)](http://www.2amigos.us)
>  *Custom Software Development | Web &amp; Mobile Development Software*
>  [www.2amigos.us](http://www.2amigos.us)

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity38

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 92.3% 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 ~441 days

Total

3

Last Release

2673d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/566016?v=4)[Antonio Ramirez](/maintainers/tonydspaniard)[@tonydspaniard](https://github.com/tonydspaniard)

---

Top Contributors

[![tonydspaniard](https://avatars.githubusercontent.com/u/566016?v=4)](https://github.com/tonydspaniard "tonydspaniard (12 commits)")[![panshaigan](https://avatars.githubusercontent.com/u/8525328?v=4)](https://github.com/panshaigan "panshaigan (1 commits)")

---

Tags

2amigosapigooglephpplacesapigoogleplaces2amigos

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/2amigos-google-places-library/health.svg)

```
[![Health](https://phpackages.com/badges/2amigos-google-places-library/health.svg)](https://phpackages.com/packages/2amigos-google-places-library)
```

###  Alternatives

[skagarwal/google-places-api

Google Places Api

1913.0M8](/packages/skagarwal-google-places-api)[jcf/geocode

Google Geocoding API for Laravel

48160.5k](/packages/jcf-geocode)[sgrodzicki/pagespeed

A PHP library to interact with the PageSpeed Insights API

48130.9k](/packages/sgrodzicki-pagespeed)[eko/googletranslatebundle

A Symfony bundle to deals with Google Translate API

4337.1k](/packages/eko-googletranslatebundle)[biscolab/google-maps-php-sdk

Google Maps PHP SDK.

14215.1k](/packages/biscolab-google-maps-php-sdk)

PHPackages © 2026

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