1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "hashtags": [
12 "cooking"
13 ],
14 "contentType": "all",
15 "includeVideoStats": false,
16 "detectLanguage": false,
17 "includeChannelAnalytics": false,
18 "outputHashtag": true,
19 "outputVideoId": true,
20 "outputVideoUrl": true,
21 "outputTitle": true,
22 "outputChannelName": true,
23 "outputChannelId": true,
24 "outputChannelUrl": true,
25 "outputIsVerified": true,
26 "outputThumbnailUrl": true,
27 "outputViewCount": true,
28 "outputViewCountText": true,
29 "outputPublishedText": true,
30 "outputDuration": true,
31 "outputDurationSeconds": true,
32 "outputContentType": true,
33 "outputScrapedAt": true,
34 "concurrency": 3,
35 "proxyConfig": {
36 "useApifyProxy": true,
37 "apifyProxyGroups": []
38 }
39};
40
41
42const run = await client.actor("lurkapi/youtube-hashtag-scraper").call(input);
43
44
45console.log('Results from dataset');
46console.log(`πΎ Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
47const { items } = await client.dataset(run.defaultDatasetId).listItems();
48items.forEach((item) => {
49 console.dir(item);
50});
51
52