Search YouTube contents without YouTube Data API v3. Professionally maintained fork with modern Python support. Sync & async support.
Project description
📮 YouTube Search Python v2.0.0
- now known as :-
yt-search-python
Search YouTube without the YouTube Data API v3
A professional, Modern & actively maintained Python library for searching YouTube content—completely free and without youtube data API quotas.
Features • Installation • Quick Start • Documentation • Examples • Testing
✨ Features
- 🚀 No API Key Required - Search YouTube without quotas or rate limits
- ⚡ Fast & Reliable - Optimized for performance with modern httpx
- 🔄 Sync & Async Support - Use synchronous or asynchronous methods
- 📦 Rich Metadata - Get videos, channels, playlists, comments, transcripts & more
- 🎯 Advanced Filtering - Sort by date, views, duration, and more
- 🌐 Multi-Region - Search with language and region preferences
- 🔧 Modern - Compatible with Python 3.7+ to current and httpx 0.28+
- 💪 Type Hints - Full type annotations for better IDE support
Old youtube-search-python User?
- if your are old user of this library & confused while migration to this library don't be confused just remove _ _ future _ _ imports to
youtube-search-python.futureonly
📦 Installation
Via Pip
pip3 install yt-search-python
Via Git
pip install git+https://github.com/BillaSpace/youtube-search-python.git
Via git requirements.txt
git+https://github.com/BillaSpace/youtube-search-python.git
🚀 Quick Start
Search for Videos
from youtubesearchpython import VideosSearch
search = VideosSearch('NoCopyrightSounds', limit=10)
print(search.result())
Get Video Information
from youtubesearchpython import Video
video = Video.get('https://www.youtube.com/watch?v=aqz-KE-bpKQ')
print(video['title'])
print(video['viewCount'])
Async Support
import asyncio
from youtubesearchpython.future import VideosSearch, Video
async def main():
search = VideosSearch('Python Tutorial', limit=5)
result = await search.next()
print(result)
video = await Video.get('video_id_here')
print(video)
asyncio.run(main())
📚 Documentation
Core Documentation
- API Reference - Complete API documentation with all classes and methods
- Usage Examples - Comprehensive examples for all features:
- Search Examples - All search classes with filters
- Video & Extras Examples - Video, Playlist, Comments, etc.
- Stream URL Examples - Direct stream URL fetching
- for stream url fetching services you must have
yt-dlpalready installed in your system
Key Classes
Search Classes
VideosSearch- Search for videosChannelsSearch- Search for channelsPlaylistsSearch- Search for playlistsCustomSearch- Search with custom filtersChannelSearch- Search within a specific channel
Content Classes
Video- Get video information and formatsPlaylist- Get playlist information and videosChannel- Get channel informationComments- Get video commentsTranscript- Get video transcripts/captionsSuggestions- Get search suggestionsRecommendations- Get video recommendationsHashtag- Get videos by hashtag
Utility Classes
StreamURLFetcher- Get direct stream URLs with multiple formatsResultMode- Control output format (dict/json)
💡 Examples
Advanced Search with Filters
from youtubesearchpython import CustomSearch, VideoSortOrder
# Search videos sorted by view count
search = CustomSearch('Python', VideoSortOrder.viewCount, limit=10)
print(search.result())
Get Playlist Videos
from youtubesearchpython import Playlist
# Works with both URLs and IDs
playlist = Playlist.get('PLRBp0Fe2GpgmsW46rJyudVFlY6IYjFBIK')
print(f"Playlist: {playlist['title']}")
print(f"Videos: {len(playlist['videos'])}")
Fetch Comments
from youtubesearchpython import Comments
comments = Comments.get('https://www.youtube.com/watch?v=aqz-KE-bpKQ')
for comment in comments['result'][:5]:
print(f"{comment['author']}: {comment['content']}")
Get Search Suggestions
from youtubesearchpython import Suggestions
suggestions = Suggestions.get('Arijit Singh', language='en', region='US')
print(suggestions['result'])
For more examples, see the examples directory.
🧪 Testing
Wanna Quick Test ?
cd tests
python3 full_execution.py
This comprehensive test suite covers:
- ✅ All search classes (Videos, Channels, Playlists, Custom)
- ✅ Content retrieval (Video, Playlist, Channel)
- ✅ Social features (Comments, Recommendations, Suggestions)
- ✅ Advanced features (StreamURLFetcher, Transcript)
- ✅ Both synchronous and asynchronous methods
Test Documentation
See tests/README.md for detailed testing information.
🔧 Advanced Features
Pagination
search = VideosSearch('Python', limit=10)
print(search.result())
# Get next page
search.next()
print(search.result())
🌎 Language & Region
search = VideosSearch('Music', limit=10, language='es', region='ES')
Custom Filters
Available filters:
- Upload Date:
VideoUploadDateFilter.lastHour,.today,.thisWeek,.thisMonth,.thisYear - Duration:
VideoDurationFilter.short,.long - Sort Order:
VideoSortOrder.relevance,.uploadDate,.viewCount,.rating
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
📝 License
This project is licensed under the MIT License - see the LICENSE file for details.
⚠️ Disclaimer
This library is not affiliated with YouTube or Google Inc. It uses YouTube's internal API which may change without notice. Use responsibly and in accordance with YouTube's Terms of Content usage and distribution Services.
🔁 Credits
- Current Developer: Prakhar
- Old Author: Hitesh Kumar Saini
🌟 Support & Future of the Library
-
If you find this library useful, please consider to support the developer by giving a fork & ✳️ star on GitHub ,
-
if i found this library is really useful n necessary for everyone i'll keep maintaining on pypi as -;
yt-search-python
Made with ❤️ for the community
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 yt_search_python-2.0.0.tar.gz.
File metadata
- Download URL: yt_search_python-2.0.0.tar.gz
- Upload date:
- Size: 42.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9892954dd992f83aec62aba77efa70749de08478e05c99e5240f70fa50809bde
|
|
| MD5 |
05a9e32a82ffd9381adefcf56ff37005
|
|
| BLAKE2b-256 |
ed72b7cb5d3eaa99d8650a0c8818588bdd1393ef35b0171a3f63d161c36c54ce
|
File details
Details for the file yt_search_python-2.0.0-py3-none-any.whl.
File metadata
- Download URL: yt_search_python-2.0.0-py3-none-any.whl
- Upload date:
- Size: 51.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d00a2662c2ae93db5534f1de822f7b021a21cf22d8b7baf0695ad8bda8bbe669
|
|
| MD5 |
a8b53fbb6de6ba9514090c193fa9f630
|
|
| BLAKE2b-256 |
1d315fa686e8ff1151ce3e02db61688f70c3910bf640e116568eed4a4ffc19d6
|