Guides

Is It Legal to Scrape YouTube? A Practical Guide

What the law and YouTube’s terms say about collecting public data: transcripts, comments and personal data under GDPR, copyright, and good practice for teams.

By FetchTranscript teamPublished Updated 7 min read

Collecting public YouTube data such as transcripts, titles, view counts and comments is common and, in many situations, lawful, but "public" does not mean "free of rules". Three different bodies of rules apply at once: YouTube's Terms of Service (a contract), laws about computer access, and laws about personal data and copyright. This guide walks through each of them in plain language, with the court cases people cite, and ends with the practices that keep a project on the safe side.

Three separate questions

When people ask "is it legal to scrape YouTube?", they usually mix three questions that have different answers:

  1. Does it break YouTube's terms? That is a contract question between you and YouTube.
  2. Does it break a law on computer access? In the US that is mainly the Computer Fraud and Abuse Act (CFAA); other countries have their own computer misuse laws.
  3. What may you do with the data? Personal data laws (GDPR in the EU and UK) and copyright decide what you can store, analyse and publish.

You can be fine on one and exposed on another. A research team that reads public comments may not violate any access law, yet still has GDPR duties for the usernames it stores.

What YouTube's Terms of Service say

The YouTube Terms of Service restrict accessing the service by automated means such as robots, botnets or scrapers, except in two cases: public search engines in accordance with YouTube's robots.txt file, and with YouTube's prior written permission. The terms also restrict downloading content unless YouTube offers a download feature or link.

Two points matter in practice. First, the terms are a contract: they bind people who accepted them, typically account holders. Whether, and how far, they bind someone who never signed in is a question courts have answered differently depending on the facts. Second, breaking a contract is not a crime. The usual consequences of a terms violation are technical (blocks, rate limits) and, at worst, a civil claim; they are not the same as breaking a criminal law.

The official alternative YouTube offers is the YouTube Data API, which has its own terms, quota and display rules. It is the cleanest route for what it covers, but it does not give the transcripts of other people's videos (see why the Data API can't get transcripts).

Computer access laws: the US cases people cite

hiQ Labs v. LinkedIn. hiQ collected data from public LinkedIn profiles. In 2022 the Ninth Circuit held that scraping data that is publicly available, without logging in, likely does not count as access "without authorization" under the CFAA, following the Supreme Court's narrower reading of the statute in Van Buren v. United States (2021). The dispute did not end there: later rulings went against hiQ on LinkedIn's breach-of-contract claims, partly because hiQ had used logged-in accounts, and the parties settled. The lesson people draw is twofold: public, logged-out data is on firmer ground under the CFAA, while contract claims remain a live risk.

Meta v. Bright Data. In 2024 a federal court in the Northern District of California ruled that Bright Data's scraping of public Facebook and Instagram data while logged out did not breach Meta's terms, since those terms governed users' conduct while using the services and logged-out scraping fell outside them. Meta later dropped its remaining claims.

Neither case is about YouTube, and both are US decisions on specific facts. They show a trend, not a rule: courts in the US have been more willing to protect the collection of genuinely public, logged-out data than the use of accounts, bypassed technical barriers or private data.

Personal data: GDPR and comments

Transcripts are mostly the words of a creator about a topic. Comments are different: a comment, its author's display name and channel ID are personal data under the GDPR, even though anyone can read them. Being public does not remove GDPR duties; it changes what lawful basis and safeguards are reasonable.

If GDPR applies to you (you are in the EU or UK, or you process data of people there in certain ways), the main duties are:

  • A lawful basis. For research and analytics this is usually legitimate interest, which requires a balancing test: your interest against the reasonable expectations of the people in the data. Document it.
  • Data minimisation. Keep only what the purpose needs. For sentiment analysis you rarely need the author's name: drop it, or replace it with a pseudonym.
  • Retention limits. Decide how long you keep raw comments and delete them after that.
  • Transparency and rights. People can object or ask for erasure; have a way to honour that, including when a comment was deleted on YouTube.
  • Special categories. Comments can reveal health, religion or political views. Profiling individuals on that basis is high risk; aggregate analysis is much safer.

