PHPackages                             thevaliantway/yelp-php - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. thevaliantway/yelp-php

ActiveLibrary[HTTP &amp; Networking](/categories/http)

thevaliantway/yelp-php
======================

PHP Client wrapper for Yelp's Fusion API

1.0.1(8y ago)3160MITPHPPHP &gt;=5.6.0

Since Jun 18Pushed 8y ago2 watchersCompare

[ Source](https://github.com/ValiantTechnology/yelp-php)[ Packagist](https://packagist.org/packages/thevaliantway/yelp-php)[ RSS](/packages/thevaliantway-yelp-php/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (2)Versions (5)Used By (0)

Yelp Fusion API Wrapper
=======================

[](#yelp-fusion-api-wrapper)

*A PHP Client wrapper for Yelp's Fusion API*

[![Build Status](https://camo.githubusercontent.com/30c946e58809954ba2f7d41f03a91b8ee5908f4ec3ff56885cd0de9bf9671bf4/68747470733a2f2f7472617669732d63692e6f72672f56616c69616e74546563686e6f6c6f67792f79656c702d7068702e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/ValiantTechnology/yelp-php)[![GitHub release](https://camo.githubusercontent.com/1f6d3c91ee6813800c34c1dbd3db3c98878cc8da83e37e8cf3af301dd7f3358d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f76616c69616e74746563686e6f6c6f67792f79656c702d7068702e737667)](https://github.com/ValiantTechnology/yelp-php/releases)[![Code Climate](https://camo.githubusercontent.com/61105ab35ea857ddfe6158a5df84f3f60092c6e40af865eea6e604d7d04e33b2/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636c696d6174652f6769746875622f56616c69616e74546563686e6f6c6f67792f79656c702d7068702e737667)](https://codeclimate.com/github/ValiantTechnology/yelp-php)[![Packagist](https://camo.githubusercontent.com/1f9a0a425b9c43d2d6e9f71930c26ef6425c291e33d66b02913e11b079bca2f9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f74686576616c69616e747761792f79656c702d7068702e737667)](https://packagist.org/packages/thevaliantway/yelp-php)[![License: MIT](https://camo.githubusercontent.com/fdf2982b9f5d7489dcf44570e714e3a15fce6253e0cc6b5aa61a075aac2ff71b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d79656c6c6f772e737667)](https://opensource.org/licenses/MIT)[![The Valiant Way](https://camo.githubusercontent.com/c16f9819202f753371cdaf8c1b56ad9770f3ec6ca85ca1e0c116840d51c8ecfa/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f74686525323076616c69616e742d7761792d6f72616e67652e737667)](http://thevaliantway.com)[![StyleCI](https://camo.githubusercontent.com/1ccb409f766e0212d6063e6b58023f82c7a3b1be27054a8f143f9569e84185bc/68747470733a2f2f7374796c6563692e696f2f7265706f732f39343731343135352f736869656c643f6272616e63683d6d6173746572)](https://styleci.io/repos/94714155)[![Twitter Follow](https://camo.githubusercontent.com/27b3f94c9e579326f508328269b61310966e8297ce85ae28aa0a074153f0a6d8/68747470733a2f2f696d672e736869656c64732e696f2f747769747465722f666f6c6c6f772f74686576616c69616e747761792e7376673f7374796c653d736f6369616c266c6162656c3d466f6c6c6f77)](https://twitter.com/thevaliantway)

Yelp's [Fusion API](https://www.yelp.com/developers/documentation/v3) allows you to get the best local business information and user reviews of over million businesses in 32 countries.

This PHP client wrapper for Yelp's Fusion API makes it dead simple. Query the API using key/value pairs to pass along search parameters, and recieve a stdClass object to work with.

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

[](#installation)

Require this package with composer using the following command:

```
composer require thevaliantway/yelp-api

```

Authentication
--------------

[](#authentication)

Yelp's Fusion API uses OAuth2 for Authentication. Use the `bearerRequest()` method to retrieve an access token.

```
$id        = YELP_ID
$secret    = YELP_SECRET
$yelpCreds = TVW\Yelp::bearerRequest($id, $secret);

```

On success, the method will return an object containing the following:

NameTypeDescriptionaccess\_tokenstringThe access token which you'll use to access Yelp Fusion API endpoints.token\_typeintThe access token type. Always returns Bearer.expires\_inintRepresents the number of seconds after which this access token will expire. Right now it's always 15552000, which is 180 days.*Access tokens are valid for 180 days, so a caching strategy for issued tokens suggested.*

Once a valid token has been issued, you'll be able to work with the methods below.

Business Search
---------------

[](#business-search)

Returns up to 1000 businesses based on the provided search criteria. Each API call is limited to a maximum of 50 results, so use the `offset` parameter to access results beyond the initial 50 returned.

The following example will query the API for the 5 closest restaurants within 500 meters of zip code 10001, sorted by distance.

```
// parameters for testing
$searchParams = [
    "location"      => "10001",
    "radius"        => "500",
    "sort_by"       => "distance",
    "categories"    => "restaurants",
    "limit"         => 5
];
$yelpFusion = new Yelp(API_TOKEN);
$results    = $yelpFusion->searchBusiness($testParams);

```

You can use the id returned for a business with the `getBusiness()` method to retrieve detailed information.

Additional search parameters, along with detail on the API's response, may be found at [https://www.yelp.com/developers/documentation/v3/business\_search](https://www.yelp.com/developers/documentation/v3/business_search)

Phone Search
------------

[](#phone-search)

Returns a list of businesses based on the provided phone number. It is possible for more than one businesses having the same phone number (for example, chain stores with the same +1 800 phone number).

The following example will query the API for businesses with "+12127527470" as the listed phone number.

```
$yelpFusion = new Yelp(API_TOKEN);
$results    = $yelpFusion->searchPhone("+12127527470");

```

*Note:* The phone number used for searching must start with "+" and include the country code.

Detail on the API's response may be found at [https://www.yelp.com/developers/documentation/v3/business\_search\_phone](https://www.yelp.com/developers/documentation/v3/business_search_phone)

Transaction Search
------------------

[](#transaction-search)

Returns a list of businesses which support certain transactions.

The following example will query the API for businesses that deliver to the specified coordinates:

```
$transactionParams = [
    "latitude"      => "40.730610",
    "longitude"     => "-73.935242"
];
$yelpFusion = new Yelp(API_TOKEN);
$result     = $yelpFusion->searchTransaction("delivery", $transactionParams);

```

Detail on the API's response may be found at [https://www.yelp.com/developers/documentation/v3/transactions\_search](https://www.yelp.com/developers/documentation/v3/transactions_search)

Autocomplete
------------

[](#autocomplete)

Returns autocomplete suggestions for search keywords, businesses and categories, based on the input text.

The following example queries the API for autocomplete suggestions using "atomic" for the specified coordinates:

```
$autoCompleteParams = [
    "text"          => "atomic",
    "latitude"      => "40.730610",
    "longitude"     => "-73.935242"
];
$yelpFusion = new Yelp(API_TOKEN);
$results    = $yelpFusion->autoComplete($autoCompleteParams);

```

Detail on the API's response may be found at

Business Details and Reviews
----------------------------

[](#business-details-and-reviews)

Returns the detailed information or up to 3 reviews of a business. A valid business id is required, and may be obtained via the business, phone, transaction, or autocomplete searches.

The following example will query the API for detailed information on Blue Hill:

```
$yelpFusion = new Yelp(API_TOKEN);
$result     = $yelpFusion->getDetails("details", blue-hill-new-york");

```

The following example will query the API for reviews on Blue Hill:

```
$yelpFusion = new Yelp(API_TOKEN);
$result     = $yelpFusion->getDetails("reviews", blue-hill-new-york");

```

Detail on the API's responses may be found at

-
- [https://www.yelp.com/developers/documentation/v3/business\_reviews](https://www.yelp.com/developers/documentation/v3/business_reviews)

Support
-------

[](#support)

Please [open an issue](https://github.com/fraction/readme-boilerplate/issues/new) for support.

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

[](#contributing)

Please contribute using [Github Flow](https://guides.github.com/introduction/flow/). Create a branch, add commits, and [open a pull request](https://github.com/valianttechnology/yelp-php/compare/).

License
-------

[](#license)

This is free software distributed under the terms of the MIT license.

About Valiant Technology
------------------------

[](#about-valiant-technology)

Valiant Technology is a Managed Service Provider, focused on the creative and hospitality industries. Our customers include ad agencies, PR firms, app and web developers, TV/Film producers, fashion designers, restaurants and retail. And yes, we also provide support to non-creative firms, provided they enjoy our culture and "click" with our team. Learn more at .

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~2 days

Total

4

Last Release

3240d ago

Major Versions

v0.0.2 → v1.0.02017-06-20

PHP version history (2 changes)v0.0.1PHP &gt;=5.3.0

1.0.1PHP &gt;=5.6.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/246146126365a88cc7551272091ca4d016a9ee8cab5990886bc251a2b1fbfc10?d=identicon)[thevaliantway](/maintainers/thevaliantway)

---

Top Contributors

[![100781](https://avatars.githubusercontent.com/u/10855801?v=4)](https://github.com/100781 "100781 (6 commits)")

---

Tags

apifusionphpyelpapirestyelp

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/thevaliantway-yelp-php/health.svg)

```
[![Health](https://phpackages.com/badges/thevaliantway-yelp-php/health.svg)](https://phpackages.com/packages/thevaliantway-yelp-php)
```

###  Alternatives

[xendit/xendit-php

Xendit PHP SDK

189730.6k6](/packages/xendit-xendit-php)[angelleye/paypal-php-library

PHP wrapper for PayPal APIs

243440.9k](/packages/angelleye-paypal-php-library)[infobip/infobip-api-php-client

PHP library for consuming Infobip's API

921.8M10](/packages/infobip-infobip-api-php-client)[onesignal/onesignal-php-api

A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com

34170.2k2](/packages/onesignal-onesignal-php-api)[bninja/restful

Library for writing RESTful PHP clients.

1451.5k](/packages/bninja-restful)[msankhala/parsehub-php

Php wrapper classes for Parsehub REST api.

1312.4k](/packages/msankhala-parsehub-php)

PHPackages © 2026

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