Home Quotex API
Technical guide · Python

Quotex API in Python: what exists and what does not

There is no official API. There is a community WebSocket library that works, breaks periodically, and is the only real route to automation — here is how to use it without wasting a weekend.

Short answer

No official API exists. The community library pyquotex reverse-engineers the platform's own WebSocket protocol. It works, it breaks after platform updates, and it is what our free bot is built on.

Why there is no official API

Regulated brokers publish APIs because institutional clients demand them and regulators expect auditable access. An offshore fixed-time options platform has neither pressure. There is no developer portal, no API key in your account settings, and no documentation — and any site claiming to link you to "the official Quotex API" is either mistaken or selling something.

What pyquotex actually does

The web platform communicates with its backend over a WebSocket connection. pyquotex authenticates the same way a browser session does, then speaks that protocol directly. The core surface is small:

MethodWhat it doesReliability
connect()Authenticates and opens the socketSession-sensitive
get_balance()Returns demo or live balanceStable
get_candles()Historical and streaming candles by timeframeStable
buy()Places an order with direction, amount and expiryStable
check_win()Polls the result of a placed orderCan hang
change_account()Switches between demo and liveStable
check_win() hanging is the most-reported problem. Wrap it in a timeout and fall back to reading the balance delta rather than waiting indefinitely.

The three errors that cost people a weekend

Login fails with valid credentials

Almost always a stale cached session rather than wrong credentials. Delete the session file the library writes on first login and authenticate again. If the platform pushed an update, reinstall the library from its repository — packaged releases lag behind protocol changes by days.

SSL handshake failure

Older Python builds and some corporate networks fail the handshake. Python 3.12 or later resolves it in most cases. On Windows, installing from python.org rather than the Microsoft Store avoids a certificate-store issue that produces the same symptom.

check_win() never returns

The result message occasionally does not arrive. Do not block on it. Set a timeout slightly longer than the expiry, and if it elapses, compare the account balance before and after to determine the outcome. Our bot does exactly this.

Latency from India

If you automate short expiries, where you run the bot matters — not because of any platform behaviour, but because network distance is real. The ranking below reflects typical path length from India; benchmark your own before paying for a VPS.

Typical network distance from India
Relative path length, not measured latency. Shorter is better for short expiries.
VPS · MumbaiShortest
Closest to you
VPS · SingaporeShort
Home broadband · IndiaVariable
Depends on your ISP and the hour
VPS · Europe or USLongest
Avoid for one-minute expiries

Indicative ranking based on network distance, not a benchmark we ran. Measure your own round trip before paying for anything — most providers offer a trial, and a single afternoon of testing beats any table on the internet.

Beyond raw latency, a VPS removes the risk of a home connection dropping mid-session — which for an unattended bot matters more than a few milliseconds. Benchmark before you commit: measure the round trip from your own machine first, then from a trial VPS, and only pay for the one that actually helps.

Skip the plumbing

If you want the API to place trades rather than to study the protocol, our free bot already wraps all of this — session handling, reconnection, the check_win() timeout, IST scheduling and logging. It is open source, so you can read exactly how each problem above is handled.

Straight answers

Quotex API — frequently asked

Does Quotex have an official API?

No. There is no documented, supported public API and no API key you can generate from your account. What exists are community libraries — pyquotex chief among them — that reverse-engineer the WebSocket protocol the web platform itself uses.

Is using an unofficial API against the terms?

The terms do not grant permission for automated access, so you are operating outside them. In practice the platform has tolerated it, but that is tolerance, not permission, and it can end without notice.

Why does my pyquotex login keep failing?

Most often a stale session file, a protocol change on the platform's side after an update, or an SSL handshake failure on older Python builds. Delete the cached session, upgrade to Python 3.12 or later, and reinstall the library from source before assuming your credentials are wrong.

Can I run it from a VPS?

Yes, and a Mumbai or Singapore region will generally give lower latency than a US or European one for a user in India, simply because the network path is shorter. If you automate short expiries it is worth benchmarking your own round-trip from each option rather than assuming.

Is automated trading legal in India?

Automation is not the issue. The platform's status is. On a demo account there is nothing to engage FEMA or the Income Tax Act. On a live account the same considerations apply as manual trading — the bot changes nothing about the legal position.

Keep reading

Related guides

Free tool · Open source

A free, open-source bot for Quotex

IaTraderPro Bot is a free Python robot with 13 built-in strategies and a web dashboard. Point it at a demo account, let it run, and read the log — you can also read every line of its source before you run it.

  • 13 strategies — RSI, MACD, SuperTrend, Ichimoku, Bollinger and nine more, all configurable
  • Runs on Quotex and IQ Option — demo or live account, your choice
  • Streamlit dashboard — no terminal needed once installed
  • Schedule in IST — set session windows in Indian time, not UTC
  • Open source — customise it with ChatGPT or Claude without knowing Python
₹0
Free forever. No paid version, no upsell.

Get the bot by email

Enter your email and we send the bot plus a step-by-step install guide.

    Bot + full tutorialWorks on demoNo spam

    Risk warning. Binary options are high-risk speculative products and the majority of retail traders lose money. A payout percentage is the return on a winning trade, not an expected return. Quotex is not authorised by SEBI and appears on the RBI Alert List; Indian residents remitting funds to unauthorised platforms may be exposed under FEMA and have no local dispute resolution. Nothing on this page is investment, legal or tax advice. Consult a SEBI-registered adviser and a chartered accountant before acting. Never trade money you cannot afford to lose entirely.