1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "maxItems": 10,
12 "commodities": [
13 "gold",
14 "crude-oil",
15 "silver",
16 "copper",
17 "natural-gas",
18 "platinum",
19 "coffee",
20 "cocoa",
21 "sugar",
22 "cotton",
23 "wheat",
24 "corn",
25 "soybeans",
26 "rice",
27 "palm-oil",
28 "rubber",
29 "tin",
30 "zinc",
31 "nickel",
32 "lead",
33 "aluminum",
34 "iron-ore",
35 "uranium",
36 "coal",
37 "lumber",
38 "orange-juice",
39 "cattle",
40 "lean-hogs",
41 "rapeseed-oil",
42 "tea",
43 "barley",
44 "oats",
45 "sorghum",
46 "jute",
47 "wool",
48 "fish",
49 "chicken",
50 "pork",
51 "salmon",
52 "shrimp",
53 "butter",
54 "milk",
55 "cheese",
56 "gasoline",
57 "heating-oil",
58 "propane",
59 "diesel",
60 "bitumen",
61 "asphalt",
62 "methane"
63 ]
64};
65
66
67const run = await client.actor("parseforge/indexmundi-scraper").call(input);
68
69
70console.log('Results from dataset');
71console.log(`๐พ Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
72const { items } = await client.dataset(run.defaultDatasetId).listItems();
73items.forEach((item) => {
74 console.dir(item);
75});
76
77