1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "zipCodes": [
12 "10014"
13 ],
14 "statuses": [
15 "FOR_SALE"
16 ],
17 "maxResultsPerZipStatus": 25,
18 "maxTotalResults": 100,
19 "includePropertyDetails": false,
20 "maxPropertyDetails": 5,
21 "includeMarketTrends": false,
22 "marketHistoryMonths": 12,
23 "minPrice": 0,
24 "maxPrice": 1000000000,
25 "minBedrooms": 0,
26 "maxBedrooms": 100,
27 "minBathrooms": 0,
28 "maxBathrooms": 100,
29 "minLivingArea": 0,
30 "maxLivingArea": 1000000,
31 "minYearBuilt": 1000,
32 "maxYearBuilt": 2100,
33 "homeTypes": [],
34 "openHousesOnly": false,
35 "showcaseOnly": false,
36 "sortOrder": "DEFAULT",
37 "resultsLimit": 10,
38 "priceMin": 0,
39 "priceMax": 1000000000,
40 "daysOnZillow": "",
41 "forSaleByAgent": true,
42 "forSaleByOwner": false,
43 "forRent": false,
44 "sold": false
45};
46
47
48const run = await client.actor("datascraperes/zillow-zip-code-scraper").call(input);
49
50
51console.log('Results from dataset');
52console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
53const { items } = await client.dataset(run.defaultDatasetId).listItems();
54items.forEach((item) => {
55 console.dir(item);
56});
57
58