1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "searchUrl": "https://www.comparis.ch/immobilien/result/list?requestobject=%7B%22DealType%22%3A10%2C%22SiteId%22%3A0%2C%22RootPropertyTypes%22%3A%5B%5D%2C%22PropertyTypes%22%3A%5B%5D%2C%22RoomsFrom%22%3Anull%2C%22RoomsTo%22%3Anull%2C%22FloorSearchType%22%3A0%2C%22LivingSpaceFrom%22%3Anull%2C%22LivingSpaceTo%22%3Anull%2C%22PriceFrom%22%3Anull%2C%22PriceTo%22%3Anull%2C%22ComparisPointsMin%22%3A0%2C%22AdAgeMax%22%3A0%2C%22AdAgeInHoursMax%22%3Anull%2C%22DistanceFromGeoLocationKm%22%3Anull%2C%22MinAvailableDate%22%3Anull%2C%22MinChangeDate%22%3Anull%2C%22WithImagesOnly%22%3Afalse%2C%22WithPointsOfInterestOnly%22%3Afalse%2C%22Keyword%22%3Anull%2C%22WithVirtualToursOnly%22%3Afalse%2C%22ConstructionDateFrom%22%3Anull%2C%22ConstructionDateTo%22%3Anull%2C%22LastRenovationFrom%22%3Anull%2C%22LastRenovationTo%22%3Anull%2C%22NumberOfParkingLotsFrom%22%3Anull%2C%22NumberOfParkingLotsTo%22%3Anull%2C%22SurfaceOfLandFrom%22%3Anull%2C%22SurfaceOfLandTo%22%3Anull%2C%22WithChildrenOnly%22%3Afalse%2C%22WithPetsOnly%22%3Afalse%2C%22WithWheelchairOnly%22%3Afalse%2C%22WithLiftOnly%22%3Afalse%2C%22WithBalconyOnly%22%3Afalse%2C%22WithGardenOnly%22%3Afalse%2C%22ElevationDistanceSorting%22%3Anull%2C%22SortingCriteria%22%3A3%2C%22SortingDirection%22%3A2%7D",
10 "maxResults": 200,
11}
12
13
14run = client.actor("agenscrape/comparis-ch-real-estate-scraper").call(run_input=run_input)
15
16
17print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
18for item in client.dataset(run["defaultDatasetId"]).iterate_items():
19 print(item)
20
21