1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "kwEnable": true,
12 "accountKeywords": [
13 "cooking"
14 ],
15 "accountsPerKeyword": 15,
16 "kwIncludeRecentVideos": true,
17 "kwRecentVideosMax": 12,
18 "kwVideoEngagement": true,
19 "kwVideoAccountDetails": false,
20 "kwVideoMinPlays": 0,
21 "kwVideoPublishedWithin": "any",
22 "urlEnable": false,
23 "accountUsernames": [],
24 "accountUrls": [],
25 "urlIncludeRecentVideos": true,
26 "urlRecentVideosMax": 12,
27 "urlVideoEngagement": true,
28 "urlVideoAccountDetails": false,
29 "urlVideoMinPlays": 0,
30 "urlVideoPublishedWithin": "any",
31 "webhookFormat": "json",
32 "includeRaw": false
33};
34
35
36const run = await client.actor("b2b_leads/tiktok-creator-search-scraper").call(input);
37
38
39console.log('Results from dataset');
40console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
41const { items } = await client.dataset(run.defaultDatasetId).listItems();
42items.forEach((item) => {
43 console.dir(item);
44});
45
46