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 },
22 {
23 "name": "Competitors",
24 "type": "competitor",
25 "handles": [
26 "competitor-handle"
27 ],
28 "keywords": []
29 }
30 ],
31 "proxyConfiguration": {
32 "useApifyProxy": true,
33 "apifyProxyGroups": [
34 "RESIDENTIAL"
35 ]
36 }
37};
38
39
40const run = await client.actor("digitalnomadph/threads-brand-monitor").call(input);
41
42
43console.log('Results from dataset');
44console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
45const { items } = await client.dataset(run.defaultDatasetId).listItems();
46items.forEach((item) => {
47 console.dir(item);
48});
49
50