
Security News
Insecure Agents Podcast: Certified Patches, Supply Chain Security, and AI Agents
Socket CEO Feross Aboukhadijeh joins Insecure Agents to discuss CVE remediation and why supply chain attacks require a different security approach.
fcsapi-websocket-python
Advanced tools
Real-time WebSocket client for Python library for Forex, Cryptocurrency, and Stock market data from FCS API
Real-time WebSocket client library for Forex, Cryptocurrency, and Stock market data from FCS API.
pip install fcsapi-websocket-python
For backend usage, also install:
pip install websocket-client
Use demo API key for testing: fcs_socket_demo
For web applications that display real-time prices in the browser.
frontend/
├── fcs-client-lib.js # JavaScript WebSocket client
└── examples/
├── crypto_example.py # Crypto prices in browser
├── forex_example.py # Forex prices in browser
└── stock_example.py # Stock prices in browser
cd frontend/examples
python crypto_example.py
# Open http://localhost:5000
fcs-client-lib.js) connects to WebSocketFor server-side applications, bots, or scripts that need real-time data without a browser.
backend/
├── fcs_client_lib.py # Python WebSocket client
└── examples/
├── crypto_example.py # Terminal crypto prices
├── forex_example.py # Terminal forex prices
└── stock_example.py # Terminal stock prices
pip install websocket-client
cd backend/examples
python crypto_example.py
from backend import FCSClient
client = FCSClient('YOUR_API_KEY')
@client.on_message
def handle_message(data):
if data.get('type') == 'price':
print(data)
client.connect()
client.join('BINANCE:BTCUSDT', '1D')
client.run_forever()
from backend import FCSClient
# Create client
client = FCSClient(api_key, url=None)
# Connect
client.connect()
client.run_forever(blocking=True) # blocking=False for background
# Subscribe
client.join('BINANCE:BTCUSDT', '1D')
client.leave('BINANCE:BTCUSDT', '1D')
client.remove_all()
# Disconnect
client.disconnect()
# Event callbacks (decorators)
@client.on_connected
@client.on_message
@client.on_close
@client.on_error
@client.on_reconnect
| Market | Format | Examples |
|---|---|---|
| Forex | FX:PAIR | FX:EURUSD, FX:GBPUSD |
| Crypto | EXCHANGE:PAIR | BINANCE:BTCUSDT, BINANCE:ETHUSDT |
| Stock | EXCHANGE:SYMBOL | NASDAQ:AAPL, NYSE:TSLA |
| Timeframe | Description |
|---|---|
1 | 1 minute |
5 | 5 minutes |
15 | 15 minutes |
1H | 1 hour |
1D | 1 day |
1W | 1 week |
# Price update
{
"type": "price",
"symbol": "BINANCE:BTCUSDT",
"timeframe": "1D",
"prices": {
"mode": "candle", # or "initial", "askbid"
"t": 1766361600, # Timestamp
"o": 88658.87, # Open
"h": 90588.23, # High
"l": 87900, # Low
"c": 89962.61, # Close
"v": 8192.70, # Volume
"a": 89962.62, # Ask
"b": 89962.61 # Bid
}
}
MIT License - see LICENSE file.
FAQs
Real-time WebSocket client for Python library for Forex, Cryptocurrency, and Stock market data from FCS API
We found that fcsapi-websocket-python demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket CEO Feross Aboukhadijeh joins Insecure Agents to discuss CVE remediation and why supply chain attacks require a different security approach.

Security News
Tailwind Labs laid off 75% of its engineering team after revenue dropped 80%, as LLMs redirect traffic away from documentation where developers discover paid products.

Security News
The planned feature introduces a review step before releases go live, following the Shai-Hulud attacks and a rocky migration off classic tokens that disrupted maintainer workflows.