1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "profile": "custom",
12 "systemMode": false,
13 "eventType": "ALL",
14 "alertLevel": "ALL",
15 "countryFilter": [],
16 "maxResults": 50,
17 "dataSource": "auto",
18 "replayMode": false,
19 "escalationOnly": false,
20 "newlyActiveOnly": false,
21 "unresolvedOnly": false,
22 "explainabilityLevel": "compact",
23 "priorityQueueSize": 10,
24 "includeHazardInsights": true,
25 "includeGeoContext": true,
26 "includeIncidentBlock": true,
27 "includeCorrelationSignals": true,
28 "includeGeographicClusters": true
29};
30
31
32const run = await client.actor("ryanclinton/gdacs-disaster-alerts").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