1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "keywords": ["cooking recipes"],
10 "contentType": "all",
11 "sortBy": "relevance",
12 "uploadDate": "all",
13 "videoDuration": "all",
14 "includeVideoStats": False,
15 "detectLanguage": False,
16 "includeChannelAnalytics": False,
17 "outputTitle": True,
18 "outputVideoId": True,
19 "outputVideoUrl": True,
20 "outputChannelName": True,
21 "outputChannelId": True,
22 "outputChannelUrl": True,
23 "outputIsVerified": True,
24 "outputThumbnailUrl": True,
25 "outputViewCount": True,
26 "outputViewCountText": True,
27 "outputPublishedText": True,
28 "outputDuration": True,
29 "outputDurationSeconds": True,
30 "outputContentType": True,
31 "outputKeyword": True,
32 "outputScrapedAt": True,
33 "concurrency": 3,
34 "proxyConfig": {
35 "useApifyProxy": True,
36 "apifyProxyGroups": [],
37 },
38}
39
40
41run = client.actor("lurkapi/youtube-keyword-search-scraper").call(run_input=run_input)
42
43
44print("πΎ Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
45for item in client.dataset(run["defaultDatasetId"]).iterate_items():
46 print(item)
47
48