Skip to content

Crypto Price Telegram Bot is a Node.js and TypeScript bot that fetches live cryptocurrency prices (BTC, ETH, SOL, BNB) every minute and sends updates to a Telegram chat. It uses the CoinGecko API and Telegram Bot API for real-time price tracking.

License

Notifications You must be signed in to change notification settings

David-patrick-chuks/Crypto-Price-Telegram-Bot

Repository files navigation

🟡 Crypto Price Telegram Bot

License Issues Contributors Forks Stars

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.

preview


✨ Features

  • 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)

📦 Tech Stack

  • Node.js + TypeScript
  • Axios
  • node-cron
  • dotenv
  • Telegram Bot API
  • CoinGecko API

🚀 Getting Started

1. Clone the repo

git clone https://github.com/david-patrick-chuks/Crypto-Price-Telegram-Bot.git
cd Crypto-Price-Telegram-Bot

2. Install dependencies

npm install

3. Create a .env file

BOT_TOKEN=your_telegram_bot_token
CHAT_ID=your_telegram_chat_id

4. Build and Start

npm start

🧠 How It Works

  • Every 1 minute, the bot:
    1. Fetches prices from CoinGecko
    2. Formats the data nicely
    3. Sends it to a Telegram chat via sendMessage

You can change the coins or update interval in the code.


⚙️ Deployment on Render

🔧 render.yaml

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.


📁 Folder Structure

📦 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)


🛡 License

This project is open source under the MIT License.


🙌 Contributing

Pull requests are welcome! If you'd like to suggest changes or add features, feel free to fork the repo and submit a PR.


👨‍💻 Author

David Patrick (BugHunter.dev)@david-patrick-chuks
✨ Built with love 🌸.

About

Crypto Price Telegram Bot is a Node.js and TypeScript bot that fetches live cryptocurrency prices (BTC, ETH, SOL, BNB) every minute and sends updates to a Telegram chat. It uses the CoinGecko API and Telegram Bot API for real-time price tracking.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published