1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "symbols": [
12 "AAPL",
13 "MSFT"
14 ],
15 "tickers": [],
16 "mode": "quote",
17 "feeds": [
18 "topNews",
19 "finance",
20 "earnings",
21 "economy",
22 "business",
23 "technology",
24 "politics",
25 "energy",
26 "realEstate",
27 "autos",
28 "smallBusiness",
29 "travel",
30 "life"
31 ],
32 "articlesPerFeed": 15,
33 "onlyNew": false,
34 "fullText": true,
35 "maxItems": 0
36};
37
38
39const run = await client.actor("publicmoney/cnbc-scraper").call(input);
40
41
42console.log('Results from dataset');
43console.log(`πΎ Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
44const { items } = await client.dataset(run.defaultDatasetId).listItems();
45items.forEach((item) => {
46 console.dir(item);
47});
48
49