1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "portal": "ZAP",
12 "business": [
13 "SALE"
14 ],
15 "listingType": [
16 "USED"
17 ],
18 "usageTypes": [
19 "RESIDENTIAL"
20 ],
21 "states": [
22 "SP"
23 ],
24 "cities": [
25 "sao-paulo"
26 ],
27 "maxListings": 100,
28 "maxPagesPerTask": 10,
29 "pageSize": 30,
30 "requestDelayMs": 500,
31 "maxConcurrency": 2,
32 "maxRetries": 3,
33 "proxyConfiguration": {
34 "useApifyProxy": true,
35 "apifyProxyGroups": [
36 "RESIDENTIAL"
37 ],
38 "apifyProxyCountry": "BR"
39 }
40};
41
42
43const run = await client.actor("parsebird/zap-imoveis-scraper").call(input);
44
45
46console.log('Results from dataset');
47console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
48const { items } = await client.dataset(run.defaultDatasetId).listItems();
49items.forEach((item) => {
50 console.dir(item);
51});
52
53