PyQuotex

pyquotex is a Python library designed to easily integrate with the Quotex API, enabling automated trading operations. Fully open-source and licensed under MIT, the library provides features like order execution, balance checking, real-time market data collection, and more. Perfect for traders and developers looking to build efficient and customized solutions.

View the Project on GitHub cleitonleonel/pyquotex

PyQuotex Installation and Configuration

Table of Contents

System Requirements

To use PyQuotex, you’ll need:

Main Dependencies

websockets>=12.0
httpx>=0.27.0
orjson>=3.9.0
beautifulsoup4>=4.12.3
pyfiglet>=1.0.2
fake-useragent==2.2.0
certifi
rich
numpy

Installation

From pip

You can install PyQuotex directly from GitHub using pip:

pip install git+https://github.com/cleitonleonel/pyquotex.git

From GitHub and Poetry

You can also clone the repository and perform a local installation:

git clone https://github.com/cleitonleonel/pyquotex.git
cd pyquotex
poetry install

Initial Setup

To start using PyQuotex, first import and configure the client:

from pyquotex.stable_api import Quotex

client = Quotex(
    email="your_email@gmail.com",
    password="your_password",
    lang="en"  # Default language: "pt" (Portuguese)
)

# Enable debug mode (optional)
client.debug_ws_enable = True

Initialization Parameters

Parameter Type Default Description
email str None Quotex account email
password str None Account password
host str “qxbroker.com” Platform host
lang str “pt” Language (pt, en, es)
user_agent str “Quotex/1.0” User-Agent for requests
root_path str ”.” Root directory
user_data_dir str “browser” Browser data directory
asset_default str “EURUSD” Default asset
period_default int 60 Default period in seconds
proxies dict None Proxy configuration

Credentials Management

There are two main ways to handle credentials:

1. Configuration File

PyQuotex will automatically look for a config.ini file in the settings folder. If it doesn’t exist, it will create one requesting credentials:

[settings]
email=your_email@gmail.com
password=your_password

2. Direct Configuration

You can provide credentials directly when creating the client instance:

client = Quotex(
    email="your_email@gmail.com",
    password="your_password"
)

SSL/TLS Configuration

PyQuotex uses a Unified SSL Context supporting TLS 1.2 and 1.3 with full certificate verification and browser-like cipher suites for maximum security and stealth.

How it works internally

PyQuotex automatically configures the SSL context:

import ssl
import certifi

# SSL context configured by the library
# Unified SSL context used for both HTTP and WebSocket
unified_ssl_context = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)
unified_ssl_context.minimum_version = ssl.TLSVersion.TLSv1_2
unified_ssl_context.maximum_version = ssl.TLSVersion.TLSv1_3
unified_ssl_context.set_ciphers('ECDHE-ECDSA-AES128-GCM-SHA256:...') # Browser-like ciphers
unified_ssl_context.load_verify_locations(certifi.where())

Security measures applied:

Windows

For Windows, OpenSSL with TLS 1.3 support is required:

  1. Download the installer from Openssl-Windows
  2. Install following the installer instructions

Linux

sudo apt update
sudo apt install openssl

For more information and support, you can join the community Telegram group.