Skip to content

The repository "Scraping-YouTube-Reviews-Using-the-YouTube-API" aims to scrape captions or transcripts from YouTube videos. This Python-based project utilizes the YouTube Data API to retrieve captions for either individual videos or entire playlists and stores the extracted data into a CSV file.

Notifications You must be signed in to change notification settings

MbuviM/Scraping-YouTube-Reviews-Using-the-YouTube-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Scraping YouTube Reviews Using the YouTube API

This project involves scraping captions or transcripts from YouTube videos using the YouTube Data API. It retrieves captions for either individual videos or entire playlists, storing the extracted data into a CSV file.

Overview

The Python script utilizes the googleapiclient library to interact with the YouTube Data API v3 for fetching video captions. Additionally, it utilizes the youtube_transcript_api library to access and retrieve the captions.

Installation

To run the script, follow these steps:

  1. Install the necessary Python packages:

    pip install google-api-python-client youtube-transcript-api
  2. Obtain a YouTube Data API key from the Google Cloud Console:

  3. Replace 'YOUR_API_KEY' in the Python script (Youtube.py) with your obtained API key.

Usage

The script can be used to scrape captions for either a single video or a playlist.

Usage for Single Video:

To fetch captions for a single video, modify the playlist_or_video_ids variable in Youtube.py with the desired video ID (not within a list).

playlist_or_video_ids = "YOUR_VIDEO_ID"

Run the script using the terminal with the following command

    python Youtube.py 

To fetch the captions modify the following code

    playlist_or_video_ids = ["YOUR_PLAYLIST_ID"]

Feel free to customize and expand upon this README file to include additional information, setup instructions, or any other relevant details pertaining to your project's requirements and usage.

About

The repository "Scraping-YouTube-Reviews-Using-the-YouTube-API" aims to scrape captions or transcripts from YouTube videos. This Python-based project utilizes the YouTube Data API to retrieve captions for either individual videos or entire playlists and stores the extracted data into a CSV file.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages