This directory contains practical examples demonstrating how to use PyTubeSearch effectively.
- basic_search.py - Simple search functionality
- advanced_filtering.py - Search with filters and options
- video_details.py - Getting detailed video information
- playlist_extraction.py - Working with playlists
- pagination_example.py - Handling multiple pages of results
- batch_processing.py - Processing multiple queries efficiently
- error_handling.py - Proper error handling patterns
- async_usage.py - Asynchronous usage patterns
- data_export.py - Exporting search results to different formats
Each example can be run independently:
# Navigate to examples directory
cd examples
# Run basic search example
python basic_search.py
# Run with custom query
python basic_search.py "your search query"All examples require the PyTubeSearch package to be installed:
pip install pytubesearchFor development examples that include additional features:
pip install pytubesearch[dev]- Rate Limiting: Be mindful of making too many requests in a short period
- YouTube ToS: Ensure your usage complies with YouTube's Terms of Service
- Network Dependency: Integration examples require internet connectivity
- Educational Use: These examples are for educational purposes only
Have a useful example to share? Please contribute:
- Create a new example file with clear documentation
- Add it to the overview above
- Test it thoroughly
- Submit a pull request
If you found this project helpful, please give it a ⭐ on GitHub. This helps more developers discover the project! 🫶
If you have any questions, feedback, or just want to say hi, you can reach out to me:
- Email: hello@malith.dev
- GitHub: @Malith-Rukshan
🧑💻 Built with 💖 by Malith Rukshan