1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "mode": "search",
10 "locations": ["London"],
11 "startUrls": [
12 { "url": "https://www.onthemarket.com/for-sale/property/london/" },
13 { "url": "https://www.onthemarket.com/for-sale/property/london/?page=2" },
14 { "url": "https://www.onthemarket.com/for-sale/property/london/?sort-field=price&sort-order=asc&page=2" },
15 { "url": "https://www.onthemarket.com/for-sale/2-bed-flats-apartments/london/?min-price=300000&max-price=900000&sort-field=price&radius=3" },
16 { "url": "https://www.onthemarket.com/for-sale/detached/london/" },
17 { "url": "https://www.onthemarket.com/for-sale/property/sw19/" },
18 { "url": "https://www.onthemarket.com/to-rent/property/manchester/" },
19 { "url": "https://www.onthemarket.com/to-rent/property/london/?page=2" },
20 { "url": "https://www.onthemarket.com/new-homes/property/london/" },
21 { "url": "https://www.onthemarket.com/for-sale/property/london/?new-homes=true" },
22 { "url": "https://www.onthemarket.com/details/20490019/" },
23 { "url": "https://www.onthemarket.com/details/20622528" },
24 { "url": "https://www.onthemarket.com/property/london/" },
25 { "url": "https://www.onthemarket.com/agents/branch/1-clickproperties-acton/" },
26 { "url": "https://www.onthemarket.com/agents/london/" },
27 ],
28 "incrementalMode": False,
29 "emitUnchanged": False,
30 "emitExpired": False,
31 "ignoreFieldsForChanges": [],
32}
33
34
35run = client.actor("abotapi/onthemarket-scraper").call(run_input=run_input)
36
37
38print(f"๐พ Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
39for item in client.dataset(run.default_dataset_id).iterate_items():
40 print(item)
41
42