PHP code example of hoseinrafiei / easy-yelp

1. Go to this page and download the library: Download hoseinrafiei/easy-yelp library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

hoseinrafiei / easy-yelp example snippets




$yelp = new EasyYelp\Yelp('YOUR_API_TOKEN');
$businesses = $yelp->businessSearch([
    'location' => 'Los Angeles, CA',
    'price' => '1,2,3',
    'sort_by' => 'distance',
    'limit' => '30',
])->getArray();

$request = [];
$yelp->businessSearch($request)->getArray();

$request = [];
$yelp->businessPhoneSearch($request)->getArray();

$request = [];
$yelp->transactionSearch('delivery', $request)->getArray();

$businessId = 'blahblah'; 
$request = [];
$yelp->businessDetails($businessId, $request)->getArray();
 
$request = [];
$yelp->businessMatch($request)->getArray();
 
$businessId = 'blahblah';
$request = [];
$yelp->businessReviews($businessId, $request)->getArray();
 
$request = [];
$yelp->autocomplete($request)->getArray();
 
$eventId = 'blahblah';
$request = [];
$yelp->eventDetails($eventId, $request)->getArray();
 
$request = [];
$yelp->events($request)->getArray();
 
$request = [];
$yelp->featuredEvent($request)->getArray();
 
$request = [];
$yelp->categories($request)->getArray();

$alias = 'blahblah'; 
$request = [];
$yelp->categoryDetails($alias, $request)->getArray();

$businesses = $yelp->businessSearch($request)->getArray();
if($yelp->hasError()) // We have an error
{
    echo $yelp->getError(); // Print the error message
}