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 "daysListed": [
24 "1",
25 "7"
26 ],
27 "filterKeywords": [
28 "iphone",
29 "i-phone",
30 "ps5",
31 "playstation 5"
32 ],
33 "listingsPerSearch": 5,
34 "proxyConfiguration": {
35 "useApifyProxy": true,
36 "apifyProxyGroups": [
37 "RESIDENTIAL"
38 ],
39 "apifyProxyCountry": "CA"
40 },
41 "latitude": "43.653225",
42 "longitude": "-79.383186"
43};
44
45
46const run = await client.actor("futurafree/facebook-marketplace-scraper-discord-alerts").call(input);
47
48
49console.log('Results from dataset');
50console.log(`πΎ Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
51const { items } = await client.dataset(run.defaultDatasetId).listItems();
52items.forEach((item) => {
53 console.dir(item);
54});
55
56