Extract YouTube Comments to Google Sheets
Manually triggers on a list of YouTube URLs to fetch all comments via the API and append them to a Google Sheet.
What it does
You can automatically collect comments from your specified YouTube videos and save them directly into a Google Sheet without manual copying. This workflow reads ready video URLs, fetches the comment data via the API, updates their status to finished, and appends everything to your designated tab for easy analysis.
Step by step
- Configure an n8n manual trigger node to initiate the workflow execution.
- Set up a Google Sheets read node to query rows where the status column equals 'Ready'.
- Construct an HTTP request node targeting the YouTube Data API v3 comments endpoint with the video ID parameter.
- Add a Google Sheets update node to change the status of processed URLs from 'Ready' to 'Finished'.
Where the LLM does the work
- Generate the specific JavaScript code for the n8n Code node to parse the nested JSON structure of YouTube API comment replies and format them into flat rows.
- Draft error handling logic that distinguishes between quota exceeded errors and invalid video ID responses to ensure robust retry mechanisms.
- Create a mapping strategy for normalizing inconsistent data types from the API, such as converting timestamps or author metadata into sheet-friendly formats.
Watch out for
Tools that fit
The agent brief
You are helping me build the following AI agent workflow. ## Goal Extract YouTube Comments to Google Sheets: Manually triggers on a list of YouTube URLs to fetch all comments via the API and append them to a Google Sheet. ## Specification - What it does: You can automatically collect comments from your specified YouTube videos and save them directly into a Google Sheet without manual copying. This workflow reads ready video URLs, fetches the comment data via the API, updates their status to finished, and appends everything to your designated tab for easy analysis. - Trigger: Run manually (Manual ยท on demand) - Autonomy: Fully hands-off - Expected setup effort: about an afternoon - Tools/services involved: - n8n: workflow orchestration - Google Sheets: storing video URLs and comment results - HTTP Request: fetching data from YouTube API ## Known pitfalls, handle each one explicitly in your implementation 1. YouTube API quotas deplete quickly with high-volume requests so implement strict throttling and batch processing to avoid hitting daily limits. 2. The API returns paginated results which means you must loop through all pages for each video or you will miss older comments in the dataset. 3. Google Sheets write operations can fail if row limits are reached or columns are misaligned so add validation logic to ensure data fits the target sheet schema. ## Reference implementation https://n8n.io/workflows/5690 (workflow template) Fetch and inspect this before building. If it matches my stack, adapt it; if not, rebuild the pattern with my tools. ## Process requirements 1. Before building: ask me which of the listed tools I actually use and what my platform is (n8n / Make / code / other). Do not assume. 2. Adapt the pattern to my answers; do not force the reference stack. 3. Address every pitfall above; tell me how you handled each. 4. Provide a test plan I can run before letting this touch real data. 5. Ask before any step that sends messages, modifies data, or spends money. Source: https://usecasesforagents.com/use-case/extract-youtube-comments-to-google-sheets/ via usecasesforagents.com
Frequently asked questions
Can I use a different Automation Platform than n8n?
Yes. n8n is only the example automation platform in this recipe. The same flow works with Home Assistant. Swap the automation platform connection and keep the rest of the setup as written.
Want this running in your business?
Who it's for
Built for marketers who'd rather brief an agent than start from a blank doc.
Analysts get a ready-made pattern for turning raw numbers into a report someone will actually read.