Enterprise-grade, 24/7 self-healing REST API & WebSocket wrapper for Quotex (Real & OTC asset pairs).
Designed to stream real-time price feeds, record 8-day M1 candle histories, and power automated binary options trading bots and signal generators.
Looking for the full, production-ready source code with complete rights and 1-on-1 developer support?
- 📦 100% Full Unlocked Source Code (
app.py,worker.py,database.py,pyquotex/engine). - 🚀 1-Click Automated Windows Launcher (
start_api.bat). - ⚡ Unlimited Personal & Commercial License (Deploy on unlimited VPS/servers).
- 🛠️ 24/7 Developer Support & Setup Assistance.
- 🔄 Lifetime Code Updates & Bug Fixes.
📩 Contact on Telegram to Buy: @usmanch069
💳 Accepted Payment Methods: USDT (TRC20), Binance Pay, Crypto.
- 📈 Configurable M1 Candle History: Automatically maintains a rolling historical database of closed M1 candles (configurable in .env via
RETENTION_DAYS=8) for all active Real & OTC asset pairs. - ⚡ Real-Time Sub-Second Ticks & Live Moving Candle: Continuous tick processing tracking the active unclosed minute candle (Open, High, Low, Close, Volume) in real-time.
- 🎯 Instant Trade Execution Engine: Place trades directly via simple 1-click URLs (
GET), JSON payloads (POST), or automated TradingView alerts (/webhook). - ⏱️ Flexible Expiry Modes: Full support for both
TIMEmode (clock-based expiration on all pairs) andTIMERmode (countdown timers on OTC pairs). - 🚫 Anti-Repaint Guarantee: Only finalized, closed candles are saved to the database. Running candles update live in memory to eliminate signal repainting.
- 💰 Historical Payout Rate Tracking: Every M1 candle entry stores the exact real-time payout percentage recorded at that specific minute.
- 🕒 Fully Configurable Timezone Support: All API JSON outputs format timestamps as
YYYY-MM-DD HH:MM:SSwith fully customizable timezone offsets (e.g. UTC, UTC+6, EST, IST, GMT, etc.). - 🔄 Dynamic 24/7 Asset Discovery: Automatically detects active markets (switching seamlessly between weekday forex and weekend OTC pairs) without requiring server restarts.
- 🛡️ Bulletproof Self-Healing Architecture:
- Replicates Google Chrome TLS fingerprints (
curl_cffiChrome 120) to bypass Cloudflare WAF anti-bot blocks onws2.qxbroker.com. - Automatically reconnects during network drops or socket disconnections.
- Automatically clears corrupted cookies and re-authenticates fresh.
- Automatically detects offline downtime gaps and backfills missing candles in the background.
- Replicates Google Chrome TLS fingerprints (
- 📊 Real-Time ASCII Terminal UI: Beautiful live console dashboard featuring colored status indicators, asset sync counters, and visual progress bars.
- 🌐 Interactive Glassmorphic Web Portal: Includes a modern dark-mode web portal at
http://127.0.0.1:8000/for visual testing and API querying.
api/
├── pyquotex/ # High-performance Quotex WebSocket Protocol Engine
├── app.py # FastAPI REST Server & Endpoint Routers
├── worker.py # Background Stream Manager & Downtime Gap-Filler
├── database.py # SQLite Persistence Controller & 8-Day Retention Daemon
├── start_api.bat # 1-Click Windows Production Launcher
├── requirements.txt # Python Dependencies
├── .env.example # Environment Configuration Template
├── BUYER_GUIDE.txt # Step-by-Step Customer Setup Guide
└── README.md # System Documentation
- Python 3.10+ (Ensure
Add Python to PATHis enabled). - Google Chrome Browser installed on your system.
Copy .env.example to .env and configure your Quotex login details:
email=your_quotex_email@gmail.com
password=your_quotex_password
timezone=UTC
RETENTION_DAYS=8Double-click **start_api.bat** (or run python -m uvicorn app:app --port 8000).
- Full Request URL:
http://127.0.0.1:8000/ - Description: Open in any web browser for interactive API querying and database candle statistics.
Returns all open/closed OTC and Real assets along with live payout rates.
- Endpoint:
/api/v1/markets - Full Example Request:
GET http://127.0.0.1:8000/api/v1/markets - Response Format:
{
"timezone": "UTC",
"total_assets": 2,
"data": [
{
"symbol": "EURUSD_otc",
"display_name": "EUR/USD",
"payout_percent": 92,
"is_active": true
},
{
"symbol": "GBPUSD_otc",
"display_name": "GBP/USD",
"payout_percent": 90,
"is_active": true
}
]
}Retrieves historical M1 candle records for a symbol in chronological order (oldest first). Automatically attaches the current active moving candle at the end.
- Endpoint:
/api/v1/candles - Full Example Request:
GET http://127.0.0.1:8000/api/v1/candles?symbol=EURUSD_otc&limit=1000&timezone=UTC - Query Parameters:
symbol(string, required): Asset pair name (e.g.EURUSD_otc,BTCUSD_otc).limit(integer, optional): Maximum candles to retrieve (default:1000, max:11520).timezone(string, optional): Target timezone offset (e.g.UTC,UTC+6,EST,IST,+5.5). Defaults to.envtimezonesetting.include_running(bool, optional): Automatically attaches the active live moving candle at the end (default:true).
- Response Format:
{
"symbol": "EURUSD_otc",
"timeframe": "1m",
"timezone": "UTC",
"candle_count": 2,
"candles": [
{
"time": "2026-09-16 14:19:00",
"open": 1.09245,
"high": 1.09260,
"low": 1.09240,
"close": 1.09255,
"volume": 42,
"payout": 92
},
{
"time": "2026-09-16 14:20:00",
"open": 1.09255,
"high": 1.09280,
"low": 1.09250,
"close": 1.09275,
"volume": 58,
"payout": 92,
"is_running": true
}
]
}Returns the real-time sub-second price and unclosed minute candle. Ideal for real-time tickers and live chart polling.
- Endpoint:
/api/v1/live - Full Example Request:
GET http://127.0.0.1:8000/api/v1/live?symbol=EURUSD_otc&timezone=UTC - Response Format:
{
"symbol": "EURUSD_otc",
"timezone": "UTC",
"status": "live",
"running_candle": {
"time": "2026-09-16 14:20:00",
"open": 1.09255,
"high": 1.09280,
"low": 1.09250,
"close": 1.09275,
"volume": 58,
"payout": 92,
"is_running": true
}
}Places a trade directly from a simple URL or GET request. Ideal for browser bookmarks, webhooks, and 1-click links.
- Endpoint:
/api/v1/trade - Example Request:
GET http://127.0.0.1:8000/api/v1/trade?symbol=EURUSD_otc&action=call&amount=1&duration=60&time_mode=TIMER&account_type=PRACTICE - Parameters:
symbol(string, required): Asset name (e.g.EURUSD_otc,EURUSD).action(string, required):call(UP) orput(DOWN).amount(float, optional): Stake amount in $ (default:1.0).duration(integer, optional): Expiry in seconds (e.g.5,30,60,300). Default:60.time_mode(string, optional):TIME(clock expiration on all pairs) orTIMER(countdown timer on OTC pairs). Default:TIME.account_type(string, optional):PRACTICE(Demo) orREAL. Default:PRACTICE.
Places a trade using a JSON payload. Ideal for Python bots, cURL, and automated systems.
- Endpoint:
/api/v1/trade - Method:
POST - Payload Example:
{
"symbol": "EURUSD_otc",
"action": "call",
"amount": 1.0,
"duration": 60,
"time_mode": "TIMER",
"account_type": "PRACTICE"
}- Response Format:
{
"status": "success",
"symbol": "EURUSD_otc",
"action": "CALL",
"amount": 1.0,
"duration": 60,
"time_mode": "TIMER",
"account_type": "PRACTICE",
"order_id": 182749102,
"open_price": 1.09255
}Universal webhook receiver for TradingView Pine Script alerts.
- Endpoint:
/webhook - Method:
POST - TradingView Alert Message:
{
"symbol": "{{ticker}}",
"action": "call",
"amount": 1.0,
"duration": 60,
"time_mode": "TIME",
"account_type": "PRACTICE"
}- Initial Chart Render: Call
GET /api/v1/candles?symbol=EURUSD_otc&limit=500to render historical candles on TradingView Lightweight Charts or custom canvas. - Live Candle Updates: Poll
GET /api/v1/live?symbol=EURUSD_otcevery 1 second (sub-millisecond RAM response) to animate the active ticking candle. - MT4 / MT5 Sync: Use standard MQL4/MQL5
WebRequest()to pull candle feeds into offline charts and send trade orders to/api/v1/trade.
Includes an interactive CLI tool (delete_asset.py) allowing you to selectively delete candle history for specific asset pairs or clear the entire database.
python delete_asset.py- Lists all asset pairs currently stored in
qxbroker.dbwith exact candle counts. - Enter a pair number (e.g.
1,2) or symbol name (EURUSD_otc) to purge candles for a single asset. - Type
ALLto purge the complete database. - Confirms before executing deletions to prevent accidental data loss.
quotex api · quotex otc api · quotex python wrapper · quotex websocket bot · binary options api · quotex signal bot · fastapi quotex · quotex payouts api · quotex history candles · quotex auto trading
For sales inquiries, custom feature additions, or integration help, message directly on Telegram:
👉 @usmanch069
This software is provided for educational and personal use only. Trading financial instruments carries significant risk of loss. The authors are not responsible for any financial losses incurred through the use of this software. Always test on a demo account before using with live funds.