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 "locations": [
13 "gb"
14 ],
15 "searchTerms": [
16 "desk"
17 ],
18 "sortBy": "relevance",
19 "urls": [
20 "https://www.onbuy.com/gb/search/?query=desk",
21 "https://www.onbuy.com/gb/desks~c2485/",
22 "https://www.onbuy.com/gb/office-furniture-and-accessories/office-desks~g25678/",
23 "https://www.onbuy.com/gb/brands/lego/",
24 "https://www.onbuy.com/gb/p/computer-desk-home-office-desk-with-monitor-stand-and-storage-shelves~p104367747/?sr=desk",
25 "https://www.onbuy.com/gb/shop/yukiyi/",
26 "https://www.onbuy.com/de/search/?query=desk",
27 "https://www.onbuy.com/gb/",
28 "https://www.onbuy.com/"
29 ],
30 "fetchDetails": true,
31 "maxItems": 20,
32 "proxyConfiguration": {
33 "useApifyProxy": true,
34 "apifyProxyGroups": [
35 "RESIDENTIAL"
36 ]
37 },
38 "incrementalMode": false,
39 "emitUnchanged": false,
40 "emitExpired": false,
41 "ignoreFieldsForChanges": [],
42 "maxNotifyListings": 50
43};
44
45
46const run = await client.actor("abotapi/onbuy-marketplace-scraper").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