1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "enableListingSearch": true,
12 "searchKeywords": [
13 "carhartt detroit jacke",
14 "vintage levis 501",
15 "patagonia fleece"
16 ],
17 "searchMaxResults": 10,
18 "searchSort": "relevance",
19 "searchCondition": "",
20 "searchLeadDetails": false,
21 "searchFetchFullDetails": false,
22 "enableListingDetails": false,
23 "listingIds": [],
24 "listingUrls": [],
25 "enableClosetListings": false,
26 "sellerIds": [
27 "33915083"
28 ],
29 "sellerMaxListings": 30,
30 "enableSellerProfile": false,
31 "enableSoldHistory": false,
32 "soldMaxItems": 30,
33 "enableScrapeByUrl": false,
34 "scrapeUrls": [
35 "https://www.kleinanzeigen.de/s-suchanfrage.html?keywords=carhartt+jacke&sortBy=creationTime"
36 ],
37 "webhookFormat": "json",
38 "proxyConfiguration": {
39 "useApifyProxy": true,
40 "apifyProxyGroups": [
41 "RESIDENTIAL"
42 ],
43 "apifyProxyCountry": "DE"
44 }
45};
46
47
48const run = await client.actor("b2b_leads/kleinanzeigen-real-time-data-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