Skip to main content

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

yt-search-python

GitHub Stars GitHub Forks Python Version License

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.

FeaturesInstallationQuick StartDocumentationExamplesTesting


✨ 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.future only

📦 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

Key Classes

Search Classes

  • VideosSearch - Search for videos
  • ChannelsSearch - Search for channels
  • PlaylistsSearch - Search for playlists
  • CustomSearch - Search with custom filters
  • ChannelSearch - Search within a specific channel

Content Classes

  • Video - Get video information and formats
  • Playlist - Get playlist information and videos
  • Channel - Get channel information
  • Comments - Get video comments
  • Transcript - Get video transcripts/captions
  • Suggestions - Get search suggestions
  • Recommendations - Get video recommendations
  • Hashtag - Get videos by hashtag

Utility Classes

  • StreamURLFetcher - Get direct stream URLs with multiple formats
  • ResultMode - 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.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. 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


🌟 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

Report BugRequest Feature

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

yt_search_python-2.0.0.tar.gz (42.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

yt_search_python-2.0.0-py3-none-any.whl (51.0 kB view details)

Uploaded Python 3

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

Hashes for yt_search_python-2.0.0.tar.gz
Algorithm Hash digest
SHA256 9892954dd992f83aec62aba77efa70749de08478e05c99e5240f70fa50809bde
MD5 05a9e32a82ffd9381adefcf56ff37005
BLAKE2b-256 ed72b7cb5d3eaa99d8650a0c8818588bdd1393ef35b0171a3f63d161c36c54ce

See more details on using hashes here.

File details

Details for the file yt_search_python-2.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for yt_search_python-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d00a2662c2ae93db5534f1de822f7b021a21cf22d8b7baf0695ad8bda8bbe669
MD5 a8b53fbb6de6ba9514090c193fa9f630
BLAKE2b-256 1d315fa686e8ff1151ce3e02db61688f70c3910bf640e116568eed4a4ffc19d6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page