sabana15 / yelp-fusion-api-php
PHP wrapper for Yelp API v3
Installs: 10
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:package
Requires
- php: >=5.6.0
This package is not auto-updated.
Last update: 2025-05-16 16:40:50 UTC
README
INSTALL
#NOTE: Ignore this guzzle package if you already have it installed
-
You can add as a dependency using Composer:
composer require guzzlehttp/guzzle:^6.0
composer require sabana15/yelp-fusion-api-php
-
Alternatively, you can specify as a dependency in your project's existing composer.json file:
{
"require": { "guzzlehttp/guzzle:^6.0", "sabana15/yelp-fusion-api-php": "1.0" }
}
USAGE
This package only supports Yelp Fusion API v3
Create Yelp API CLient
$yelpFusion = new TrialAPI\YelpClient('Place the API Key here);
Fetch the businesses based on search parameters
$param = array('location' => 'xyz');
$businessSearchList = $yelpFusion->getBusinessesSearchResults($param);
PHP Example
Create the file index.php and put the following content.
require 'vendor/autoload.php';
try{
$apikey = 'API key goes here';
$yelpFusion = new TrialAPI\YelpClient($apikey);
$param = array('location' => 'melbourne');
$businessSearchList = $yelpFusion->getBusinessesSearchResults($param);
var_dump($businessSearchList);
}
catch(Exception $e) {
echo $e->getResponseBody();
}
Run 'php index.php' to check in terminal or accesss and check in browser