Yelp Fusion API v3 Python Client

PyPi CI build Code Coverage Documentation Status

yelpfusion3 is a Python 3 client library for Yelp Fusion API v3. The API provides Python developers with a type-safe interface, so they do not need to process raw JSON responses.


Tested with Python 3.9 and 3.10.


python -m pip install --upgrade pip
python -m pip install --upgrade yelpfusion3

Yelp API Key

Sign up for a Yelp Developers account. Yelp’s Authentication documentation describes how to create a new private API key.

Basic Usage

Set the YELP_API_KEY environment variable to be your private API key. Setting the YELP_API_KEY environment variable is currently the only supported method for supplying your API key to the yelpfusion3 client.

>>> from yelpfusion3.client import Client
>>> from import BusinessDetailsEndpoint
>>> from import BusinessDetails
>>> business_details_endpoint: BusinessDetailsEndpoint = Client.business_details(business_id="WavvLdfdP6g8aZTtbBQHTw")
>>> business_details_endpoint
BusinessDetailsEndpoint(business_id='WavvLdfdP6g8aZTtbBQHTw', locale=None)
>>> business_details: BusinessDetails = business_details_endpoint.get()
>>> business_details
BusinessDetails(id='WavvLdfdP6g8aZTtbBQHTw', alias='gary-danko-san-francisco', name='Gary Danko', image_url=HttpUrl('', ), is_claimed=True, is_closed=False, url=HttpUrl('', ), phone='+14157492060', display_phone='(415) 749-2060', review_count=5748, categories=[Category(alias='newamerican', title='American (New)'), Category(alias='french', title='French'), Category(alias='wine_bars', title='Wine Bars')], rating=4.5, location=Location(address1='800 N Point St', address2='', address3='', city='San Francisco', state='CA', zip_code='94109', country='US', display_address=['800 N Point St', 'San Francisco, CA 94109'], cross_streets=''), coordinates=Coordinates(latitude=37.80587, longitude=-122.42058), photos=[HttpUrl('', ), HttpUrl('', ), HttpUrl('', )], price='$$$$', hours=[Hours(open=[DetailedHours(is_overnight=False, start='1700', end='2200', day=0), DetailedHours(is_overnight=False, start='1700', end='2200', day=3), DetailedHours(is_overnight=False, start='1700', end='2200', day=4), DetailedHours(is_overnight=False, start='1700', end='2200', day=5), DetailedHours(is_overnight=False, start='1700', end='2200', day=6)], hours_type='REGULAR', is_open_now=False)], transactions=[], special_hours=None)


yelpfusion3 is released under the MIT License.

Indices and tables