1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "searchTerms": [
12 "iPhone",
13 "PS5"
14 ],
15 "minPrices": [
16 "50",
17 "100"
18 ],
19 "maxPrices": [
20 "2000",
21 "1000"
22 ],
23 "filterKeywords": [
24 "iphone",
25 "i-phone",
26 "ps5",
27 "playstation 5"
28 ],
29 "listingsPerSearch": 5,
30 "proxyConfiguration": {
31 "useApifyProxy": true,
32 "apifyProxyGroups": [
33 "RESIDENTIAL"
34 ],
35 "apifyProxyCountry": "CA"
36 },
37 "latitude": "43.653225",
38 "longitude": "-79.383186",
39 "radiusKm": 30
40};
41
42
43const run = await client.actor("futurafree/kijiji-scraper-discord-alerts").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