1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "locations": [
12 {
13 "state": "berlin",
14 "city": "Berlin"
15 }
16 ],
17 "urls": [
18 "https://www.immobilienscout24.de/Suche/de/berlin/berlin/wohnung-kaufen?price=-600000.0"
19 ],
20 "maxPages": 2,
21 "maxListings": 40,
22 "requestDelay": 300,
23 "maxRetries": 4,
24 "proxy": {
25 "useApifyProxy": true,
26 "apifyProxyGroups": [
27 "RESIDENTIAL"
28 ],
29 "apifyProxyCountry": "DE"
30 }
31};
32
33
34const run = await client.actor("parsebird/immoscout24-scraper").call(input);
35
36
37console.log('Results from dataset');
38console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
39const { items } = await client.dataset(run.defaultDatasetId).listItems();
40items.forEach((item) => {
41 console.dir(item);
42});
43
44