Install
openclaw skills install youtube-comments-api-skillThis skill helps users extract structured video list data and comment data from YouTube using the BrowserAct API. The Agent should proactively apply this ski...
openclaw skills install youtube-comments-api-skillThis skill provides a one-stop extraction service for YouTube video and comment data through the BrowserAct YouTube Comments API template. It can extract structured video results along with their respective comments directly from YouTube. By simply providing search keywords, comment limits, and scroll counts, you can acquire clean and ready-to-use video and comment datasets directly.
Before running, you must first check the BROWSERACT_API_KEY environment variable. If it is not set, do not take any other actions; you should request and wait for the user to provide it.
At this point, the Agent must inform the user:
"Since you have not configured the BrowserAct API Key yet, please go to the BrowserAct Console first to get your Key."
When invoking the script, the Agent should flexibly configure the following parameters based on user needs:
keywords
stringAI, automation, web scrapingAIComments_limit
number10, 20, 5010Scroll_count
number1, 2, 5, 102The Agent should execute the following standalone script to achieve "one command, get results":
# Example invocation
python -u ./scripts/youtube_comments_api.py "keywords" "Comments_limit" "Scroll_count"
Since this task involves automated browser operations, it may take a long time (several minutes). While running, the script will continuously output timestamped status logs (e.g., [14:30:05] Task Status: running).
Agent Instructions:
Upon successful execution, the script will directly parse and print the results from the API response. The results include two linked datasets:
Video fields:
video_name: Video title shown in the listvideo_url: Video URLvideo_publication_time: Published timevideo_view_count: View countComment fields:
commenter_name: Comment author display namecommenter_url: Comment author channel URLcomment_text: Comment contentcomment_publish_date: Comment publish timecomment_likes: Like count for the commentreply_count: Number of repliesDuring the execution of the script, if an error occurs (such as network fluctuations or task failure), the Agent should follow this logic:
Check the Output Content:
"Invalid authorization", it means the API Key is invalid or expired. At this time, do not retry; you should guide the user to recheck and provide the correct API Key."Invalid authorization" but the task fails (e.g., the output starts with Error: or returns an empty result), the Agent should automatically try to execute the script one more time.Retry Limit: