Skip to content

4.0.0

Latest

Choose a tag to compare

@fcs-developer fcs-developer released this 25 Dec 11:42
· 1 commit to master since this release

FCS WebSocket Python v4.0.0

First Release - Python WebSocket client for real-time Forex, Crypto, and Stock market data from FCS API.

What's New

Initial release with complete WebSocket implementation:

  • Real-time Streaming - Live OHLCV and Ask/Bid price updates (1-5 second updates)
  • Multi-Market Support - Forex (FX:EURUSD), Crypto (BINANCE:BTCUSDT), Stocks (NASDAQ:AAPL)
  • Decorator-Based API - Simple event handling with Python decorators
  • Auto-Reconnect - Automatic reconnection with configurable retry limit
  • Background Threading - Non-blocking mode for concurrent operations
  • Zero Dependencies - Pure Python implementation using built-in websocket
  • Easy Integration - Simple method calls with clean API

Installation

pip install fcsapi-websocket

Quick Start

from fcs_client_lib import FCSClient

client = FCSClient('YOUR_API_KEY')

@client.on_message
def handle_message(data):
    if data.get('type') == 'price':
        symbol = data.get('symbol')
        price = data['prices'].get('c')
        print(f'{symbol}: ${price}')

client.connect()
client.join('BINANCE:BTCUSDT', '1D')
client.run_forever()

Background Mode (Non-blocking)

client.connect()
client.run_forever(blocking=False)  # Runs in background thread
# Your code continues here...

Examples Included

  • simple_example.py - Basic price streaming
  • forex_example.py - Forex pairs with spread calculation
  • crypto_example.py - Bitcoin, Ethereum real-time prices
  • background_example.py - Non-blocking background mode
  • stock_example.py - Stock prices (AAPL, TSLA, GOOGL)

Supported Markets

  • Forex: FX:EURUSD, FX:GBPUSD, FX:USDJPY
  • Crypto: BINANCE:BTCUSDT, BINANCE:ETHUSDT
  • Stocks: NASDAQ:AAPL, NYSE:TSLA

Timeframes

1m, 5m, 15m, 30m, 1h, 4h, 1D, 1W, 1M

Demo Access

Test without signup: fcs_socket_demo

Requirements

  • Python 3.8 or higher
  • No external dependencies

Documentation

Get API Key

Sign up for free at https://fcsapi.com