A video can answer one question and create many more. Those follow-up questions can help you plan a FAQ, a follow-up tutorial, or a research brief for a client.
This tutorial collects comments from a public YouTube video and exports those containing a question mark. The filter gives you a shortlist for human review. It can miss questions without a question mark and include rhetorical questions or spam.
The collection step uses YouTube Scraper on Apify, which I built. It is a paid Actor. The first 100 comments and replies are included in the video event price.
1. Collect comments from one public video
Open the Actor and paste the input below in its JSON editor. This uses the public video Web Scraping with Python - Beautiful Soup Crash Course. In Run options, set Maximum cost per run to $0.01 before starting.
{
"startUrls": ["https://www.youtube.com/watch?v=XVv6mJpFOb0"],
"searchQueries": [],
"maxVideos": 1,
"mode": "complete",
"includeComments": true,
"maxComments": 100,
"maxRepliesPerComment": 0
}
Once the Actor finishes, export the dataset as JSON and save it as youtube.json in the same folder as the script below. Comments are nested in each video's comments array. For this example, replies are turned off.
At the listed Free-tier rate on 11 November 2026, a returned video costs $0.00035. Check the Actor's Pricing tab for your own tier and current rates. If the video has no accessible comments, the output file may contain just the column headers.
2. Extract the questions
Save the following as questions.py and run it using Python 3. It uses the standard library.
import csv
import json
import sys
with open(sys.argv[1], encoding="utf-8") as source:
videos = json.load(source)
questions = []
seen = set()
for video in videos:
for comment in video.get("comments") or []:
text = comment.get("text")
if not isinstance(text, str) or "?" not in text:
continue
comment_id = comment.get("id")
if comment_id and comment_id in seen:
continue
if comment_id:
seen.add(comment_id)
questions.append({
"video_title": video.get("title") or "",
"video_url": video.get("url") or "",
"comment_text": text,
"comment_url": comment.get("commentUrl") or "",
})
def spreadsheet_safe(value):
value = str(value)
if value.lstrip().startswith(("=", "+", "-", "@")) or value.startswith(("\t", "\r", "\n")):
return "'" + value
return value
with open("questions.csv", "w", newline="", encoding="utf-8") as output:
fields = ["video_title", "video_url", "comment_text", "comment_url"]
writer = csv.DictWriter(output, fieldnames=fields)
writer.writeheader()
for question in questions:
writer.writerow({key: spreadsheet_safe(value) for key, value in question.items()})
print(f"Saved {len(questions)} comments containing a question mark.")
Run the script with:
python questions.py youtube.json
Open questions.csv to review the comment text and original source link when available. The export omits author names and prefixes spreadsheet formulas with an apostrophe.
3. Turn the questions into a short brief
Imagine the export contains these fictional comments:
- How do I handle pagination?
- How can I scrape page two?
- Does this work on mobile?
Group the first two under pagination and the third under mobile. A short brief could recommend a follow-up tutorial on pagination, with links to the source comments so a reviewer can check the context. In my test on 11 November 2026, the Actor returned 100 comments from the example video. The script found four comments containing a question mark, each with a source link. Counts describe only the collected sample.
This article was drafted with AI assistance. The three comments above are fictional.
Top comments (0)