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.3

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.3
File Size Uploaded Provenance Actions
iq_yt-1.0.3.tar.gz 15.3 kB Without provenance Details for iq_yt-1.0.3.tar.gz

Built distribution (wheel)

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

Total release size: 34.3 kB

Release files / iq_yt-1.0.3.tar.gz

Download URL iq_yt-1.0.3.tar.gz
Size 15.3 kB
Tags Source
SHA-256 checksum
How to use checksums
a2f78ef448699e0304dd3b83b59a32016956d0122611f6b2e1d6e1a800bad596
BLAKE2b-256 checksum
How to use checksums
dd0baf2af3f7b1c3c0c05e54b56f3fb48f32c1947731a6d158cc942d62f24d94
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.3-py3-none-any.whl

Download URL iq_yt-1.0.3-py3-none-any.whl
Size 19.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c36b120d413a3eb030b86df7663b56381c16da7a1f9cf84ef0ee99d6ab212a1e
BLAKE2b-256 checksum
How to use checksums
76e811f1626ee0be7973149135063719782f95ad18d2be304848d356c77a2ce2
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.3

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