अगर आप 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 भेजती।
Library का installation
सबसे active fork आमतौर पर pyiqoptionapi होता है। typical installation:
Connection और login
entry point main class है। connect() method एक tuple (status, reason) return करता है — आगे बढ़ने से पहले हमेशा status check करें:
मुख्य methods जो आप इस्तेमाल करेंगे
रोज़मर्रा में सबसे common methods ये हैं (नाम forks के बीच बदल सकते हैं — installed version check करें):
connect(), check_connect(), change_balance("PRACTICE"/"REAL"), get_balance(), reset_practice_balance().
get_candles(asset, interval, count, end_time), start_candles_stream(), get_realtime_candles(), stop_candles_stream().
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 में)
try/except में wrap करें और check_connect() से reconnect करें। WebSocket बार-बार गिरता है, और बिना reconnection वाला loop बस hang हो जाता है।
आम errors (और वे क्यों होते हैं)
ज़्यादातर problems आपके code का bug नहीं, बल्कि broker की तरफ़ का बदलाव होती हैं:
लंबे 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 करें।
