{"id":15044076,"url":"https://github.com/fahimfba/ytubeinsight","last_synced_at":"2025-09-07T11:40:43.509Z","repository":{"id":257207811,"uuid":"857636603","full_name":"FahimFBA/YTubeInsight","owner":"FahimFBA","description":"Python package for effortless YouTube channel analytics: track video counts, extract details, and gain insights.","archived":false,"fork":false,"pushed_at":"2024-11-10T18:05:58.000Z","size":54,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-30T22:06:56.926Z","etag":null,"topics":["pypi","pypi-package","youtube","youtube-api","youtube-api-v3","youtube-bot","youtube-view","youtube-views"],"latest_commit_sha":null,"homepage":"https://ytubeinsight.readthedocs.io/en/latest/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FahimFBA.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-09-15T07:33:07.000Z","updated_at":"2024-11-10T18:06:01.000Z","dependencies_parsed_at":"2024-09-25T02:02:36.556Z","dependency_job_id":null,"html_url":"https://github.com/FahimFBA/YTubeInsight","commit_stats":null,"previous_names":["fahimfba/ytubeinsight"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FahimFBA%2FYTubeInsight","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FahimFBA%2FYTubeInsight/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FahimFBA%2FYTubeInsight/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FahimFBA%2FYTubeInsight/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FahimFBA","download_url":"https://codeload.github.com/FahimFBA/YTubeInsight/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237896807,"owners_count":19383588,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["pypi","pypi-package","youtube","youtube-api","youtube-api-v3","youtube-bot","youtube-view","youtube-views"],"created_at":"2024-09-24T20:50:02.639Z","updated_at":"2025-02-09T02:32:06.114Z","avatar_url":"https://github.com/FahimFBA.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# YTubeInsight\n\n[![PyPI version](https://badge.fury.io/py/ytubeinsight.svg)](https://badge.fury.io/py/ytubeinsight)\n[![Python Versions](https://img.shields.io/pypi/pyversions/ytubeinsight.svg)](https://pypi.org/project/ytubeinsight/)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Documentation Status](https://readthedocs.org/projects/ytubeinsight/badge/?version=latest)](https://ytubeinsight.readthedocs.io/en/latest/?badge=latest)\n![PyPI Downloads](https://static.pepy.tech/badge/ytubeinsight)\n\nYTubeInsight is a Python package for effortless YouTube channel analytics. Track video counts, extract details, and gain insights from YouTube channels with ease. You can check the download stats of YTubeInsight [here](https://pypistats.org/packages/ytubeinsight).\n\n## Features\n\n- Analyze YouTube channels using either full channel URLs or channel IDs\n- Count videos published within the last year\n- Retrieve detailed information about each video (title, publish date, URL)\n- Easy-to-use API with comprehensive error handling\n- Compatibility with Python 3.6+\n\n## Installation\n\nYou can install YTubeInsight using pip. We recommend using a virtual environment to manage your dependencies. You can choose between venv (built into Python) or conda based on your preference.\n\n### Option 1: Using venv\n\n1. Create a virtual environment:\n   ```\n   python -m venv ytubeinsight-env\n   ```\n\n2. Activate the virtual environment:\n   - On Windows:\n     ```\n     ytubeinsight-env\\Scripts\\activate\n     ```\n   - On macOS and Linux:\n     ```\n     source ytubeinsight-env/bin/activate\n     ```\n\n3. Install YTubeInsight:\n   ```\n   pip install ytubeinsight\n   ```\n\n### Option 2: Using conda\n\n1. Create a conda environment:\n   ```\n   conda create --name ytubeinsight-env python=3.8\n   ```\n\n2. Activate the conda environment:\n   ```\n   conda activate ytubeinsight-env\n   ```\n\n3. Install YTubeInsight:\n   ```\n   pip install ytubeinsight\n   ```\n\n## Quick Start\n\nHere's a simple example of how to use YTubeInsight:\n\n```python\nfrom ytubeinsight import analyze_channel\n\n# Replace with your YouTube Data API key\nAPI_KEY = 'YOUR_API_KEY_HERE'\n\n# Analyze a channel by URL\nchannel_url = 'https://www.youtube.com/channel/UC_x5XG1OV2P6uZZ5FSM9Ttw'\nresult = analyze_channel(channel_url, API_KEY)\n\nprint(f\"Videos published in the last year: {result['video_count']}\")\n\n# Print details of the first video\nif result['video_data']:\n    video = result['video_data'][0]\n    print(f\"Latest video:\")\n    print(f\"Title: {video['title']}\")\n    print(f\"Published on: {video['published_at']}\")\n    print(f\"URL: {video['url']}\")\n```\n\n## Detailed Usage\n\n### Analyzing a channel by URL\n\n```python\nfrom ytubeinsight import analyze_channel\n\nresult = analyze_channel('https://www.youtube.com/channel/UC_x5XG1OV2P6uZZ5FSM9Ttw', 'YOUR_API_KEY')\n```\n\n### Analyzing a channel by ID\n\n```python\nfrom ytubeinsight import analyze_channel\n\nresult = analyze_channel('UCJFp8uSYCjXOMnkUyb3CQ3Q', 'YOUR_API_KEY', is_channel_id=True)\n```\n\n### Handling errors\n\n```python\nfrom ytubeinsight import analyze_channel, YTubeInsightError\n\ntry:\n    result = analyze_channel('invalid_channel_url', 'YOUR_API_KEY')\nexcept YTubeInsightError as e:\n    print(f\"An error occurred: {str(e)}\")\n```\n\n## API Reference\n\n### analyze_channel(channel_input, api_key, is_channel_id=False)\n\nAnalyzes a YouTube channel and returns video data for the past year.\n\n- `channel_input`: Either a full channel URL or channel ID\n- `api_key`: YouTube Data API key\n- `is_channel_id`: Boolean indicating if channel_input is a channel ID\n\nReturns a dictionary containing:\n- `video_count`: Number of videos published in the last year\n- `video_data`: List of dictionaries, each containing video details (title, publish date, URL)\n\nFor more detailed API documentation, please visit our [Read the Docs page](https://ytubeinsight.readthedocs.io/).\n\n## Obtaining a YouTube Data API Key\n\nTo use YTubeInsight, you need a YouTube Data API key. Here's how to get one:\n\n1. Go to the [Google Developers Console](https://console.developers.google.com/).\n2. Create a new project or select an existing one.\n3. Enable the YouTube Data API v3 for your project.\n4. Create credentials (API key) for your project.\n5. Use this API key in your YTubeInsight calls.\n\nRemember to keep your API key secret and never share it publicly.\n\n## Requirements\n\n- Python 3.6+\n- google-api-python-client\n- requests\n- beautifulsoup4\n\n## Development\n\nTo set up the development environment:\n\n1. Clone the repository:\n   ```\n   git clone https://github.com/FahimFBA/YTubeInsight.git\n   cd YTubeInsight\n   ```\n\n2. Create and activate a virtual environment (choose one):\n   - Using venv:\n     ```\n     python -m venv venv\n     source venv/bin/activate  # On Windows, use `venv\\Scripts\\activate`\n     ```\n   - Using conda:\n     ```\n     conda create --name ytubeinsight-dev python=3.8\n     conda activate ytubeinsight-dev\n     ```\n\n3. Install the development dependencies:\n   ```\n   pip install -e .[dev]\n   ```\n\n4. Run the tests:\n   ```\n   pytest\n   ```\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n1. Fork the repository\n2. Create your feature branch (`git checkout -b feature/AmazingFeature`)\n3. Commit your changes (`git commit -m 'Add some AmazingFeature'`)\n4. Push to the branch (`git push origin feature/AmazingFeature`)\n5. Open a Pull Request\n\nPlease make sure to update tests as appropriate and adhere to the [Code of Conduct](CODE_OF_CONDUCT.md).\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Changelog\n\nFor a detailed changelog, please see the [CHANGELOG.md](CHANGELOG.md) file.\n\n## Acknowledgments\n\n- Google for providing the YouTube Data API\n- All contributors who help improve this package\n\n## Support\n\nIf you encounter any problems or have any questions, please [open an issue](https://github.com/FahimFBA/YTubeInsight/issues) on GitHub.\n\n## Disclaimer\n\nThis project is not affiliated with, authorized, maintained, sponsored or endorsed by YouTube or any of its affiliates or subsidiaries. This is an independent and unofficial API. Use at your own risk.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffahimfba%2Fytubeinsight","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffahimfba%2Fytubeinsight","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffahimfba%2Fytubeinsight/lists"}