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

Metadata

Release files for iq-yt 1.0.2

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.2
File Size Uploaded Provenance Actions
iq_yt-1.0.2.tar.gz 15.4 kB Without provenance Details for iq_yt-1.0.2.tar.gz

Built distribution (wheel)

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

Total release size: 34.5 kB

Release files / iq_yt-1.0.2.tar.gz

Download URL iq_yt-1.0.2.tar.gz
Size 15.4 kB
Tags Source
SHA-256 checksum
How to use checksums
801e1e35238c6519563d919868c503388d0a25bb93385cee7246121768a29a88
BLAKE2b-256 checksum
How to use checksums
75ccf1447b56bd797bdb3f813e2bf4231a8d38de7c5a7f66f19caf9388b87b72
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.2-py3-none-any.whl

Download URL iq_yt-1.0.2-py3-none-any.whl
Size 19.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ca8f540f14105ca647780439fa1b9873dbe6219b98d748c1ee91d838bd746cde
BLAKE2b-256 checksum
How to use checksums
d65b8cd6f9d3b0ad2796e6847d28c397810ada52ec6f6d79947e40e29c66510c
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.2

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