1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "watches": [
12 {
13 "type": "organization",
14 "names": [
15 "Federal Reserve"
16 ],
17 "label": "Federal Reserve"
18 },
19 {
20 "type": "keyword",
21 "phrases": [
22 "inflation"
23 ],
24 "label": "Inflation"
25 },
26 {
27 "type": "keyword",
28 "phrases": [
29 "OpenAI",
30 "Nvidia"
31 ],
32 "label": "OpenAI or Nvidia"
33 }
34 ],
35 "lookbackHours": 2,
36 "maxPerWatch": 10
37};
38
39
40const run = await client.actor("lone_rachis/news-mentions-watch").call(input);
41
42
43console.log('Results from dataset');
44console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
45const { items } = await client.dataset(run.defaultDatasetId).listItems();
46items.forEach((item) => {
47 console.dir(item);
48});
49
50