Pseudonymised data is still personal data under GDPR, but it lowers the risk and is often what makes a legitimate interest balance work. Anonymous aggregates (counts, topics, sentiment by video) are the safest output of all.

Text and data mining in the EU

The EU's Directive on Copyright in the Digital Single Market (Directive 2019/790, on EUR-Lex) created two exceptions for text and data mining. Article 3 lets research organisations and cultural heritage institutions mine works they have lawful access to for scientific research. Article 4 allows text and data mining by anyone, including companies, unless the rightholder has expressly reserved that use in an appropriate way, for example in machine-readable form for content made public online.

These exceptions are about copyright, not about personal data or terms of service, and they allow copies made for the analysis, not republishing the works. Whether a given site's terms or robots rules count as an opt-out under Article 4 is still being argued.

The words spoken in a video belong to their author. A transcript is a copy of those words, so the same logic as for the video applies:

  • Analysing transcripts (search, statistics, topic models, summaries for your own use, training internal classifiers) is the use most legal frameworks are most tolerant of, through fair use in the US or exceptions like text and data mining in the EU.
  • Quoting short passages with attribution, for commentary, criticism or news, is generally accepted.
  • Republishing full transcripts, translating them for publication or selling them as a dataset is where copyright problems start. Get permission from the creator first.

The same goes for thumbnails and descriptions: fine to analyse, risky to republish wholesale.

Good practice for teams

Whatever tool you use, these habits keep most projects out of trouble:

  1. Collect public data only. No private videos, members-only content or anything behind a login. A good API refuses these anyway: FetchTranscript's transcript endpoints answer 404 video_unavailable for private, members-only and age-restricted videos.
  2. Do not create accounts to scrape, and never use other people's credentials.
  3. Be gentle. Rate-limit your crawler, cache what you already have, and do not try to defeat security measures.
  4. Minimise personal data. Drop or pseudonymise usernames unless you truly need them; never build profiles of individuals.
  5. Honour deletions. Refresh periodically and delete comments or videos that are gone from YouTube.
  6. Keep a purpose record. One page describing what you collect, why, how long you keep it, and your lawful basis.
  7. Do not republish content you do not own beyond short quotes.

Where an API fits

Using a hosted API does not move your legal duties to someone else: what you store and publish is still your responsibility. It does change the technical picture. You request only public data, you do not run your own crawler or proxies, and requests are paced and cached on the provider's side. Read the FetchTranscript terms for what our service allows, and see the API reference for exactly which fields each endpoint returns, so you can decide what to keep. If comments are part of your project, our comment scraping guide shows how to drop author fields at export time.

Frequently asked questions

Is scraping YouTube illegal?

Not as such. Collecting public, logged-out data is often lawful, but YouTube's terms restrict automated access, and personal data and copyright laws still apply to what you collect. The answer depends on what you collect, where you are and what you do with it.

Can YouTube ban me for scraping?

YouTube can block IP addresses and accounts that it sees as automated traffic, and it can take civil action for terms violations. Blocking is by far the most common consequence.

Are YouTube comments personal data?

Yes, under GDPR a comment together with its author's name or channel ID is personal data, even though it is public. Minimise, pseudonymise and set retention limits.

Can I publish the transcripts I collect?

Short quotes with attribution are generally fine. Publishing full transcripts or selling them needs the creator's permission, because the words are theirs.

No. It is the officially sanctioned route for what it covers, but it does not provide other people's transcripts, and lawful collection of public data is possible by other means. Weigh the terms, the data you need and your jurisdiction.

No. It is general information. For a specific project, consult a lawyer in your jurisdiction.

Try it on your own videos

100 free calls every month, no credit card. Then $1 per 1,000 calls, only for the calls that succeed.

← All articles