PocketOptionAPI Async

Environment Setup Guide for Termux

This guide will help you set up PocketOptionAPI on Termux, allowing you to run trading scripts directly from your Android device.

1. Termux Installation

First, you need to install Termux on your Android device:

2. Update Termux Packages

After installing Termux, open it and update the package repository:

pkg update && pkg upgrade

Press Y when prompted to confirm the updates.

3. Install Required Packages

Install Python and Git, which are required to run PocketOptionAPI:

pkg install python git

4. Clone the Repository

Clone the PocketOptionAPI repository to your Termux environment:

git clone https://github.com/ChipaDevTeam/PocketOptionAPI.git
cd PocketOptionAPI

5. Install Python Dependencies

Install all required Python packages using pip:

pip install -r requirements.txt

Note: This may take several minutes depending on your internet connection.

6. Configuration

Set up your API credentials:

  1. Copy the example environment file:
    cp .env.example .env
  2. Edit the .env file with your SSID:
    nano .env
  3. Add your SSID (see Quickstart guide for how to get your SSID):
    SSID = '42["auth",{"session":"your_session_here","isDemo":1,"uid":12345,"platform":1}]'
  4. Save and exit (Press Ctrl+X, then Y, then Enter)

7. Run Your First Script

Test your setup by running one of the example scripts:

python examples/get_balance.py

If everything is configured correctly, you should see your account balance displayed.

Common Issues and Solutions

WebSocket Connection Error

If you encounter a WebSocket connection error with extra_headers, fix it by:

pip uninstall websockets
pip install websockets==11.0

Permission Denied Errors

If you get permission errors when installing packages:

termux-setup-storage

Grant storage permissions when prompted.

Memory Issues

If installation fails due to memory constraints, try installing packages one at a time or close other apps to free up RAM.

Next Steps