Add professional FastAPI crypto data service with OHLCV + indicators#5
Merged
Add professional FastAPI crypto data service with OHLCV + indicators#5
Conversation
- Add WebSocket endpoint at /api/v1/live_data/ws for streaming data - Add comprehensive mocked tests using pytest monkeypatch - Add meta field with defaultType from exchange options - Add pandas-stubs to fix mypy type checking - Fix code style to pass ruff linting Co-authored-by: Nfectious <19631929+Nfectious@users.noreply.github.com>
- Add WebSocket streaming endpoint documentation - Add JavaScript example for WebSocket usage - Update features list to highlight WebSocket support - Update project structure to show new files Co-authored-by: Nfectious <19631929+Nfectious@users.noreply.github.com>
- Add circuit breaker with max 5 consecutive errors - Track consecutive errors and close connection after limit - Reset error counter on successful data fetch - Improve logging to show error count Co-authored-by: Nfectious <19631929+Nfectious@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add complete FastAPI service for OHLCV candles and indicators
Add professional FastAPI crypto data service with OHLCV + indicators
Feb 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements a production-ready FastAPI service for fetching cryptocurrency OHLCV data with technical indicators (EMA 20/50/200, RSI 14, ATR 14) from multiple exchanges via ccxt.
Core Implementation
API Endpoints
GET /api/v1/live_data- Fetch OHLCV with indicators, returns last 20 candlesWS /api/v1/live_data/ws- Stream updates at configurable intervals (5-300s)Data Pipeline
talibrary on pandas DataFrameNonefor JSON serializationdefaultTypewhen availableError Handling
Testing Strategy
Mocked tests use pytest monkeypatch to stub
exchange.fetch_ohlcv, ensuring deterministic CI:Network smoke tests retained but not required for CI to pass.
Infrastructure
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
api.binance.com/home/REDACTED/.local/bin/pytest pytest -v(dns block)/usr/bin/python python -m uvicorn app.main:app --host 0.0.0.0 --port 8000(dns block)/home/REDACTED/.local/bin/pytest pytest -v /home/REDACTED/work/crypto-trade-analysis/crypto-trade-analysis git conf�� --global credential.username /usr/sbin/git(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
This pull request was created from Copilot chat.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.