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

playwright>=1.44.0
websocket-client>=1.8.0
requests>=2.31.0
beautifulsoup4>=4.12.2

Installation

From pip

You can install PyQuotex directly from GitHub using pip:

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

From GitHub

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

git clone https://github.com/cleitonleonel/pyquotex.git
cd pyquotex
pip install -r requirements.txt

Installing Browsers for Playwright

After installing PyQuotex, you need to install the necessary browsers for Playwright:

playwright install

Initial Setup

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

from quotexapi.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

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

Windows

For Windows, it’s necessary to install the latest version of OpenSSL:

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

Linux

On Linux systems, update OpenSSL using the package manager:

sudo apt update
sudo apt install openssl

SSL Configuration in Code

PyQuotex handles SSL configuration automatically, but you can customize it:

import ssl
import certifi

# SSL context configuration to use TLS 1.3
ssl_context = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)
ssl_context.options |= ssl.OP_NO_TLSv1 | ssl.OP_NO_TLSv1_1 | ssl.OP_NO_TLSv1_2
ssl_context.minimum_version = ssl.TLSVersion.TLSv1_3
ssl_context.load_verify_locations(certifi.where())

Certificate Management

PyQuotex uses SSL certificates for secure connections:

import os
import certifi

# Configure certificate path
cert_path = os.path.join("../", "quotex.pem")
os.environ['SSL_CERT_FILE'] = cert_path
os.environ['WEBSOCKET_CLIENT_CA_BUNDLE'] = cert_path

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