1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "startUrls": [
12 {
13 "url": "https://www.tiktok.com/@nasa"
14 },
15 {
16 "url": "https://www.tiktok.com/@khaby.lame"
17 },
18 {
19 "url": "https://www.tiktok.com/@zachking"
20 },
21 {
22 "url": "https://www.tiktok.com/@natgeo"
23 },
24 {
25 "url": "https://www.tiktok.com/@mrbeast"
26 }
27 ],
28 "searchQueries": [
29 "charlidamelio",
30 "@bellapoarch",
31 "willsmith",
32 "therock",
33 "selenagomez"
34 ]
35};
36
37
38const run = await client.actor("aboo.script/tiktok-profiles-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