iq-yt
YouTube data extraction — no API key needed 🚀
iq-yt is an async Python library for searching YouTube and extracting video, channel, playlist, transcript, and suggestion data — without the YouTube Data API v3.
Made with ❤️ by @BabiesIQ
Installation
pip install iq-yt
Or install latest from GitHub:
pip install git+https://github.com/BabiesIQ/iq-yt
Features
- 🔍 Search videos, channels, and playlists
- 🎬 Get full video info by URL or ID (uses player API — always accurate)
- 📋 Get playlist details and video list
- 💬 Fetch video transcripts in any language
- 📡 Get search suggestions (autocomplete)
- 📺 Get channel info
- 🔄 Async/await support (asyncio)
- 🌐 Proxy support
Quick Start
import asyncio
from iq_yt import VideosSearch, Video
async def main():
# Search videos
search = VideosSearch("Arijit Singh", limit=5)
result = await search.next()
for video in result["result"]:
print(video["title"], video["link"])
# Get video info by URL or ID — always returns correct data
info = await Video.get("https://www.youtube.com/watch?v=dQw4w9WgXcQ")
print(info["title"])
asyncio.run(main())
Usage
Search Videos
from iq_yt import VideosSearch
search = VideosSearch("NoCopyrightSounds", limit=10, language="en", region="US")
result = await search.next()
print(result)
Search Channels
from iq_yt import ChannelsSearch
search = ChannelsSearch("NoCopyrightSounds", limit=5)
result = await search.next()
print(result)
Search Playlists
from iq_yt import PlaylistsSearch
search = PlaylistsSearch("lofi hip hop", limit=5)
result = await search.next()
print(result)
Get Video Info (by ID or URL)
from iq_yt import Video
# Works with full URL
video = await Video.get("https://www.youtube.com/watch?v=dQw4w9WgXcQ")
# Also works with just the video ID
video = await Video.get("dQw4w9WgXcQ")
print(video["title"])
print(video["channel"]["name"])
print(video["duration"]["text"])
Get Video Transcript
from iq_yt import Transcript
transcript = await Transcript.get("https://www.youtube.com/watch?v=dQw4w9WgXcQ", language="en")
for segment in transcript["result"]:
print(segment["start"], segment["text"])
Get Search Suggestions
from iq_yt import Suggestions
result = await Suggestions.get("arijit", language="en", region="IN")
print(result["result"])
Get Channel Info
from iq_yt import Channel
info = await Channel.get("https://www.youtube.com/@NoCopyrightSounds")
print(info["result"]["name"])
print(info["result"]["subscribers"])
Get Playlist Info
from iq_yt import Playlist
info = await Playlist.get("https://www.youtube.com/playlist?list=PLRBp0Fe2GpgmsW46rJyudVFlY6IYjFBIK")
print(info["result"]["title"])
for video in info["result"]["videos"]:
print(video["title"])
Using with Proxy
search = VideosSearch("lofi", limit=5, proxy="http://user:pass@host:port")
result = await search.next()
Music Bot — Best Practice
When using in a music bot, always use Video.get() for video IDs/URLs — it hits the player API directly and always returns the correct data. VideosSearch is only for text queries.
from iq_yt import Video, VideosSearch
import re
YT_REGEX = re.compile(
r"(?:https?://)?(?:www\.)?(?:youtube\.com/watch\?v=|youtu\.be/)([a-zA-Z0-9_-]{11})"
)
async def resolve_track(query: str):
match = YT_REGEX.search(query)
if match or len(query) == 11:
# Direct fetch — always accurate
return await Video.get(query)
else:
# Text search
search = VideosSearch(query, limit=1)
result = await search.next()
return result["result"][0] if result["result"] else None
License
Credits
Based on youtube-search-python by Alex Mercer and py-yt-search by AshokShau.
Metadata
Release files for iq-yt 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| iq_yt-1.0.0.tar.gz | 15.6 kB | Without provenance | Details for iq_yt-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| iq_yt-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for iq_yt-1.0.0-py3-none-any.whl |
Total release size: 34.7 kB
Release files / iq_yt-1.0.0.tar.gz
| Download URL | iq_yt-1.0.0.tar.gz |
|---|---|
| Size | 15.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
be67fb1e2191bc5fd664d44936757677515659efec1599b12969d02cb02a5503
|
|
BLAKE2b-256 checksum How to use checksums |
3c681c96a3a966f991aa8c07030ffdfe52e6878a24bfacafcadc2deb06f44ca8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.14
|
Release files / iq_yt-1.0.0-py3-none-any.whl
| Download URL | iq_yt-1.0.0-py3-none-any.whl |
|---|---|
| Size | 19.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6913f5a8e8b57a3292caf0a9976b492b97cf7ec9bbcdac2f343801be4124f883
|
|
BLAKE2b-256 checksum How to use checksums |
6db485bd5c6d1c58057353245d53a4aacc0a83f0a5f21a9cac9b0c881bb2739b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.14
|
Security for iq-yt 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.