1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "requests": [
12 "how many cords in a stack 16 ft long 4 ft high of 16 inch logs",
13 "is $120 for a face cord of red oak a good deal",
14 "how much firewood to heat a 2,000 sq ft house in Maine with a wood stove",
15 "8 ft pickup bed thrown loose, $150 for the load",
16 "3 cords of green pine",
17 "two rows 24 ft long 5 ft high, 18 inch pieces of hickory, $275 a cord, outdoor boiler",
18 {
19 "cords": 2,
20 "species": "sugar maple",
21 "pricePerCord": 325,
22 "squareFeet": 1800,
23 "state": "WI",
24 "prices": {
25 "natural gas": 1
26 }
27 }
28 ]
29};
30
31
32const run = await client.actor("jumblemog/firewood-calculator").call(input);
33
34
35console.log('Results from dataset');
36console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
37const { items } = await client.dataset(run.defaultDatasetId).listItems();
38items.forEach((item) => {
39 console.dir(item);
40});
41
42