-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
25 lines (17 loc) · 711 Bytes
/
Copy pathmain.py
File metadata and controls
25 lines (17 loc) · 711 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import requests
import config
import json
#Gets the data from the API and stores it in a file. Currently not for real time use...
def findHomesIn60139():
url = "https://us-real-estate.p.rapidapi.com/v2/for-sale-by-zipcode"
querystring = {"zipcode": "60139", "offset": "0", "limit": "10"}
headers = {
"X-RapidAPI-Key": config.X_RapidAPI_Key,
"X-RapidAPI-Host": config.X_RapidAPI_Host
}
response = requests.request("GET", url, headers=headers, params=querystring)
# with open('data.json', 'w', encoding='utf-8') as f:
# json.dump(response.text, f, ensure_ascii=False, indent=4)
print(response.text)
# if __name__ == '__main__':
# findHomesIn60139()