1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "operation": "search",
10 "location": "Madrid",
11 "locations": [
12 "Barcelona",
13 "Valencia",
14 ],
15 "agencyUrls": [],
16 "transactionType": "sale",
17 "propertyType": "all",
18 "newConstruction": False,
19 "minPrice": 0,
20 "maxPrice": 0,
21 "minRooms": 0,
22 "minBathrooms": 0,
23 "minSurface": 0,
24 "maxSurface": 0,
25 "sortBy": "relevance",
26 "maxResults": 90,
27}
28
29
30run = client.actor("sian.agency/fotocasa-property-scraper").call(run_input=run_input)
31
32
33print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
34for item in client.dataset(run.default_dataset_id).iterate_items():
35 print(item)
36
37