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",
14 "vintage levis 501",
15 "patagonia fleece"
16 ],
17 "searchMaxResults": 10,
18 "searchCategoryId": "",
19 "searchSort": "date",
20 "searchDepartmentCode": "",
21 "searchOwnerType": "",
22 "searchFetchFullDetails": false,
23 "enableListingDetails": false,
24 "listingIds": [],
25 "listingUrls": [],
26 "enableStoreInventory": false,
27 "storeUrls": [],
28 "storeMaxListings": 30,
29 "enableSellerProfile": false,
30 "enableScrapeByUrl": false,
31 "scrapeUrls": [
32 "https://www.leboncoin.fr/recherche?text=carhartt"
33 ],
34 "enablePriceHistory": false,
35 "watchlist": [],
36 "watchlistIds": [],
37 "webhookFormat": "json",
38 "proxyConfiguration": {
39 "useApifyProxy": true,
40 "apifyProxyGroups": [
41 "RESIDENTIAL"
42 ],
43 "apifyProxyCountry": "US"
44 }
45};
46
47
48const run = await client.actor("b2b_leads/leboncoin-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