blob: 64ded55f1f0f12c7aa29c1854b4f1c8485b8a368 (
plain) (
tree)
|
|
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]
|