1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "mode": "library",
12 "keyword": "Nike",
13 "adIds": [],
14 "startUrls": [],
15 "region": "DE",
16 "sortBy": "last_shown_date,desc",
17 "adType": "all",
18 "adStatus": "active",
19 "age": [],
20 "gender": "all",
21 "uniqueReach": "all",
22 "exactPhrase": false,
23 "includeDetails": false,
24 "countOnly": false,
25 "maxItems": 3,
26 "ccCountry": "US",
27 "ccPeriod": "30",
28 "ccOrderBy": "for_you",
29 "ccObjective": "all",
30 "ccIndustry": "all",
31 "ccLanguage": "all",
32 "ccSweep": false,
33 "ccIncludeDetails": false
34};
35
36
37const run = await client.actor("vexaloom-labs/tiktok-dsa-ads-transparency-library-scraper").call(input);
38
39
40console.log('Results from dataset');
41console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
42const { items } = await client.dataset(run.defaultDatasetId).listItems();
43items.forEach((item) => {
44 console.dir(item);
45});
46
47