YouTube search without official API - fast, reliable, and free
Project description
irotechlab-yt-search
YouTube search without official API - fast, reliable, and completely free.
📌 Features
- 🔍 Search videos, channels, and playlists without API key
- ⚡ Async/await support for high performance
- 🎯 Filter by type (video, channel, playlist, live, movie)
- 📊 Sort by relevance, upload date, view count, rating
- 🌍 Region and language support
- 🔄 Pagination for unlimited results
- 📹 Video info extraction (title, channel, views, likes, comments)
- 💬 Comment scraping with replies
- 📑 Chapter extraction
- 🛡️ Rate limiting and retry logic
- 📦 Clean dataclass models (Video, Channel, Playlist)
📦 Installation
pip install irotechlab-yt-search
Or install from source:
git clone https://github.com/irotechlab/irotechlab-yt-search
cd irotechlab-yt-search
pip install -e .
🚀 Quick Start
import asyncio
from irotechlab_yt_search import YouTubeSearch
async def main():
search = YouTubeSearch()
# Search for videos
videos = await search.search("python programming", max_results=5)
for video in videos:
print(f"{video.title}")
print(f" Channel: {video.channel}")
print(f" Views: {video.views}")
print(f" URL: {video.url}\n")
await search.close()
asyncio.run(main())
📹 Video Info
from irotechlab_yt_search import VideoInfo, extract_video_id
async def get_video_info():
info = VideoInfo()
video_url = "https://youtube.com/watch?v=VIDEO_ID"
video_id = extract_video_id(video_url)
details = await info.get_video_info(video_id)
print(f"Title: {details['title']}")
print(f"Views: {details['views']}")
print(f"Likes: {details['likes']}")
print(f"Comments: {details['comment_count']}")
await info.close()
📺 Channel Info
from irotechlab_yt_search import ChannelInfo
async def get_channel():
channel_info = ChannelInfo()
channel = await channel_info.get_channel_info("@channelname")
print(f"Name: {channel['name']}")
print(f"Subscribers: {channel['subscribers']}")
print(f"Videos: {channel['video_count']}")
await channel_info.close()
📋 Playlist Info
from irotechlab_yt_search import PlaylistInfo
async def get_playlist():
playlist_info = PlaylistInfo()
playlist = await playlist_info.get_playlist_info("PLAYLIST_ID", max_videos=10)
print(f"Title: {playlist['title']}")
print(f"Author: {playlist['author']}")
print(f"Videos: {playlist['video_count']}")
for video in playlist['videos']:
print(f" - {video['title']}")
await playlist_info.close()
🔍 Advanced Search
Filter by type
# Only videos
videos = await search.search(
"python tutorial",
filter_type="video",
max_results=10
)
Sort results
# Sort by view count
videos = await search.search(
"python tutorial",
sort_by="view_count"
)
# Sort by upload date
videos = await search.search(
"python tutorial",
sort_by="upload_date"
)
Region and language
videos = await search.search(
"python tutorial",
region_code="IN",
language="hi"
)
🛠️ API Reference
YouTubeSearch
Parameters:
query(str): Search querymax_results(int): Maximum number of results (default: 10)filter_type(str):all,video,channel,playlist,movie,livesort_by(str):relevance,upload_date,view_count,ratingregion_code(str): Two-letter country codelanguage(str): Language code
Returns: List[Video]
Video Object
@dataclass
class Video:
id: str
title: str
channel: str
channel_id: Optional[str]
url: str
thumbnail: str
duration: str
duration_seconds: Optional[int]
views: str
view_count: Optional[int]
published: str
published_date: Optional[datetime]
is_live: bool
📂 Examples
Check the examples/ directory for more usage examples:
basic_search.py- Simple searchadvanced_search.py- Advanced filtering and sortingall_in_one.py- Complete demo of all features
🤝 Contributing
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
📞 Support & Community
- Telegram Channel: @irotechcoders
- Telegram Contact: @ironmanhindigaming
- GitHub Issues: Report a bug
📄 License
MIT License - see LICENSE file for details
⚠️ Disclaimer
This package scrapes YouTube's internal API and may break if YouTube changes their structure. Use responsibly and respect YouTube's terms of service.
Made with ❤️ by IrotechLab
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file irotechlab_yt_search-1.0.0.tar.gz.
File metadata
- Download URL: irotechlab_yt_search-1.0.0.tar.gz
- Upload date:
- Size: 26.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aeee78d69bcb865fd82d4901b43b61b38bcee324fa96cce5c9811b37ea5efb91
|
|
| MD5 |
e088ae7ba8968ca122f1671cea7e5c07
|
|
| BLAKE2b-256 |
752fc41ae6969fe1731443e1e7b0dc5092f22012fb06fd8e1f3d654f88e22afa
|
Provenance
The following attestation bundles were made for irotechlab_yt_search-1.0.0.tar.gz:
Publisher:
python-publish.yml on IROTECHLAB/irotechlab-yt-search
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
irotechlab_yt_search-1.0.0.tar.gz -
Subject digest:
aeee78d69bcb865fd82d4901b43b61b38bcee324fa96cce5c9811b37ea5efb91 - Sigstore transparency entry: 2187066774
- Sigstore integration time:
-
Permalink:
IROTECHLAB/irotechlab-yt-search@faa28679cb0566d0f72bae899fa4a0b61904950d -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/IROTECHLAB
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@faa28679cb0566d0f72bae899fa4a0b61904950d -
Trigger Event:
release
-
Statement type:
File details
Details for the file irotechlab_yt_search-1.0.0-py3-none-any.whl.
File metadata
- Download URL: irotechlab_yt_search-1.0.0-py3-none-any.whl
- Upload date:
- Size: 29.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
86a0ea6006482380516355e6103a225ae96210e08535265a1b65cd4807c34237
|
|
| MD5 |
d0b0242665dc22da44d64c093c9ccf26
|
|
| BLAKE2b-256 |
c0212aab5386b276aa6207731d79aadfbe6c818a7070d4fc6f54591bd8ae063d
|
Provenance
The following attestation bundles were made for irotechlab_yt_search-1.0.0-py3-none-any.whl:
Publisher:
python-publish.yml on IROTECHLAB/irotechlab-yt-search
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
irotechlab_yt_search-1.0.0-py3-none-any.whl -
Subject digest:
86a0ea6006482380516355e6103a225ae96210e08535265a1b65cd4807c34237 - Sigstore transparency entry: 2187066782
- Sigstore integration time:
-
Permalink:
IROTECHLAB/irotechlab-yt-search@faa28679cb0566d0f72bae899fa4a0b61904950d -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/IROTECHLAB
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@faa28679cb0566d0f72bae899fa4a0b61904950d -
Trigger Event:
release
-
Statement type: