{"id":23191,"library":"youtube-search-python","title":"youtube-search-python","description":"A library to search for YouTube videos, channels, playlists, and retrieve video information without using the YouTube Data API v3. Uses InnerTube (YouTube's internal API) internally. Current version 1.6.6 is the final release; the project is deprecated. The author recommends migrating to yt-dlp for streaming and video info, and alternatives like youtube-search for searching.","status":"deprecated","version":"1.6.6","language":"python","source_language":"en","source_url":"https://github.com/alexmercerind/youtube-search-python","tags":["youtube","search","api","deprecated"],"install":[{"cmd":"pip install youtube-search-python","lang":"bash","label":"PyPI"}],"dependencies":[{"reason":"HTTP client for API requests","package":"httpx","optional":false},{"reason":"Used by StreamURLFetcher and Video for audio/video stream URLs (since v1.6.1)","package":"yt-dlp","optional":false}],"imports":[{"note":"Package is 'youtubesearchpython', not 'youtubesearch'","wrong":"from youtubesearch import VideosSearch","symbol":"VideosSearch","correct":"from youtubesearchpython import VideosSearch"},{"symbol":"ChannelSearch","correct":"from youtubesearchpython import ChannelSearch"},{"symbol":"PlaylistsSearch","correct":"from youtubesearchpython import PlaylistsSearch"},{"note":"Used to get video info by URL","symbol":"Video","correct":"from youtubesearchpython import Video"},{"note":"Deprecated in v1.6.6, use yt-dlp directly","symbol":"StreamURLFetcher","correct":"from youtubesearchpython import StreamURLFetcher"},{"note":"Added in v1.6.3","symbol":"Channel","correct":"from youtubesearchpython import Channel"},{"symbol":"Playlist","correct":"from youtubesearchpython import Playlist"},{"note":"Added in v1.6.0","symbol":"Comments","correct":"from youtubesearchpython import Comments"}],"quickstart":{"code":"from youtubesearchpython import VideosSearch\n\nvideos_search = VideosSearch('Never Gonna Give You Up', limit=2)\nresult = videos_search.result()\nfor video in result['result']:\n    print(video['title'], video['link'])","lang":"python","description":"Search for videos and print title and link."},"warnings":[{"fix":"Migrate to alternative libraries: yt-dlp for streaming, youtube-search or google-api-python-client for searching.","message":"The library is deprecated as of v1.6.6 (final release). No further updates will be provided. It may break at any time due to YouTube changes.","severity":"deprecated","affected_versions":">=1.6.6"},{"fix":"Ensure yt-dlp is installed: pip install yt-dlp. Or use yt-dlp directly.","message":"StreamURLFetcher and Video.get() for streaming URLs now require yt-dlp (since v1.6.1). They no longer use PyTube.","severity":"breaking","affected_versions":">=1.6.1"},{"fix":"Use 'from youtubesearchpython import ...' (no dash, no underscore).","message":"The package name is 'youtube-search-python' (PyPI), but the import module is 'youtubesearchpython'. Many users mistakenly import 'youtubesearch'.","severity":"gotcha","affected_versions":"all"},{"fix":"Wrap searches in try-except to handle failures gracefully.","message":"Search results may include age-restricted or unavailable videos. The library may raise exceptions for such content.","severity":"gotcha","affected_versions":"all"},{"fix":"Check updated documentation for Playlist class API changes.","message":"Playlist class now uses InnerTube API (since v1.5.3). Series playlists are handled differently.","severity":"breaking","affected_versions":">=1.5.3"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use 'from youtubesearchpython import ...' instead of 'from youtubesearch import ...'.","cause":"Incorrect import path; the module is 'youtubesearchpython' not 'youtubesearch'.","error":"ModuleNotFoundError: No module named 'youtubesearch'"},{"fix":"Upgrade to latest version (pip install --upgrade youtube-search-python) and use correct class name: VideosSearch.","cause":"Older version of library (pre-1.0) or misspelled class name.","error":"AttributeError: module 'youtubesearchpython' has no attribute 'VideosSearch'"},{"fix":"Check the returned object: print(result.keys()) and adapt your code. Also wrap in try-except to catch search failures.","cause":"The search result dictionary structure changed between versions, or an error occurred during search.","error":"KeyError: 'result'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}