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 "rational method, 10 ha, 60% pavement, 40% lawn, 10-year storm, flow length 300 m, slope 2%, 100 mm/h",
13 "1 mi2 watershed, 5 in of rain, CN 80, Tc 1 hr",
14 "trapezoidal channel b 3 m, side slopes 2:1, n 0.025, slope 0.1%, Q 10 m3/s",
15 "size a concrete storm pipe at 0.5% for 25 cfs",
16 "36 in concrete culvert, square edge headwall, 100 ft long, slope 1%, 60 cfs",
17 "90° v-notch weir, Q 50 l/s",
18 {
19 "type": "culvert",
20 "shape": "box",
21 "span": "2 m",
22 "rise": "1.5 m",
23 "length": "30 m",
24 "slope": "0.5%",
25 "q": "8 m3/s",
26 "inlet": "box wingwall 30-75",
27 "tw": "1 m"
28 }
29 ]
30};
31
32
33const run = await client.actor("jumblemog/stormwater-calculator").call(input);
34
35
36console.log('Results from dataset');
37console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
38const { items } = await client.dataset(run.defaultDatasetId).listItems();
39items.forEach((item) => {
40 console.dir(item);
41});
42
43