aboutsummaryrefslogtreecommitdiff
blob: 64ded55f1f0f12c7aa29c1854b4f1c8485b8a368 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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]
Powered by cgit v1.2.3 (git 2.41.0)