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 "searchTasks": [
13 {
14 "keyword": "carhartt detroit jacket",
15 "location": "Toronto (GTA)"
16 },
17 {
18 "keyword": "vintage 90s levis 501",
19 "location": "Vancouver"
20 },
21 {
22 "keyword": "nike jordan",
23 "category": "men's shoes"
24 }
25 ],
26 "searchMaxResults": 10,
27 "searchCategories": [],
28 "searchLocations": [],
29 "searchSort": "relevance",
30 "searchPriceType": "",
31 "searchFetchFullDetails": false,
32 "newlyListedOnly": false,
33 "searchMaxAgeDays": 7,
34 "searchKeywords": [],
35 "enableListingDetails": false,
36 "listingIds": [],
37 "listingUrls": [],
38 "enableClosetListings": false,
39 "sellerUsernames": [
40 "1015260943"
41 ],
42 "sellerMaxListings": 30,
43 "enableSellerProfile": false,
44 "enableSoldHistory": false,
45 "soldMaxItems": 30,
46 "enableScrapeByUrl": false,
47 "scrapeUrls": [
48 "https://www.kijiji.ca/b-buy-sell/canada/vintage+carhartt/k0c10l0"
49 ],
50 "webhookFormat": "json",
51 "proxyConfiguration": {
52 "useApifyProxy": true,
53 "apifyProxyGroups": [
54 "RESIDENTIAL"
55 ],
56 "apifyProxyCountry": "CA"
57 }
58};
59
60
61const run = await client.actor("b2b_leads/kijiji-real-time-data-scraper").call(input);
62
63
64console.log('Results from dataset');
65console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
66const { items } = await client.dataset(run.defaultDatasetId).listItems();
67items.forEach((item) => {
68 console.dir(item);
69});
70
71