BinomoAPI

Getting Started with BinomoAPI

Support

πŸš€ Try ChipaEditor - Our AI-Powered Code Editor
donate in paypal: Paypal.me
help us in patreon: Patreon
πŸ‘‰ Join us on Discord
Get our services here
Let us create your bot here
Contact us in Telegram

πŸ“¦ Installation

Prerequisites

Install from PyPI

pip install BinomoAPI

Install from Source

git clone https://github.com/yourname/BinomoAPI.git
cd BinomoAPI
pip install -e .

πŸ”‘ Basic Setup

Environment Variables

Set up your credentials securely using environment variables:

export BINOMO_EMAIL="your_email@example.com"
export BINOMO_PASSWORD="your_password"
export BINOMO_DEMO_MODE="true"  # Use demo account by default

Configuration File

Create a binomo_config.json file (optional):

{
  "api": {
    "demo_mode": true,
    "enable_logging": true,
    "log_level": "INFO"
  },
  "trading": {
    "default_asset": "EUR/USD",
    "min_trade_amount": 1.0,
    "max_trade_amount": 100.0,
    "risk_percentage": 2.0
  }
}

πŸš€ Your First Trade

Here’s a complete example of making your first trade:

import asyncio
from BinomoAPI import BinomoAPI, AuthenticationError, TradeError

async def main():
    try:
        # Login to get authentication data
        login_response = BinomoAPI.login(
            "your_email@example.com",
            "your_password"
        )
        print(f"Login successful! User ID: {login_response.user_id}")
        
        # Initialize API client
        async with BinomoAPI(
            auth_token=login_response.authtoken,
            device_id=login_response.user_id,
            demo=True,  # Use demo account
            enable_logging=True
        ) as api:
            # Check balance
            balance = await api.get_balance()
            print(f"Demo account balance: ${balance.amount}")
            
            # Place a trade
            if balance.amount >= 1.0:
                result = await api.place_call_option(
                    asset="EUR/USD",
                    duration_seconds=60,
                    amount=1.0
                )
                print(f"Trade placed successfully: {result}")
            else:
                print("Insufficient balance for trading")
                
    except AuthenticationError as e:
        print(f"Login failed: {e}")
    except TradeError as e:
        print(f"Trade failed: {e}")
    except Exception as e:
        print(f"An unexpected error occurred: {e}")

if __name__ == "__main__":
    asyncio.run(main())

πŸ“Š Understanding Results

Login Response

The login_response object contains:

Balance Information

The balance object includes:

Trade Results

Trade results contain:

🎯 Next Steps

  1. Explore more advanced trading features
  2. Learn about error handling
  3. Check out complete code examples
  4. Read the API reference

🚨 Common Issues

Authentication Fails

Trade Execution Fails

WebSocket Connection Issues

🀝 Getting Help

Remember to always use the demo account first when testing new trading strategies!