1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "mode": "search",
12 "queries": [
13 "iphone"
14 ],
15 "barcodes": [],
16 "startUrls": [
17 {
18 "url": "https://allegro.pl/listing?string=iphone"
19 },
20 {
21 "url": "https://allegro.pl/kategoria/smartfony-i-telefony-komorkowe-165"
22 },
23 {
24 "url": "https://allegro.pl/uzytkownik/smartSPOT"
25 }
26 ],
27 "keywords": [],
28 "fetchDetails": false,
29 "proxy": {
30 "useApifyProxy": true,
31 "apifyProxyGroups": [
32 "RESIDENTIAL"
33 ],
34 "apifyProxyCountry": "PL"
35 },
36 "incrementalMode": false,
37 "emitUnchanged": false,
38 "emitExpired": false,
39 "ignoreFieldsForChanges": []
40};
41
42
43const run = await client.actor("abotapi/allegro-pl-scraper").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