1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "mode": "HYBRID",
12 "subreddits": [
13 "technology",
14 "gaming",
15 "personalfinance"
16 ],
17 "seedTopics": [
18 "AI agents"
19 ],
20 "timeWindow": "7_DAYS",
21 "postsPerSource": 100,
22 "sortSources": [
23 "HOT",
24 "RISING"
25 ],
26 "minimumPostsPerTopic": 3,
27 "minimumAuthorsPerTopic": 2,
28 "minimumSubredditsPerTopic": 1,
29 "minimumTrendTier": "ACTIVE",
30 "maxTopics": 25,
31 "maxEvidencePosts": 5,
32 "proxyConfiguration": {
33 "useApifyProxy": true
34 }
35};
36
37
38const run = await client.actor("coregent/reddit-trending-topics-finder").call(input);
39
40
41console.log('Results from dataset');
42console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
43const { items } = await client.dataset(run.defaultDatasetId).listItems();
44items.forEach((item) => {
45 console.dir(item);
46});
47
48