1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "operation": "search",
12 "store": "2000",
13 "queries": [
14 "tim tam"
15 ],
16 "categories": [
17 "dairy-eggs-fridge/milk"
18 ],
19 "product_ids": [
20 "8150288"
21 ],
22 "special_offer": "any",
23 "monitor_mode": "off",
24 "watchlist_name": "default",
25 "track": [
26 "price",
27 "availability",
28 "promotion",
29 "unit_price"
30 ],
31 "only_changed": false,
32 "baseline": [],
33 "with_details": false,
34 "max_results": 100,
35 "max_pages": 20,
36 "retries": 3
37};
38
39
40const run = await client.actor("s-r/coles-scraper").call(input);
41
42
43console.log('Results from dataset');
44console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
45const { items } = await client.dataset(run.defaultDatasetId).listItems();
46items.forEach((item) => {
47 console.dir(item);
48});
49
50