Skip to main content

iq-yt

YouTube data extraction — no API key needed 🚀

PyPI Python License Telegram

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

MIT

Credits

Based on youtube-search-python by Alex Mercer and py-yt-search by AshokShau.

Metadata

Release files for iq-yt 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for iq-yt 1.0.1
File Size Uploaded Provenance Actions
iq_yt-1.0.1.tar.gz 15.4 kB Without provenance Details for iq_yt-1.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for iq-yt 1.0.1
File Interpreter ABI Platform Actions
iq_yt-1.0.1-py3-none-any.whl Python 3 none any Details for iq_yt-1.0.1-py3-none-any.whl

Total release size: 34.6 kB

Release files / iq_yt-1.0.1.tar.gz

Download URL iq_yt-1.0.1.tar.gz
Size 15.4 kB
Tags Source
SHA-256 checksum
How to use checksums
5a57f8861a9855caa8831008a13946ba2bc991b16ff3e13d9f29b8eff4103488
BLAKE2b-256 checksum
How to use checksums
24d5b446aa7c7c088a5c53c997abcd4bbf7b13805338de9c69652ea7258269e4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.15

Release files / iq_yt-1.0.1-py3-none-any.whl

Download URL iq_yt-1.0.1-py3-none-any.whl
Size 19.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dff371c722f1e9ac6aa2bb42885b1df15c9c417be8160f8a5249e19c1c2a76f9
BLAKE2b-256 checksum
How to use checksums
3b82e3ea15eaed8a6e98a953611bae1b39813d9fb485a25a1c4223eb5f167a68
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.15

Security for iq-yt 1.0.1

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page