अगर आप Python में IQ Option की API ढूँढ रहे हैं, तो पहला honest सच यह है: IQ Option के पास retail accounts के automation के लिए कोई official public API नहीं है। GitHub पर जो कुछ भी घूम रहा है — popular library pyiqoptionapi (पुराने iqoptionapi का maintained fork) समेत — site के इस्तेमाल किए जाने वाले WebSocket channel की reverse engineering है। काम करती है, लेकिन grey zone में रहती है और broker के किसी भी update पर टूट सकती है। यह guide असली methods, examples और risks दिखाती है।

हर हफ़्ते गिरने वाली unofficial library से लड़े बिना automate करना चाहते हैं? तैयार alternative देखें:

▶ Python में IQ Option bot और integration देखें

क्या IQ Option की official API है?

आम trader के लिए नहीं। IQ Option कुछ corporate cases में partnership/affiliates के ज़रिए integrations देती है, लेकिन individual accounts के लिए trading API की कोई documentation publish नहीं करती। इसीलिए सारा automation ऐसी libraries पर टिका है जो browser की नक़ल करती हैं — WebSocket endpoint wss://iqoption.com/echo/websocket से connect होकर वही commands भेजती हैं जो site भेजती।

Practical नतीजा: चूँकि कुछ भी official नहीं है, broker protocol बदल सकती है, captcha माँग सकती है, या automated use की वजह से account block कर सकती है। हमेशा पहले demo account इस्तेमाल करें और कभी ऐसा पैसा risk न करें जिसे आप खो नहीं सकते।

Library का installation

सबसे active fork आमतौर पर pyiqoptionapi होता है। typical installation:

pip install pyiqoptionapi # repository se seedha alternative: pip install git+https://github.com/iqoptionapi/iqoptionapi.git

Connection और login

entry point main class है। connect() method एक tuple (status, reason) return करता है — आगे बढ़ने से पहले हमेशा status check करें:

from iqoptionapi.stable_api import IQ_Option import logging logging.basicConfig(level=logging.INFO) api = IQ_Option(“apna_email”, “apna_password”) status, reason = api.connect() if status: print(“Connected!”) else: print(“Failed:”, reason) # Testing ke dauran HAMESHA demo par kaam kare: api.change_balance(“PRACTICE”) # ya “REAL” print(“Balance:”, api.get_balance())

मुख्य methods जो आप इस्तेमाल करेंगे

रोज़मर्रा में सबसे common methods ये हैं (नाम forks के बीच बदल सकते हैं — installed version check करें):

Account और balance: connect(), check_connect(), change_balance("PRACTICE"/"REAL"), get_balance(), reset_practice_balance().
Quotes / candles: get_candles(asset, interval, count, end_time), start_candles_stream(), get_realtime_candles(), stop_candles_stream().
Binary orders: buy(amount, asset, direction, expiration) return करता है (check, id); result check_win_v4(id) से track करें या digital options के लिए check_win_digital_v2(id)

Example: candles पढ़ना और एक order भेजना (DEMO में)

asset = “EURUSD” # abhi tak ki 1 minute ki 10 candles import time candles = api.get_candles(asset, 60, 10, time.time()) last = candles[-1] print(“Close:”, last[“close”]) # 1 dollar ka binary order, CALL, 1 minute expiration direction = “call” # ya “put” amount = 1 expiration = 1 check, order_id = api.buy(amount, asset, direction, expiration) if check: result, profit = api.check_win_v4(order_id) print(“Result:”, result, “Profit/Loss:”, profit) else: print(“Order rejected”)
Robustness tip: calls को try/except में wrap करें और check_connect() से reconnect करें। WebSocket बार-बार गिरता है, और बिना reconnection वाला loop बस hang हो जाता है।

आम errors (और वे क्यों होते हैं)

ज़्यादातर problems आपके code का bug नहीं, बल्कि broker की तरफ़ का बदलाव होती हैं:

सही password के बावजूद login fail → captcha/2FA या anti-bot block।
लंबे loops में connection गिरना → reconnection और keep-alive की कमी।
get_candles खाली → उस समय asset बंद या symbol का नाम ग़लत।
Library अचानक काम करना बंद कर दे → IQ Option ने protocol update किया; नए fork का इंतज़ार करें।

क्या IQ Option को automate करना worth it है?

सीखने और demo में ideas test करने के लिए, हाँ — यह एक बढ़िया lab है। real पैसे से operate करने से पहले सोचें: आप ऐसे unofficial code पर निर्भर हैं जो टूट सकता है, और कोई भी automation binary options (payout की वजह से negative-sum game) को guaranteed income में नहीं बदलता। अगर लक्ष्य stability है, तो सचमुच documented API वाली brokers पर विचार करें, जैसे Deriv, या पहले से tested ready-made solutions।

FAQ

क्या pyiqoptionapi safe है? code open और auditable है, लेकिन आप उसे अपना email और password देते हैं। exclusive password इस्तेमाल करें और preferably demo account।

क्या इस्तेमाल करने पर ban हो सकता है? हाँ। automation आम तौर पर terms of use का उल्लंघन करता है। broker account बंद कर सकती है।

क्या यह digital options के साथ काम करती है? हाँ, specific methods हैं (buy_digital_spot, check_win_digital_v2), लेकिन ये versions के बीच ज़्यादा बदलते हैं।

क्या कोई ज़्यादा stable alternative है? Deriv के पास official documented API है। Quotex automation के लिए हमारी pyquotex Python guide देखें। IQ Option के लिए ready-made solutions maintenance का काम घटाती हैं।

Disclaimer: binary options बेहद high-risk products हैं और ज़्यादातर retail traders पैसा गँवाते हैं। यह content educational है, investment recommendation नहीं है, और unofficial libraries broker की terms का उल्लंघन कर सकती हैं। किसी भी real operation से पहले हमेशा demo account पर test करें।

Similar Posts