Official async Python SDK and CLI for BrokenX YouTube API
Project description
🚀 BROKENXAPI
Official Async Python SDK for BrokenX YouTube API
Fast • Secure • Async • Production-Ready
📌 Overview
BROKENXAPI is the official asynchronous Python SDK for the BrokenX YouTube API, designed for developers who want a simple, secure, and scalable way to search and download YouTube media via BrokenX’s backend infrastructure.
The SDK abstracts all backend complexity and exposes a clean, minimal interface that works with nothing more than an API key.
⚠️ Backend logic, infrastructure, and internal mechanisms are intentionally not exposed.
✨ Key Features
- ⚡ Async-first (built on
aiohttp) - 🔐 Secure header-based authentication
- 🧼 Clean SDK interface (no base URLs or backend details required)
- 🚫 No logic exposure (protected client implementation)
- 📦 PyPI-ready & production-stable
- 📡 Telegram-backed media delivery
- 🧠 Rate-limit & usage tracking enforced server-side
📦 Installation
Install directly from PyPI:
pip install BROKENXAPI
Requirements
- Python 3.8+
- Valid BROKENXAPI key
- Internet access
🔑 Authentication
BROKENXAPI uses header-based authentication.
You only need to provide your API key when creating the client.
Authorization: Bearer YOUR_API_KEY
- API keys are issued by Broken X Network
- Never share your API key publicly
- Rate limits are enforced automatically
🚀 Quick Start
import asyncio
from brokenxapi import BrokenXAPI
async def main():
async with BrokenXAPI(
api_key="BROKENXAPI-XXXX"
) as api:
result = await api.search("Arijit Singh")
print(result)
asyncio.run(main())
That’s it. No base URL. No configuration. No setup noise.
🔍 Search API
Search YouTube content using BrokenX backend.
Example
await api.search("lofi beats", video=False)
Parameters
| Name | Type | Description |
|---|---|---|
query |
str |
Search keyword |
video |
bool |
False = audio, True = video |
Response (Example)
{
"success": true,
"status": "found",
"title": "Lofi Beats",
"video_id": "abcd1234",
"duration": "3:24",
"thumbnail": "https://...",
"stream_url": "https://youtube.com/watch?v=abcd1234"
}
⬇️ Download API
Download audio or video using BrokenX’s processing pipeline.
Audio Download
await api.download("VIDEO_ID", media_type="audio")
Video Download
await api.download("VIDEO_ID", media_type="video")
Notes
- Files are delivered via Telegram hosting
- Cached results may be returned instantly
- Backend handles format selection and optimization
⚠️ Error Handling
All SDK errors inherit from BrokenXAPIError.
from brokenxapi.exceptions import BrokenXAPIError
try:
await api.download("invalid_id")
except BrokenXAPIError as e:
print("Error:", e)
Common Errors
- Invalid API key
- Rate limit exceeded
- Backend processing failure
- Network errors
🧠 Design Philosophy
BROKENXAPI follows a backend-first security model:
- SDK = thin, controlled client
- Backend = source of truth
- Logic is intentionally protected
- API keys are validated server-side only
Even if the SDK is copied, backend security remains intact.
📁 Documentation
Full documentation is available in the docs/ directory:
- Installation
- Authentication
- Search API
- Download API
- Examples
- Changelog
🧩 Versioning
This project follows semantic versioning.
| Version | Meaning |
|---|---|
MAJOR |
Breaking changes |
MINOR |
New features |
PATCH |
Bug fixes |
Current version: v2.0.0
📜 License
This project is licensed under the MIT License.
© 2025–2026 MR BROKEN
All Rights Reserved
🏁 Final Notes
- BROKENXAPI is designed for developers, bots, and backend services
- Not intended for browser-side usage
- Abuse, scraping, or misuse may result in key revocation
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file brokenxapi-2.0.0.tar.gz.
File metadata
- Download URL: brokenxapi-2.0.0.tar.gz
- Upload date:
- Size: 6.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a48704f211320a50d57c8d04015b8f1ead1f19ff34b3c4ea44833dfe7ff12e71
|
|
| MD5 |
c74ee613c77a322000decb1c71f24154
|
|
| BLAKE2b-256 |
389d4b6cd6f52f6231c9f8ab6a9f07f77daf8065141bc124ab93d81678735f30
|
File details
Details for the file brokenxapi-2.0.0-py3-none-any.whl.
File metadata
- Download URL: brokenxapi-2.0.0-py3-none-any.whl
- Upload date:
- Size: 7.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e54ff7b002a90528974011247fd0dc69317f660c34cc2c083ce6c72494949a2d
|
|
| MD5 |
d4867e7d0782dd9eabd5798c825438ba
|
|
| BLAKE2b-256 |
0c42f2ab1feef53192def5314f92dc34634b2466f3724c68858d806934d0d0fb
|