internetnextstep / google-places-api
The PHP Google Places API
Installs: 176
Dependents: 0
Suggesters: 0
Security: 0
Type:package
pkg:composer/internetnextstep/google-places-api
Requires
- guzzlehttp/guzzle: ^6.3
Requires (Dev)
- phpunit/phpunit: ^6.0
- satooshi/php-coveralls: ^2.0
This package is not auto-updated.
Last update: 2025-10-04 14:34:47 UTC
README
NOTE: This project might be missing features, please send pull requests for additional usage.
This package allows you to connect and pull information from the Google Places API
You will need a Google API Client Key to use Google Places API.
Features:
- Place Search
- Place Details
- Place Photos (with local image download)
Installation:
Composer to install package.
Use composer require tmarois/google-places-api dev-master
Basic Usage:
$client = new \GooglePlaces\Client('YOUR_CLIENT_KEY');
// find all movie theaters in this zip code
$response = $client->placeSearch('textsearch')->setOptions([
'query' => 'movie theaters in 28202'
])->request();
// get specific place detail information
$placeId = 'ChIJvznB1hAnVIgRrWFNVdxDHm0';
$response = $client->placeDetails($placeId)->request();
// get a photo found in the previous responses,
// look up by the "photo_reference"
// save the photo locally for caching
$photoId = 'CmRaAAAAoKx6KQyrDEJ0si1ekan0QaZ6Y02NpXwBFa1ncLaKhZECbFa';
$client->placePhotos($photoId,[450,450])->request()->save(__DIR__.'/images');
Resources:
Contributions
Accepting contributions and feedback. Send in any issues and pull requests.