Skip to main content

A comprehensive, modern async Python API for PocketOption trading platform with enhanced security, stability, and performance fixes.

Project description

PocketOption API - By ChipaDevTeam

Join community

Support us

Join PocketOption with Six's affiliate link: Six PocketOption Affiliate link
Join PocketOption with Chipas affiliate link: Chipas PocketOption Affiliate link

A comprehensive, modern async Python API for PocketOption trading platform with advanced features including persistent connections, monitoring, and extensive testing frameworks.

IMPORTANT

This project is no longer actively developed, please switch to BinaryOptionsToolsV2

Key Features

Enhanced Connection Management

  • Complete SSID Format Support: Works with full authentication strings from browser (format: 42["auth",{"session":"...","isDemo":1,"uid":...,"platform":1}])
  • Persistent Connections: Automatic keep-alive with 20-second ping intervals (like the original API)
  • Auto-Reconnection: Intelligent reconnection with multiple region fallback
  • Connection Pooling: Optimized connection management for better performance

Advanced Monitoring & Diagnostics

  • Real-time Monitoring: Connection health, performance metrics, and error tracking
  • Diagnostics Reports: Comprehensive health assessments with recommendations
  • Performance Analytics: Response times, throughput analysis, and bottleneck detection
  • Alert System: Automatic alerts for connection issues and performance problems

Comprehensive Testing Framework

  • Load Testing: Concurrent client simulation and stress testing
  • Integration Testing: End-to-end validation of all components
  • Performance Benchmarks: Automated performance analysis and optimization
  • Advanced Test Suites: Edge cases, error scenarios, and long-running stability tests

Performance Optimizations

  • Message Batching: Efficient message queuing and processing
  • Concurrent Operations: Parallel API calls for better throughput
  • Caching System: Intelligent caching with TTL for frequently accessed data
  • Rate Limiting: Built-in protection against API rate limits

Robust Error Handling

  • Graceful Degradation: Continues operation despite individual failures
  • Automatic Recovery: Self-healing connections and operations
  • Comprehensive Logging: Detailed error tracking and debugging information
  • Exception Management: Type-specific error handling and recovery strategies

Installation

Via pip (Recommended)

pip install pocketoptionapi-async-enhanced

From Source

# Clone the repository
git clone <repository-url>
cd PocketOptionAPI

# Install dependencies
pip install -r requirements.txt

# For development
pip install -r requirements-dev.txt

Quick Start

Getting Your SSID

To use the API with real data, you need to extract your session ID from the browser:

  1. Open PocketOption in your browser
  2. Open Developer Tools (F12)
  3. Go to Network tab
  4. Filter by WebSocket (WS)
  5. Look for authentication message starting with 42["auth"
  6. Copy the complete message including the 42["auth",{...}] format

Example SSID format:

42["auth",{"session":"abcd1234efgh5678","isDemo":1,"uid":12345,"platform":1}]

If you are unable to find it, try running the automatic SSID scraper under the tools folder.

Common errors

Authentication timeout or connection immediately closes

If you see errors like:

WARNING | pocketoptionapi_async.websocket_client:receive_messages:395 - WebSocket connection closed
WARNING | pocketoptionapi_async.client:_start_regular_connection:245 - Failed to connect to region DEMO: Authentication timeout

Solution: Your SSID is likely in the wrong format or is expired. Make sure you are using the complete SSID format, not just the session ID:

Correct format:

SSID = '42["auth",{"session":"n1p5ah5u8t9438rbunpgrq0hlq","isDemo":1,"uid":84402008,"platform":1}]'

Wrong format (just the session):

SSID = 'dxxxxxxxxxxxxxxxxxxxxxxxxxxxx'  # This won't work!

To get the correct SSID:

  1. Open PocketOption in your browser
  2. Open Developer Tools (F12)
  3. Go to Network tab
  4. Filter by "WS" (WebSocket)
  5. Look for a message that starts with 42["auth",
  6. Copy the entire message including the 42["auth",{...}] part

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pocketoptionapi_async_enhanced-3.0.0.tar.gz (71.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pocketoptionapi_async_enhanced-3.0.0-py3-none-any.whl (50.9 kB view details)

Uploaded Python 3

File details

Details for the file pocketoptionapi_async_enhanced-3.0.0.tar.gz.

File metadata

File hashes

Hashes for pocketoptionapi_async_enhanced-3.0.0.tar.gz
Algorithm Hash digest
SHA256 1f05c1f485e91df956cd6fb5314c5e72f5783c679f0c3759606d3db2d387cf62
MD5 8dd0bafafebf96f534a634d2af8085f7
BLAKE2b-256 9155574b9bb8a6374ca5a51600400c9cbedcb2a3039e8b5f51150164e64c96d0

See more details on using hashes here.

File details

Details for the file pocketoptionapi_async_enhanced-3.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pocketoptionapi_async_enhanced-3.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a25f79941f34c4e9ed7fd0b2b1eeee9b7a5f5eeb240f2b201b255d3fdd01e6fc
MD5 3f50581f48a1c07c7f4b4b835edec904
BLAKE2b-256 0ca5b6ab5176c3cd0611cbec451ec3c02c5170c520e6f1cb0a67a8509cfff8e2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page