aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorclarkzjw <[email protected]>2023-02-20 01:55:20 -0800
committerclarkzjw <[email protected]>2023-02-20 01:55:20 -0800
commit3a230798be1bc63b363cf75b8b1cae3a508cca84 (patch)
tree6df81aa7028c130726cdf0bcc3abb4f6f106fdf3 /foursquare/query_poi.py
parent48cd0ed8abf0e84fc5d013a126e84c65ef0ed87a (diff)
downloadswarm2fediverse-3a230798be1bc63b363cf75b8b1cae3a508cca84.tar.gz
4sq: add query poi example
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)