1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "feeds": [
12 {
13 "url": "https://cointelegraph.com/rss",
14 "name": "Cointelegraph",
15 "category": "news"
16 },
17 {
18 "url": "https://www.coindesk.com/arc/outboundfeeds/rss/",
19 "name": "CoinDesk",
20 "category": "news"
21 },
22 {
23 "url": "https://decrypt.co/feed",
24 "name": "Decrypt",
25 "category": "news"
26 },
27 {
28 "url": "https://cryptonews.com/news/feed/",
29 "name": "CryptoNews",
30 "category": "news"
31 }
32 ],
33 "includeKeywords": [
34 "Bitcoin",
35 "Ethereum",
36 "BTC",
37 "ETH",
38 "DeFi",
39 "NFT"
40 ],
41 "excludeKeywords": [
42 "sponsored",
43 "advertisement"
44 ]
45};
46
47
48const run = await client.actor("code-node-tools/crypto-news-aggregator").call(input);
49
50
51console.log('Results from dataset');
52console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
53const { items } = await client.dataset(run.defaultDatasetId).listItems();
54items.forEach((item) => {
55 console.dir(item);
56});
57
58