Skip to content

Yelp API integration #5

Description

@kunpai

import requests
import json

api_key='S9q0xG2BD_ohAxsfex1zsrpNuhCTz1jdPrC9NgnmQIPvM84h1pwlTC_mjHgVQRLLokfjQ9HjsePce_kxRYd3ghpF2crzijVWuY727DJqKsawoGVK47QZk0GGVYZhYnYx'
headers = {'Authorization': 'Bearer %s' % api_key}

url='https://api.yelp.com/v3/businesses/search'

In the dictionary, term can take values like food, cafes or businesses like McDonalds

params = {'term':'paesanos','location':'Davis,CA'}

Making a get request to the API

req=requests.get(url, params=params, headers=headers)

json.loads(req.text)

print(req.json())

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions