1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "advertisers": [
12 {
13 "name": "HubSpot",
14 "domain": "hubspot.com",
15 "googleAdvertiserId": "AR10072600183532683265",
16 "linkedinUrl": "https://www.linkedin.com/company/hubspot"
17 },
18 {
19 "name": "monday.com",
20 "domain": "monday.com",
21 "googleAdvertiserId": "AR15972262369074085889",
22 "linkedinUrl": "https://www.linkedin.com/company/mondaydotcom"
23 }
24 ],
25 "platforms": [
26 "google"
27 ],
28 "googleRegion": "anywhere",
29 "linkedinCountries": [],
30 "tiktokQueries": [
31 {
32 "keyword": "fitness app",
33 "region": "SA",
34 "period": 30
35 },
36 {
37 "keyword": "fitness app",
38 "region": "US",
39 "period": 30
40 }
41 ],
42 "maxAdsPerAdvertiser": 20,
43 "trackingId": "competitor-ads",
44 "proxyConfiguration": {
45 "useApifyProxy": true
46 }
47};
48
49
50const run = await client.actor("almoutasem_nabil/ad-library-intelligence").call(input);
51
52
53console.log('Results from dataset');
54console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
55const { items } = await client.dataset(run.defaultDatasetId).listItems();
56items.forEach((item) => {
57 console.dir(item);
58});
59
60