1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "startUrls": [
12 {
13 "url": "https://www.costco.com/kirkland-signature-paper-towels%2c-2-ply%2c-160-sheets%2c-12-individually-wrapped-rolls.product.100234271.html"
14 },
15 {
16 "url": "https://www.costco.com/p/-/kirkland-signature-organic-extra-virgin-olive-oil-2-l/100334841"
17 },
18 {
19 "url": "https://www.costco.com/kirkland-signature-100%25-colombian-coffee%2c-dark-roast%2c-1.75-oz%2c-42-count.product.100216589.html"
20 }
21 ],
22 "maxItems": 25,
23 "maxItemsPerStartUrl": 25,
24 "maxSearchPagesPerStartUrl": 2,
25 "proxyConfiguration": {
26 "useApifyProxy": true,
27 "apifyProxyGroups": [
28 "RESIDENTIAL"
29 ],
30 "apifyProxyCountry": "US"
31 }
32};
33
34
35const run = await client.actor("cirkit/costco-product-scraper").call(input);
36
37
38console.log('Results from dataset');
39console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
40const { items } = await client.dataset(run.defaultDatasetId).listItems();
41items.forEach((item) => {
42 console.dir(item);
43});
44
45