Yelp API Client - Python implementation.
This client is a thin wrapper around the Yelp API.
- oauth2
- requests
pip install oauth2 requests
pip install git+https://github.com/tazzy531/YelpClient.git
client = YelpClient(yelp_keys)
result_json = client.search_by_location(
location = '94043', term = 'Red Rock', limit = 10,
sort = YelpClient.SortType.BEST_MATCHED)
// OR search by geo coordinates
result_json = client.search_by_geo_coord(
latlong = (39.0639, -108.55), term='bars')
yelp_keys is a dict with the following keys.
keys = {
'consumer_key' : 'example',
'consumer_secret' : 'example',
'token' : 'example',
'token_secret' : 'example',
}
These keys are generated by the Yelp API Console
A simple CLI is included as an example for the usage which reads a keyfile in json format. An example key file is in cfg/yelp_keys.json.
yelp_cli.py 'mountain view, ca' 'bars' --loctype=LOCATION --keyfile=[keyfile.json]