1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "watchlists": [
12 {
13 "name": "Our Brand",
14 "type": "brand",
15 "keywords": [
16 "our-product-name"
17 ],
18 "handles": [
19 "our-threads-handle"
20 ],
21 "hashtags": []
22 },
23 {
24 "name": "Competitors",
25 "type": "competitor",
26 "handles": [
27 "competitor-handle"
28 ],
29 "keywords": [],
30 "hashtags": []
31 }
32 ],
33 "proxyConfiguration": {
34 "useApifyProxy": true,
35 "apifyProxyGroups": [
36 "RESIDENTIAL"
37 ]
38 }
39};
40
41
42const run = await client.actor("digitalnomadph/threads-brand-monitor").call(input);
43
44
45console.log('Results from dataset');
46console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
47const { items } = await client.dataset(run.defaultDatasetId).listItems();
48items.forEach((item) => {
49 console.dir(item);
50});
51
52