1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "assets": [
12 {
13 "lat": 43.0125,
14 "lon": -83.6875,
15 "label": "Flint MI - lead action level exceedance"
16 },
17 {
18 "lat": 40.9793,
19 "lon": -74.1165,
20 "label": "Ridgewood NJ - PFAS detections"
21 },
22 {
23 "lat": 39.7392,
24 "lon": -104.9903,
25 "label": "Denver CO - control"
26 }
27 ],
28 "pwsids": [],
29 "includeViolations": true,
30 "includeLead": true,
31 "includePfas": true,
32 "includeEnforcement": true,
33 "violationYears": 10,
34 "maxViolationDetails": 25,
35 "maxAssets": 250,
36 "runBudgetSeconds": 900,
37 "refreshPfasCache": false,
38 "simulateOutage": "none"
39};
40
41
42const run = await client.actor("malonestar/epa-drinking-water-quality-screener").call(input);
43
44
45console.log('Results from dataset');
46console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
47const { items } = await client.dataset(run.defaultDatasetId).listItems();
48items.forEach((item) => {
49 console.dir(item);
50});
51
52