import requests import json from config import FSQ_API_KEY POI_API_ENDPOINT = "https://api.foursquare.com/v3/places/nearby?ll={}%2C{}" def query_poi(latitude, longitude): url = POI_API_ENDPOINT.format(latitude, longitude) headers = { "accept": "application/json", "Authorization": FSQ_API_KEY } response = requests.get(url, headers=headers) print(response.text) return json.loads(response.text)["results"][:2]