1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "search": "Los Angeles",
12 "type": "all",
13 "maxItems": 200,
14 "maxLevel": 1,
15 "proxyConfiguration": {
16 "useApifyProxy": true
17 },
18 "maxRetries": 6,
19 "handlePageTimeoutSecs": 3600,
20 "extendOutputFunction": async ({ data, item, customData, Apify }) => {
21 return item;
22 },
23 "extendScraperFunction": async ({ label, page, request, customData, Apify }) => {
24 if (label === 'SETUP') {
25
26 } else if (label === 'GOTO') {
27
28 } else if (label === 'HANDLE') {
29
30 } else if (label === 'FINISH') {
31
32 }
33 },
34 "customData": {}
35};
36
37
38const run = await client.actor("petr_cermak/zillow-api-scraper").call(input);
39
40
41console.log('Results from dataset');
42console.log(`πΎ Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
43const { items } = await client.dataset(run.defaultDatasetId).listItems();
44items.forEach((item) => {
45 console.dir(item);
46});
47
48