🐍 Advanced Tutorial

Python + IQ Option API Unofficial — ईमानदार Guide

लेखक: Dan Machado · मई 2026 · 12 मिनट · स्तर: Advanced

IQ Option के पास कोई official API नहीं है, लेकिन GitHub पर एक community-maintained Python library है: iqoptionapi। यह आपको trades automate करने देती है — महत्वपूर्ण caveats के साथ।

इस tutorial में, मैं आपको दिखाऊँगा कि इसे कैसे उपयोग करें, इसमें शामिल risks, और automation के लिए Deriv क्यों एक बहुत बेहतर alternative है।

⚠️ जारी रखने से पहले ध्यान दें

iqoptionapi unofficial है। IQ Option पर automation का उपयोग terms of service का उल्लंघन कर सकता है और account ban का परिणाम हो सकता है। केवल demo account पर शैक्षिक उद्देश्यों के लिए उपयोग करें। Live account पर bots चलाने के लिए, Deriv का उपयोग करें (जिसके पास official API है)।

iqoptionapi क्या है?

यह GitHub पर hosted एक open-source Python library है (github.com/Lu-Yi-Hsun/iqoptionapi और forks)। यह IQ Option के internal endpoints को reverse-engineer करती है ताकि:

  • Email/password के साथ Login
  • Balance और history check करें
  • Binary options trades execute करें (Rise/Fall, Turbo)
  • Real-time quotes प्राप्त करें
  • Historical candle data तक access

📌 Project status

Original project का maintenance limited है। अधिक active forks हैं। API किसी भी समय break हो सकता है जब IQ Option अपने internal endpoints बदलता है — यह कई बार पहले हो चुका है। यह 24/7 trading के लिए reliable नहीं है।

महत्वपूर्ण risks

  • Account ban: IQ Option automated traffic detect कर सकता है और आपका account ban कर सकता है
  • बार-बार breakage: Platform updates बिना notice के API break कर देते हैं
  • कोई official support नहीं: यदि कुछ fail हो, आप अकेले हैं
  • Credentials at risk: आपको code में login/password डालना होगा
  • ToS violation: IQ Option के terms of service का उल्लंघन कर सकता है
  • केवल Demo: अध्ययन और testing के लिए, यह relatively safe है

Installation

Terminal
pip install iqoptionapi

Basic Code

Python · iqoptionapi📋 Copy
"""
Basic example — IQ Option API (unofficial)
IA Trader Pro — iatraderpro.com/

WARNING: Use ONLY on a DEMO account.
Automation can get your account banned.
"""

from iqoptionapi.stable_api import IQ_Option
import time
import logging

# === CONFIG ===
EMAIL = "your_email@example.com"
PASSWORD = "your_password"
ASSET = "EURUSD"
STAKE = 1  # Amount in USD
DURATION = 1  # Duration in minutes
DIRECTION = "call"  # "call" or "put"

# === CONNECT ===
print("🔐 Connecting to IQ Option...")
api = IQ_Option(EMAIL, PASSWORD)
api.connect()

if not api.check_connect():
    print("❌ Failed to connect. Check credentials.")
    exit()

print("✅ Connected!")

# === SWITCH TO DEMO ACCOUNT ===
api.change_balance("PRACTICE")  # "PRACTICE" = demo, "REAL" = live
balance = api.get_balance()
print(f"💰 Demo balance: ${balance}")

# === CHECK ASSET ===
open_assets = api.get_all_open_time()
if not open_assets["turbo"][ASSET]["open"]:
    print(f"❌ Asset {ASSET} is closed right now")
    exit()

# === EXECUTE TRADE ===
print(f"📈 Opening {DIRECTION.upper()} on {ASSET} | Stake: ${STAKE} | Duration: {DURATION}min")
status, order_id = api.buy(STAKE, ASSET, DIRECTION, DURATION)

if status:
    print(f"✅ Order executed. ID: {order_id}")
else:
    print("❌ Order failed")
    exit()

# === WAIT FOR RESULT ===
print("⏳ Waiting for result...")
result = api.check_win_v4(order_id)
profit = result[1]

if profit > 0:
    print(f"🟢 WIN! Profit: +${profit:.2f}")
elif profit == 0:
    print(f"⚪ DRAW")
else:
    print(f"🔴 LOSS! Loss: ${profit:.2f}")

# === FINAL BALANCE ===
final_balance = api.get_balance()
print(f"💰 Final balance: ${final_balance}")

उपयोगी functions

Python
# Get historical candles (last 100 of 1 minute)
candles = api.get_candles(ASSET, 60, 100, time.time())

# Real-time quote
price = api.get_price_now(ASSET, "turbo")

# Check if asset is open
is_open = api.get_all_open_time()["turbo"][ASSET]["open"]

# Trade history
history = api.get_position_history("turbo-option")

# Close connection
api.close_connect()

Deriv क्यों बेहतर है

ईमानदारी से, 2026 में automation के लिए, Deriv हर पहलू में simply superior है:

  • Official documented API api.deriv.com पर
  • Automation को प्रोत्साहित करता है — अपना खुद का no-code “Deriv Bot” है
  • API उपयोग के लिए शून्य ban जोखिम
  • Stable WebSocket OAuth 2.0 के साथ
  • Official support जब कुछ टूटे
  • Deriv MT5 + cTrader भी उपलब्ध
  • 24/7 synthetic indices (Volatility 75, आदि)

🏆 सिफारिश

यदि आप Python के साथ serious automation चाहते हैं, official Deriv API का उपयोग करें। हमारा complete Python + Deriv API tutorial देखें। यह अधिक professional, safer, और officially supported है।

🚀 Python automation के लिए, हम Deriv की strongly सिफारिश करते हैं:

🟢 मुफ्त Deriv Account खोलें IQ Option खोलें (manual)
DM

Dan Machado

और यहाँ से शुरू करें में।

⚠️ शैक्षिक content। iqoptionapi unofficial है और account ban का कारण बन सकता है। केवल demo पर उपयोग करें। Affiliate links शामिल हैं। Disclaimer