Official Python SDK for the Discard Rest APIs providing access to 500+ endpoints across multiple categories. A hub of RESTful APIs for developers β from downloaders and AI tools to image processing, games, and converters β everything you need to elevate your applications.
A Python client library for interacting with the Discard API.
Provides a simple, typed interface for making API calls and handling responses efficiently.
Explore our complete catalog and documentation at discardapi.dpdns.org
Welcome to Discard Rest APIs, your one-stop solution for seamless API integrations! Our extensive collection of APIs is designed for developers building apps, businesses enhancing services, or tech enthusiasts experimenting with new ideas.
Step 1: Sign Up & Get Your API Key Signup
- Create an account to access our API dashboard. Signing up is quick and easy, providing instant access to hundreds of powerful APIs.
Step 2: Choose an API Endpoints
- Browse our comprehensive API library and select the API that fits your needs. Each API includes detailed documentation with endpoints, parameters, and response formats.
Step 3: Make Your First API Call
- With your API key in hand, you're ready to start! All our APIs follow REST principles and are designed for simple, intuitive integration.
Step 4: Some Features Are Premium Only π
- For extensive usage and advanced features, upgrade to a PRO or VIP plan offering higher limits, faster response times, and premium feature access.
pip install discard-apifrom discard import DiscardAPI
# Initialize the SDK
api = DiscardAPI(api_key="your_api_key_here")
# Use any endpoint
result = api.ai.gemini_pro("What is artificial intelligence?")
print(result)- β Complete API Coverage: All 30+ categories with 500+ endpoints
- β Type Hints: Full type annotations for better IDE support
- β Error Handling: Comprehensive error handling
- β Context Manager: Automatic session cleanup
- β File Uploads: Support for multipart/form-data uploads
- β Flexible Configuration: Customizable timeout, base URL, and response format
- Islamic - Quran, Hadith, Prayer times, Islamic books
- AI - Gemini, Llama, Mistral, Image generation (Stable Diffusion, DALL-E, Flux)
- Anime - Anime reaction images
- Apps - APK search and download from multiple sources
- Chatbots - Multiple AI chatbot models
- Canvas - Image overlay effects
- Codec - Encoding/decoding (Base64, Base32, Binary, etc.)
- Shortener - URL shortening services
- AudioDB - Music database API
- Quotes - Various quote collections
- Downloads - Social media downloaders (TikTok, Instagram, YouTube, etc.)
- ImageMakers - QR codes, barcodes, text-to-image
- Music - Spotify, SoundCloud, lyrics
- Jokes - Multiple joke categories
- Images - Random image collections
- Facts - Historical and mathematical facts
- Faker - Fake data generation
- FakeStore - Mock e-commerce API
- News - International news sources
- Stalker - Profile information lookup
- Search - Web search engines
- Tools - Utility tools (translate, screenshot, etc.)
- Memes - Meme generators
- Time - Timezone and time conversion
- PhotoOxy - Photo effects
- Ephoto360 - Advanced photo effects
- ImageProcess - Image processing (resize, crop, filters, etc.)
- Information - Weather, IP info, country data, etc.
- TempMail - Temporary email services
- Uploads - File upload services
- Random - Random data and games
# Text generation with Gemini
response = api.ai.gemini_pro("Explain quantum computing")
# Image generation with Stable Diffusion
image = api.ai.stable_diffusion("A beautiful sunset over mountains")
# AI chatbot
chat = api.chatbots.llama_bot("How are you?")# Download Instagram post
insta = api.downloads.instagram("https://www.instagram.com/p/example")
# Download TikTok video (no watermark)
tiktok = api.downloads.tiktok("https://vm.tiktok.com/example")
# Download YouTube video
youtube = api.downloads.youtube_video("https://youtube.com/watch?v=example", format="720")
# Clone GitHub repository
repo = api.downloads.gitclone("https://github.com/user/repo")# Remove background
with open("photo.jpg", "rb") as f:
no_bg = api.imageprocess.remove_bg(f)
# Resize image
with open("photo.jpg", "rb") as f:
resized = api.imageprocess.resize(f, "800", "600")
# Apply filters
with open("photo.jpg", "rb") as f:
sepia = api.imageprocess.sepia(f)
cartoon = api.imageprocess.cartoon(f)
sketch = api.imageprocess.sketch(f, style="Charcoal")# Translate text
translation = api.tools.translate("Hello world", "es")
# Generate QR code
qr = api.imagemakers.qrcode("https://example.com")
# Screenshot website
screenshot = api.tools.screenshot("https://github.com")
# Get weather
weather = api.information.weather_city("London")
# Shorten URL
short = api.shortener.tiny("https://very-long-url.com")# Get latest news
cnn = api.news.cnn_news()
bbc = api.news.sky_news()
# Get country information
country = api.information.country_info("Japan")
# Get IP information
ip_info = api.information.ip_info("8.8.8.8")
# Search Wikipedia
wiki = api.information.wikipedia("Artificial Intelligence")# Stalk profiles
github = api.stalker.github_stalk("username")
instagram = api.stalker.instagram_stalk("username")
twitter = api.stalker.twitter_stalk("username")
# Get trends
trends = api.information.x_trends("Pakistan")# Drake meme
drake = api.memes.drake_hotline("Python", "Go")
# Distracted boyfriend meme
meme = api.memes.distracted_boyfriend("Rust", "Me", "Go")
# Custom meme
custom = api.memes.custom_meme("template_id", "text1", "text2")# Upload to Catbox (permanent)
with open("document.pdf", "rb") as f:
catbox = api.uploads.catbox(f)
# Upload to ImgBB (7 days)
with open("image.png", "rb") as f:
imgbb = api.uploads.imgbb(f)
# Upload to Gofile (permanent)
with open("video.mp4", "rb") as f:
gofile = api.uploads.gofile(f)# Create temporary email
mail = api.tempmail.create_mail("password123")
print(f"Email: {mail['address']}")
print(f"Token: {mail['token']}")
# Check inbox
inbox = api.tempmail.mail_inbox(token=mail['token'])
# Read specific message
message = api.tempmail.message_id(token=mail['token'], id="message_id")# Search Spotify
spotify = api.music.spotify_search("Bohemian Rhapsody")
# Get lyrics
lyrics = api.music.lyrics("never gonna give you up")
# Search SoundCloud
soundcloud = api.music.soundcloud_search("remix")
# Download Spotify track (Pro plan)
track = api.music.spotify_download("https://open.spotify.com/track/...")# Custom configuration
api = DiscardAPI(
api_key="your_api_key_here",
base_url="https://discardapi.dpdns.org", # Custom base URL
full_response=True, # Get full API response including metadata
timeout=60 # Request timeout in seconds
)
# Get full response with metadata
response = api.jokes.random()
print(f"Creator: {response.creator}")
print(f"Status: {response.status}")
print(f"Result: {response.result}")
# Update settings dynamically
api.client.set_full_response(False)
api.client.set_timeout(30)
api.client.set_api_key("new_api_key")# Automatic session cleanup
with DiscardAPI(api_key="your_api_key_here") as api:
result = api.ai.gemini_pro("Hello!")
print(result)
# Session is automatically closedtry:
api = DiscardAPI(api_key="your_api_key_here")
result = api.downloads.instagram("invalid_url")
except ValueError as e:
print(f"Configuration error: {e}")
except Exception as e:
print(f"API error: {e}")All methods follow Python naming conventions (snake_case) and are organized by category:
api.islam.*- Islamic resourcesapi.ai.*- AI and image generationapi.downloads.*- Media downloadersapi.imageprocess.*- Image processingapi.tools.*- Utility toolsapi.search.*- Search enginesapi.news.*- News sourcesapi.stalker.*- Profile lookups- And many more...
Methods that require file uploads accept file-like objects:
# Using context manager (recommended)
with open("image.jpg", "rb") as f:
result = api.imageprocess.remove_bg(f)
# Or with file object
file = open("image.jpg", "rb")
result = api.imageprocess.remove_bg(file)
file.close()By default, the SDK returns just the result data. Set full_response=True to get the complete API response:
# Default behavior (result only)
api = DiscardAPI(api_key="key")
result = api.jokes.dad() # Returns the joke directly
# Full response mode
api = DiscardAPI(api_key="key", full_response=True)
response = api.jokes.dad()
print(response.creator) # API creator
print(response.status) # Request status
print(response.result) # Actual resultCheck the API documentation for specific endpoint requirements.
The API may have rate limits. Handle them appropriately:
import time
def retry_with_backoff(func, max_retries=3):
for i in range(max_retries):
try:
return func()
except Exception as e:
if i < max_retries - 1:
time.sleep(2 ** i) # Exponential backoff
continue
raise e
# Usage
result = retry_with_backoff(lambda: api.ai.gemini_pro("Hello"))quran_surah(),prayer_timing(),hadit(),tahlil(),wirid(),dua_harian(),ayat_kursi(),search_books(),get_books()
gemini_pro(),gemini_flash(),llama_ai(),mistral_ai(),qwen_coder(),flux_schnell(),stable_diffusion(),dalle()
anime_nom(),anime_poke(),anime_cry(),anime_kiss(),anime_pat(),anime_hug()
android_one_search(),apk_mirror_search(),play_store_search(),steam_app(),happy_mod()
llama_bot(),qwen_bot(),baidu_bot(),gemma_bot(),spark_bot(),glm_bot()
circle(),bisexual(),heart(),lgbtq(),tonikawa(),simpcard()
base64(),base32(),base16(),binary(),brainfuck(),interpreter()
isgd(),tiny(),bitly(),vgd(),unshort()
search_artist(),search_track(),search_albums(),trending_albums(),top_tracks()
commit_message(),pickup_lines(),tech_tips(),coding_tips(),islamic_quotes(),stoic_quotes()
facebook(),instagram(),tiktok(),twitter(),youtube_video(),youtube_audio(),spotify(),pinterest_search(),reddit(),snapchat()
qrcode(),barcode_128(),emoji_mix(),carbon_image(),welcome_image()
spotify_search(),spotify_download(),soundcloud_search(),lyrics(),ringtones()
dad(),general(),programming(),dark(),random(),animal(),science()
couple(),pizza(),tech(),game(),mountain(),cat(),dog()
date_fact(),year_fact(),math_fact(),trivia_fact(),useless_facts()
fake_user(),fake_users(),fake_addresses(),fake_persons(),fake_products()
all_products(),get_product(),add_product(),update_product(),delete_product(),all_carts(),login()
cnn_news(),bbc_news(),sky_news(),aljazeera_english(),fox_news(),guardian_news()
github_stalk(),instagram_stalk(),twitter_stalk(),tiktok_stalk(),npm_stalk()
google_search(),bing_search(),youtube_search(),movies_search(),manga_toon()
translate(),screenshot(),detect_lang(),mathematics(),whois_lookup(),port_scanner()
drake_hotline(),distracted_boyfriend(),success_kid(),disaster_girl(),trending_memes()
time_by_zone(),time_convert(),day_of_week(),day_of_year()
pubg_banner(),battlefield(),tiktok_effect(),neon_effect()
deadpool(),thor_logo(),captain_america(),pubg_logo(),blackboard()
remove_bg(),resize(),crop(),rotate(),flip(),grayscale(),sepia(),cartoon(),sketch(),blur(),sharpen()
weather_city(),country_info(),ip_info(),wikipedia(),crypto_info()
create_mail(),mail_inbox(),message_id(),delete_account()
catbox(),gofile(),imgbb(),pixeldrain(),gyazo()
sudoku_generate(),world_wonders(),age_guess(),gender_guess(),random_advice()
Contributions are welcome! Please feel free to submit a Pull Request.
MIT License - feel free to use this SDK in your projects.
For issues and questions:
- GitHub Issues: Create an issue
- API Documentation: Explore Complete Catalog
- Discord: Join our community
- Initial release
- Complete API coverage for all 30+ categories
- 500+ endpoints implemented
- File upload support
- Context manager support
- Comprehensive error handling
- Type hints support
Created by the Discard API Team. Python SDK maintained by the community.
Email Support β discardapi@gmail.com
Live Chat β Chat on WhatsApp
Community Support β Join our Discord Server
Documentation β GitHub Examples
- β Premium Support β < 1 hour
- π Free Support β < 24 hours
Β© 2025 Discard API β Built with Go & Fiber
Note: Replace your_api_key_here with your actual API key. Get your API key from the Discard API website.