aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'foursquare/query_poi.py')
-rw-r--r--foursquare/query_poi.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/foursquare/query_poi.py b/foursquare/query_poi.py
new file mode 100644
index 0000000..64ded55
--- /dev/null
+++ b/foursquare/query_poi.py
@@ -0,0 +1,18 @@
1import requests
2import json
3from config import FSQ_API_KEY
4
5POI_API_ENDPOINT = "https://api.foursquare.com/v3/places/nearby?ll={}%2C{}"
6
7
8def query_poi(latitude, longitude):
9 url = POI_API_ENDPOINT.format(latitude, longitude)
10
11 headers = {
12 "accept": "application/json",
13 "Authorization": FSQ_API_KEY
14 }
15
16 response = requests.get(url, headers=headers)
17 print(response.text)
18 return json.loads(response.text)["results"][:2]
Powered by cgit v1.2.3 (git 2.41.0)