1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "mode": "search",
12 "keywords": [
13 "CEO"
14 ],
15 "language": "en",
16 "urls": [
17 {
18 "url": "https://shortdrama.tiktok.com/"
19 },
20 {
21 "url": "https://shortdrama.tiktok.com/gb"
22 },
23 {
24 "url": "https://shortdrama.tiktok.com/sitemap.xml"
25 }
26 ],
27 "fetchDetails": true,
28 "maxItems": 20,
29 "proxy": {
30 "useApifyProxy": true,
31 "apifyProxyGroups": [
32 "RESIDENTIAL"
33 ]
34 }
35};
36
37
38const run = await client.actor("abotapi/pinedrama-scraper").call(input);
39
40
41console.log('Results from dataset');
42console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
43const { items } = await client.dataset(run.defaultDatasetId).listItems();
44items.forEach((item) => {
45 console.dir(item);
46});
47
48