diff --git a/rec/query.py b/rec/query.py index 6ea2d94..ddf6f98 100644 --- a/rec/query.py +++ b/rec/query.py @@ -21,20 +21,20 @@ headers = { @cache.memoize() -def listing_query(page: int, min_bedrooms: int, max_bedrooms: int): - print("Executing") +def listing_query(page: int, min_bedrooms: int, max_bedrooms: int, radius: float, min_price: int, max_price: int): + print("Querying") params = { "locationIdentifier": "POSTCODE^4228216", "channel": "BUY", "page": str(page), "numberOfPropertiesPerPage": "25", - "radius": "5.0", + "radius": str(radius), "sortBy": "distance", "includeUnavailableProperties": "false", "propertyTypes": "flat", "dontShow": "sharedOwnership,retirement", - "minPrice": "150000", - "maxPrice": "500000", + "minPrice": str(min_price), + "maxPrice": str(max_price), "minBedrooms": str(min_bedrooms), "maxBedrooms": str(max_bedrooms), "apiApplication": "ANDROID", @@ -54,7 +54,7 @@ def listing_query(page: int, min_bedrooms: int, max_bedrooms: int): if __name__ == "__main__": - response = listing_query(1, 2, 2) + response = listing_query(page=1, min_bedrooms=2, max_bedrooms=2, radius=5.0, min_price=150000, max_price=700000) resp = response for d in resp["properties"]: rl = RightmoveListing(