1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "profiles": [
12 {
13 "name": "Your Company",
14 "posts": [
15 {
16 "text": "We just launched our new AI product!",
17 "numLikes": 100,
18 "numComments": 20,
19 "numShares": 5,
20 "postedAt": "2026-04-01T09:00:00Z",
21 "type": "text",
22 "hashtags": [
23 "#ai"
24 ]
25 }
26 ]
27 },
28 {
29 "name": "Competitor A",
30 "posts": [
31 {
32 "text": "Excited to share our latest update.",
33 "numLikes": 200,
34 "numComments": 40,
35 "numShares": 10,
36 "postedAt": "2026-04-01T10:00:00Z",
37 "type": "video",
38 "hashtags": [
39 "#ai",
40 "#growth"
41 ]
42 }
43 ]
44 }
45 ]
46};
47
48
49const run = await client.actor("george.the.developer/linkedin-competitor-intel").call(input);
50
51
52console.log('Results from dataset');
53console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
54const { items } = await client.dataset(run.defaultDatasetId).listItems();
55items.forEach((item) => {
56 console.dir(item);
57});
58
59