This script utilizes YouTube's Data and Analytics APIs to retrieve video data from a specified YouTube channel and analyze the view count for the first 24 hours after each video's upload.
- Python 3.x
google-auth-oauthlib
Python librarygoogleapiclient
Python library- A
client_secret.json
file containing your YouTube API credentials
- Clone this repository:
git clone <repo-link>
- Install the necessary Python libraries:
pip install --upgrade google-auth-oauthlib google-auth-httplib2 google-api-python-client
- Place your
client_secret.json
in the root of the project directory.
-
In the script, replace the
channel_id
variable with your YouTube channel ID. -
Run the script:
python <script-name.py>
- The script will fetch the video data and print out a sorted list of your videos, along with their view counts for the first 24 hours.
Please note that while the script currently analyzes the first 24-hour view count, you can easily modify it to calculate views for the first 30 days or 90 days by uncommenting the respective sections in the code.
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.