CotizAPI is a Telegram bot designed to provide up-to-date price information on key financial assets such as gold, silver, bitcoin, wheat and oil. This system combines modern technologies to provide an efficient, easy-to-use and fully automated API to query prices, generate alerts and manage historical data.
- 📊 Current price query: Allows to obtain real-time prices of financial assets.
- 🔔 Automatic alerts: Generates notifications based on significant price changes.
- 📈 Price history: Stores and allows querying historical prices for comparative analysis.
- 📅 Daily and weekly variation: Automatically calculates the variation in prices with respect to previous days or weeks.
- ⏰ Automatic scheduling: Updates asset prices periodically through a task scheduler.
- 🌍 Multi-asset support: Currently supports gold, silver, bitcoin, wheat and oil, but is easily scalable to include more assets.
- 🚀 Fast REST API: Designed with FastAPI to provide an efficient and easy-to-integrate interface.
The project was built using a set of modern tools that ensure efficiency and ease of deployment:
- 🌐 Vercel: For API deployment and hosting, ensuring high availability and performance.
- 🐙 GitHub: For version control and code development collaboration.
- 📬 Postman: For comprehensive testing of API paths and functionality.
- ⚡ FastAPI: Lightweight and fast framework for REST API development.
- 💾 SQLite + SQLAlchemy: SQLite as the lightweight database, with SQLAlchemy ORM to manage database operations in a scalable and maintainable way.
- 🖥️ DBeaver: Graphical tool to manage and query the SQLite database.
- ⏲️ Task Scheduler: Used to automate price updates and alert generation.
CotizAPI uses two main tables in its database:
- 📁 Price table: Records asset prices with their corresponding date.
- 🔔 Alerts table: Stores alerts generated based on significant price changes.
- 🚀 Price update:
- A task scheduler automates the daily update of prices in the database.
- Asset prices are obtained from external sources and stored in the pricing table.
- 🔔 Alert generation:
- When a significant change in prices is detected, an alert is generated in the corresponding table.
- 📲 Interaction with Telegram:
- Users can interact with the bot to query current prices, historical prices and recent alerts.
- 📉 Variance analysis:
- API calculates daily and weekly percentage variations based on stored data.
- Python 3.10+
- SQLite
- Vercel CLI
- Git
- Clone the repository:
git clone https://github.com/RafaelRemoteDev/cotizAPI.git cd cotizAPI
- Create and activate a virtual environment
- On Windows:
python -m venv venv venv “scripts” activate
- On macOS/Linux:
python -m venv venv source venv/bin/activate
- Install dependencies
pip install -r requirements.txt
-
GitHub: RafaelRemoteDev