A simple Node.js + TypeScript bot that fetches live cryptocurrency prices (BTC, ETH, SOL, BNB) every 1 minute and sends updates to a Telegram chat using the Telegram Bot API.
- Fetches live crypto prices using CoinGecko API
- Sends formatted updates to Telegram every minute
- Shows 24h price change indicators with 🔺 or 🔻
- Powered by Node.js, TypeScript, Axios, and node-cron
- Ready to deploy on Render (as a background worker)
- Node.js + TypeScript
- Axios
- node-cron
- dotenv
- Telegram Bot API
- CoinGecko API
git clone https://github.com/david-patrick-chuks/Crypto-Price-Telegram-Bot.git
cd Crypto-Price-Telegram-Bot
npm install
BOT_TOKEN=your_telegram_bot_token
CHAT_ID=your_telegram_chat_id
npm start
- Every 1 minute, the bot:
- Fetches prices from CoinGecko
- Formats the data nicely
- Sends it to a Telegram chat via
sendMessage
You can change the coins or update interval in the code.
services:
- type: worker
name: Crypto-Price-Telegram-Bot
runtime: node
repo: https://github.com/YOUR_USERNAME/YOUR_REPO_NAME
buildCommand: npm install && tsc
startCommand: node build/bot.js
envVars:
- key: BOT_TOKEN
sync: false
- key: CHAT_ID
sync: false
After setting up the repo, go to Render → New → Background Worker, and use the
render.yaml
to auto-configure the app.
📦 crypto-telegram-bot/
├── src/
│ ├── interfaces/
│ │ └── prices.ts # Contains interfaces & types
│ ├── utils/
│ │ └── format.ts # Price formatting helper
│ ├── bot.ts
│ └── server.ts # Main bot logic
├── .env # Env vars for the bot
├── package.json
├── tsconfig.json
├── Dockerfile # Docker configuration file
└── README.md (optional)
This project is open source under the MIT License.
Pull requests are welcome! If you'd like to suggest changes or add features, feel free to fork the repo and submit a PR.
David Patrick (BugHunter.dev) – @david-patrick-chuks
✨ Built with love 🌸.