1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "startUrls": [
12 "https://www.rightmove.co.uk/properties/133723646/",
13 "https://www.rightmove.co.uk/properties/130147355/",
14 "https://www.rightmove.co.uk/property-to-rent/find/PropertyLoop/London.html?locationIdentifier=BRANCH%5E222287&propertyStatus=all&includeLetAgreed=true&_includeLetAgreed=on",
15 "https://www.rightmove.co.uk/property-for-sale/find/Foxtons/Chiswick.html?locationIdentifier=BRANCH%5E15951&includeSSTC=true&_includeSSTC=on",
16 "https://www.rightmove.co.uk/student-accommodation/find.html?locationIdentifier=REGION%5E87490&insId=1",
17 "https://www.rightmove.co.uk/property-for-sale/find.html?locationIdentifier=REGION%5E87490&propertyTypes=&includeSSTC=false&mustHave=&dontShow=&furnishTypes=&keywords=",
18 "https://www.rightmove.co.uk/property-to-rent/find.html?searchType=RENT&locationIdentifier=REGION%5E87490&insId=1&radius=0.0&minPrice=&maxPrice=&minBedrooms=&maxBedrooms=&displayPropertyType=&maxDaysSinceAdded=&sortByPriceDescending=&_includeLetAgreed=on&primaryDisplayPropertyType=&secondaryDisplayPropertyType=&oldDisplayPropertyType=&oldPrimaryDisplayPropertyType=&letType=&letFurnishType=&houseFlatShare=",
19 "https://www.rightmove.co.uk/new-homes-for-sale/find.html?searchType=SALE&locationIdentifier=REGION%5E87490&insId=1&radius=0.0&minPrice=&maxPrice=&minBedrooms=&maxBedrooms=&displayPropertyType=&maxDaysSinceAdded=&_includeSSTC=on&sortByPriceDescending=&primaryDisplayPropertyType=&secondaryDisplayPropertyType=&oldDisplayPropertyType=&oldPrimaryDisplayPropertyType=&newHome=true&auction=false",
20 "https://www.rightmove.co.uk/property-for-sale/find.html?locationIdentifier=REGION%5E87490&index=48&propertyTypes=&includeSSTC=false&mustHave=&dontShow=&furnishTypes=&keywords=",
21 "https://www.rightmove.co.uk/property-to-rent/find.html?locationIdentifier=REGION%5E87490&index=960&propertyTypes=&includeLetAgreed=false&mustHave=&dontShow=&furnishTypes=&keywords="
22 ],
23 "maxItems": 20,
24 "endPage": 1,
25 "extendOutputFunction": ($) => { return {} },
26 "customMapFunction": (object) => { return {...object} },
27 "proxy": {
28 "useApifyProxy": true
29 }
30};
31
32
33const run = await client.actor("epctex/rightmove-scraper").call(input);
34
35
36console.log('Results from dataset');
37console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
38const { items } = await client.dataset(run.defaultDatasetId).listItems();
39items.forEach((item) => {
40 console.dir(item);
41});
42
43