- 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
- 🚀 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
- 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
pip3 install yt-search-pythonpip install git+https://github.com/BillaSpace/youtube-search-python.gitgit+https://github.com/BillaSpace/youtube-search-python.git
from youtubesearchpython import VideosSearch
search = VideosSearch('NoCopyrightSounds', limit=10)
print(search.result())from youtubesearchpython import Video
video = Video.get('https://www.youtube.com/watch?v=aqz-KE-bpKQ')
print(video['title'])
print(video['viewCount'])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())- 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
VideosSearch- Search for videosChannelsSearch- Search for channelsPlaylistsSearch- Search for playlistsCustomSearch- Search with custom filtersChannelSearch- Search within a specific channel
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
StreamURLFetcher- Get direct stream URLs with multiple formatsResultMode- Control output format (dict/json)
from youtubesearchpython import CustomSearch, VideoSortOrder
# Search videos sorted by view count
search = CustomSearch('Python', VideoSortOrder.viewCount, limit=10)
print(search.result())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'])}")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']}")from youtubesearchpython import Suggestions
suggestions = Suggestions.get('Arijit Singh', language='en', region='US')
print(suggestions['result'])For more examples, see the examples directory.
cd tests
python3 full_execution.pyThis 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
See tests/README.md for detailed testing information.
search = VideosSearch('Python', limit=10)
print(search.result())
# Get next page
search.next()
print(search.result())search = VideosSearch('Music', limit=10, language='es', region='ES')Available filters:
- Upload Date:
VideoUploadDateFilter.lastHour,.today,.thisWeek,.thisMonth,.thisYear - Duration:
VideoDurationFilter.short,.long - Sort Order:
VideoSortOrder.relevance,.uploadDate,.viewCount,.rating
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
This project is licensed under the MIT License - see the LICENSE file for details.
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.
- Current Developer: Prakhar
- Old Author: Hitesh Kumar Saini
-
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
