FastAPI exposes endpoints, validates parameters and unifies responses.
Angular · FastAPI · CCXT · Cryptocurrency
Cryptocurrency API: project overview and architecture
This page is intended as technical documentation for the project. It explains how the API is structured, which endpoints it exposes, how the client authenticates and how it can be consumed from Angular or Python.
The functional app is separated so that users who only want to query data can do so without mixing usage with the didactic material.
Project context
The backend is deployed in FastAPI and uses CCXT to normalize access to multiple exchanges. Angular acts as the client and consumes endpoints protected with JWT tokens.
This separation improves maintainability, allows API reuse from other clients and keeps the frontend focused on user experience, SEO and presentation.
Base URL: https://criptodatabase.1938.com.es
1. Introduction
In the previous version, the main utility was comparing the price of one pair across several exchanges. In this newer version that idea remains, but the architecture is cleaner: market logic lives in an independent API and Angular only acts as the client.
That brings several benefits: an easier interface to maintain, backend reuse from scripts or future apps, and a cleaner structure for adding filters, historical data or alerts.
2. Architecture
CCXT encapsulates exchange communication and reduces implementation differences.
Authentication uses JWT through the /token endpoint.
Angular consumes the API and organizes loading state, errors and results display.
3. Integration examples
One of the main improvements of this migration is that the logic is now decoupled. The backend can be reused from Angular, Python, internal scripts or future mobile applications.
3.1 Get a token with Python
3.2 Compare a symbol with Python
3.3 Consume the API from Angular
4. Useful concepts
What is an exchange?
It is a platform where cryptocurrencies and other digital pairs are traded.
What is a pair?
It is the relation between two assets, for example BTC/USDT or ETH/EUR.
What does bid/ask mean?
Bid is the best available buy price and ask is the best available sell price.
Why do two exchanges show different prices?
Because liquidity, volume, order books and demand are not identical in every market.
5. Criteria for using this API in a real project
A market data API is useful only if the client understands its limits. Before using this pattern in production, the important part is not only calling endpoints, but controlling freshness, errors, authentication and operational cost.
The comparison table should be read as a market snapshot. Bid, ask and last price can change between requests, and a cheaper last price may come from a stale or illiquid market. For analysis, combine the snapshot with volume, timestamp, spread and fees.
Cache exchange lists and pair catalogs, because they do not need to be requested on every page load.
Apply timeouts and clear error messages: exchange APIs can fail, throttle requests or return partial data.
Never expose exchange credentials or privileged API keys in Angular; the browser should only talk to your own backend.
Separate educational comparison from trading execution. A price gap is not a buy or sell signal by itself.
Log backend errors by exchange so you can detect unstable providers instead of showing generic failures.
6. Project links
Functional application
Separate view to query exchanges, ticker, pairs and price comparison.
Why split documentation and app?
Separating documentation and real usage improves experience, SEO and long-term maintainability.