adding musthave and lastXdays
This commit is contained in:
parent
36258d877f
commit
a9b8d4d630
3 changed files with 9 additions and 18 deletions
|
|
@ -30,7 +30,7 @@ def detail_query(detail_id: int):
|
|||
|
||||
|
||||
# @cache.memoize()
|
||||
def listing_query(page: int, min_bedrooms: int, max_bedrooms: int, radius: float, min_price: int, max_price: int) -> dict:
|
||||
def listing_query(page: int, min_bedrooms: int, max_bedrooms: int, radius: float, min_price: int, max_price: int, mustNewHome: bool = False, max_days_since_added: int = None) -> dict:
|
||||
params = {
|
||||
"locationIdentifier": "POSTCODE^4228216",
|
||||
"channel": "BUY",
|
||||
|
|
@ -48,6 +48,13 @@ def listing_query(page: int, min_bedrooms: int, max_bedrooms: int, radius: float
|
|||
"apiApplication": "ANDROID",
|
||||
"appVersion": "3.70.0",
|
||||
}
|
||||
if max_days_since_added:
|
||||
if max_days_since_added not in [1,3,7,14]:
|
||||
raise Exception("Invalid max days. Can only be", [1,3,7,14])
|
||||
params['maxDaysSinceAdded'] = max_days_since_added
|
||||
|
||||
if mustNewHome:
|
||||
params['mustHave'] = 'newHome'
|
||||
|
||||
response = requests.get(
|
||||
"https://api.rightmove.co.uk/api/property-listing",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue