aboutsummaryrefslogtreecommitdiff
path: root/data/script.py
diff options
context:
space:
mode:
authorJeremyJamesL <jeremyluscombe@gmail.com>2024-12-17 19:16:09 +0000
committerJeremyJamesL <jeremyluscombe@gmail.com>2024-12-17 19:16:09 +0000
commit084d8e2dc5a18a445f05aca4d75d7a8eb6b6b437 (patch)
tree7d4667193fe2a833872124387b6ecf90b7dceba9 /data/script.py
parente6ca789c7873a77ddf070313452fdafdeeb603ef (diff)
prod
Diffstat (limited to 'data/script.py')
-rw-r--r--data/script.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/data/script.py b/data/script.py
index e7e37e1..911f2a2 100644
--- a/data/script.py
+++ b/data/script.py
@@ -1,8 +1,12 @@
-api_key="499c19189bmsh1de144300936427p134bd5jsnbdcec35e8f65"
+from dotenv import load_dotenv
+import os
import urllib.parse
import requests
import json
+base_url = "https://wyre-data.p.rapidapi.com/restaurants/localauthority/"
+
+load_dotenv()
boroughs = [
"barking and dagenham",
"barnet",
@@ -37,15 +41,15 @@ boroughs = [
"wandsworth",
"westminster"]
-base_url = "https://wyre-data.p.rapidapi.com/restaurants/localauthority/"
-
final = []
for borough in boroughs:
borough_encoded = urllib.parse.quote(borough)
- response = requests.get(base_url + borough_encoded, headers={"x-rapidapi-key": api_key})
+ response = requests.get(base_url + borough_encoded, headers={"x-rapidapi-key": os.getenv('WYRE_API_KEY')})
results = response.json()
+ print(results)
+
for result in results:
bizType = result.get("BusinessType", "missing")
if(bizType == "Pub/bar/nightclub"):