1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "searchQuery": "artificial intelligence",
12 "sortBy": "relevance",
13 "datePosted": "",
14 "authorType": "",
15 "contentType": [
16 "articles",
17 "posts",
18 "documents",
19 "videos",
20 "images"
21 ],
22 "language": "en",
23 "maxResults": 25,
24 "fromNetwork": "",
25 "industries": [],
26 "mentions": [],
27 "mentionsCompany": "",
28 "mentionsPerson": "",
29 "minReactions": 0,
30 "excludeReposts": false,
31 "emitNoResultsMarker": true,
32 "talksAbout": []
33};
34
35
36const run = await client.actor("crawlerbros/linkedin-post-search-scraper").call(input);
37
38
39console.log('Results from dataset');
40console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
41const { items } = await client.dataset(run.defaultDatasetId).listItems();
42items.forEach((item) => {
43 console.dir(item);
44});
45
46