PHPackages                             vovanmix/google-places-api - 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. vovanmix/google-places-api

ActiveLibrary[API Development](/categories/api)

vovanmix/google-places-api
==========================

Google Places Api

v1.0.7(10y ago)0128MITPHPPHP &gt;=5.5.9

Since Feb 5Pushed 10y ago1 watchersCompare

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

READMEChangelog (7)Dependencies (5)Versions (10)Used By (0)

This fork
=========

[](#this-fork)

This is a fork of .

I added model classes for results, API to retrieve photos, and caching.

Google Places APi.
==================

[](#google-places-api)

This is a PHP wrapper for **Google Places Api Web Service**. And is [Laravel Framework](https://laravel.com/docs/5.2) friendly.

About Package
-------------

[](#about-package)

With just 2 lines of code you can request to any google places api feature. No need to manually perform any curl requests.

### The following place requests are available:

[](#the-following-place-requests-are-available)

- [Place Search](#place-search) return a list of places based on a user's location or search string.
- [Place Details](#place-details) requests return more detailed information about a specific Place, including user reviews.
- [Place Autocomplete](#place-autocomplete) can be used to automatically fill in the name and/or address of a place as you type.
- [Query Autocomplete](#query-autocomplete) can be used to provide a query prediction service for text-based geographic searches, by returning suggested queries as you type.

Installation
============

[](#installation)

Install it with composer

```
composer require vovanmix/google-places-api

```

Usage
=====

[](#usage)

**Laravel user can see the [Laravel Usage](#laravel-usage) section**

Step 1 - Import the class using namespace
-----------------------------------------

[](#step-1---import-the-class-using-namespace)

```
use Vovanmix\GoogleApi\PlacesApi;
```

Step 2 - Initiate the object
----------------------------

[](#step-2---initiate-the-object)

```
$googlePlaces = new PlacesApi('API KEY');
```

**Note:** You can also set the **API KEY** after initaiting the class using `setKey('KEY')` method. You can chain this with method with anyother methods.

Step 3 - Start Using the Api.
-----------------------------

[](#step-3---start-using-the-api)

Example:

```
$response = $googlePlaces->placeAutocomplete('some Place');
```

As mentioned earlier just 2 lines of code to make any request.

**Full example:**

```
use Vovanmix\GoogleApi\PlacesApi;

function () {
  $googlePlaces = new PlacesApi('API_KEY') # line 1
  $response = $googlePlaces->placeAutocomplete('some input'); # line 2
}
```

---

Use with Laravel
================

[](#use-with-laravel)

Step 1
------

[](#step-1)

Set up the service provider and facade in the **config\\app.php**

```
'providers' => [
....
....
Vovanmix\GoogleApi\ServiceProvider::class,
];

'aliases' => [
....
....
'GooglePlaces' => Vovanmix\GoogleApi\Facade::class,
];
```

Step 2
------

[](#step-2)

publish the config file with following artisan command

```
php artisan vendor:publish --provider="Vovanmix\GoogleApi\ServiceProvider"

```

This will create **google.php** file in the config directory.

Set the *API KEY* in this config file.

Set 3
-----

[](#set-3)

Start using the package using Facade.

```
$response = GooglePlaces::placesAutocomplete('some city');

```

---

Response
========

[](#response)

The response returned is a [Laravel's Collection](https://laravel.com/docs/5.2/collections) so that you can perform any of the available collection methods on it.

> If you are not familiar with *Laravel's Collecton* you can either reference the docs [here](https://laravel.com/docs/5.2/collections) or you can use **response** as simple array.

---

Available Methods
=================

[](#available-methods)

Place Search
------------

[](#place-search)

### nearbySearch($location, $radius = null, $params = \[\])

[](#nearbysearchlocation-radius--null-params--)

- `location` — The latitude/longitude around which to retrieve place information. This must be specified as latitude,longitude.
- 'radius' — Defines the distance (in meters) within which to return place results. The maximum allowed radius is 50 000 meters. Note that `radius` must not be included if `rankby=distance` (described under **Optional parameters** below) is specified.
- If `rankby=distance` (described under **Optional parameters** below) is specified, then one or more of `keyword`, `name`, or `types` is required.
- `params` - **Optionan Parameters** You can refer all the avaiable optional parameters on the [Google's Official Webpage](https://developers.google.com/places/web-service/search)

### textSearch($query, $params = \[\])

[](#textsearchquery-params--)

- `query` — The text string on which to search, for example: "restaurant". The Google Places service will return candidate matches based on this string and order the results based on their perceived relevance.
- `params` - **Optionan Parameters** You can refer all the avaiable optional parameters on the [Google's Official Webpage](https://developers.google.com/places/web-service/search)

### radarSearch($location, $radius, array $params)

[](#radarsearchlocation-radius-array-params)

- `location` — The latitude/longitude around which to retrieve place information. This must be specified as latitude,longitude.
- `radius` — Defines the distance (in meters) within which to return place results. The maximum allowed radius is 50 000 meters.
- `params` - **Optionan Parameters** You can refer all the avaiable optional parameters on the [Google's Official Webpage](https://developers.google.com/places/web-service/search)

**Note:** A Radar Search request must include at least one of `keyword`, `name`, or `types`.

---

Place Details
=============

[](#place-details)

### placeDetails($placeId, $params = \[\])

[](#placedetailsplaceid-params--)

- `placeId` — A textual identifier that uniquely identifies a place, returned from a Place Search.
- `params` - **Optionan Parameters** You can refer all the avaiable optional parameters on the [Google's Official Webpage](https://developers.google.com/places/web-service/details)

---

Place Autocomplete
==================

[](#place-autocomplete)

### placeAutocomplete($input, $params = \[\])

[](#placeautocompleteinput-params--)

- `input` — The text string on which to search. The Place Autocomplete service will return candidate matches based on this string and order results based on their perceived relevance.
- `params` - **Optionan Parameters** You can refer all the avaiable optional parameters on the [Google's Official Webpage](https://developers.google.com/places/web-service/autocomplete)

---

Query Autocomplete
==================

[](#query-autocomplete)

### queryAutocomplete($input, $params = \[\])

[](#queryautocompleteinput-params--)

- `input` — The text string on which to search. The Places service will return candidate matches based on this string and order results based on their perceived relevance.
- `params` - **Optionan Parameters** You can refer all the avaiable optional parameters on the [Google's Official Webpage](https://developers.google.com/places/web-service/query)

Additional Methods
==================

[](#additional-methods)

### getStatus()

[](#getstatus)

This will return the status of the response send by google api. Use it after making any reqquest.

### getKey()

[](#getkey)

This will return the `API KEY` been used with the requests.

### setKey($key)

[](#setkeykey)

This will set the `API KEY`.

Contribution
============

[](#contribution)

Feel free to report issues or make Pull Requests. If you find this document can be improved in any way, please feel free to open an issue for it.

License
=======

[](#license)

The Google Places Api is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT)

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 61.9% 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 ~8 days

Recently: every ~0 days

Total

8

Last Release

3689d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1e689ae1b5eec04b120b871ad57b22a2832101b52936eb182378b337d390635b?d=identicon)[vovanmix](/maintainers/vovanmix)

---

Top Contributors

[![vovanmix](https://avatars.githubusercontent.com/u/7279514?v=4)](https://github.com/vovanmix "vovanmix (13 commits)")[![SachinAgarwal1337](https://avatars.githubusercontent.com/u/5370915?v=4)](https://github.com/SachinAgarwal1337 "SachinAgarwal1337 (8 commits)")

---

Tags

googlegoogle apiplacesgoogle placesGoogle Places Api

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/vovanmix-google-places-api/health.svg)

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

###  Alternatives

[skagarwal/google-places-api

Google Places Api

1913.0M8](/packages/skagarwal-google-places-api)[x-fran/g-trends

Google Trends API for PHP

11955.6k](/packages/x-fran-g-trends)[biscolab/google-maps-php-sdk

Google Maps PHP SDK.

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

Athenaeum is a mono repository; a collection of various PHP packages

255.2k](/packages/aedart-athenaeum)[geckob/firebase

PHP package for Firebase wrapper

4251.9k](/packages/geckob-firebase)[tomshaw/google-api

A Laravel Google API Client.

591.5k](/packages/tomshaw-google-api)

PHPackages © 2026

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