https://github.com/halon176/h-crypto-price-bot
A python-based bot that fetches real-time cryptocurrency prices from Coingecko and presents them in an easy-to-understand format on Telegram.
https://github.com/halon176/h-crypto-price-bot
bitcoin bot coingecko-api cryptocurrency python telegram telegram-bot
Last synced: 3 months ago
JSON representation
A python-based bot that fetches real-time cryptocurrency prices from Coingecko and presents them in an easy-to-understand format on Telegram.
- Host: GitHub
- URL: https://github.com/halon176/h-crypto-price-bot
- Owner: halon176
- License: mit
- Created: 2023-04-08T07:12:39.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2025-10-16T22:30:14.000Z (8 months ago)
- Last Synced: 2025-10-17T23:11:08.351Z (8 months ago)
- Topics: bitcoin, bot, coingecko-api, cryptocurrency, python, telegram, telegram-bot
- Language: Python
- Homepage:
- Size: 1.26 MB
- Stars: 7
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# HCryptoPrice
[](https://github.com/halon176/h-crypto-price-bot/actions/workflows/docker-image.yml)
[](https://github.com/halon176/h-crypto-price-bot/actions/workflows/run_tests.yml)
[](https://github.com/halon176/h-crypto-price-bot/tree/master/tests)
[](https://github.com/halon176/h-crypto-price-bot/blob/master/LICENSE)
[](https://www.python.org/downloads/release/python-3130/)
A Python-based Telegram bot for fetching real-time cryptocurrency prices from CoinGecko. Provides price data, historical charts, market cap rankings, and Ethereum gas prices.
**Live bot**: [@h_crypto_price_bot](https://t.me/h_crypto_price_bot)
For advanced features like rate limits and usage tracking, check out the [hcpb-api](https://github.com/halon176/hcpb-api) repository (work in progress).
## Installation
### Manual
1. Make sure you have Python 3.13 installed:
```bash
python --version
```
2. Clone the repository:
```bash
git clone https://github.com/halon176/h-crypto-price-bot.git
cd h-crypto-price-bot
```
3. Install dependencies using [uv](https://docs.astral.sh/uv/):
```bash
uv sync
```
4. Create a Telegram bot via [BotFather](https://core.telegram.org/bots#6-botfather) and copy the token.
5. Set up environment variables:
```bash
export TELEGRAM_TOKEN=
export ETHSCAN_API_KEY= # Required for gas prices
export CMC_API_KEY= # Optional
export API_URL= # Optional
```
6. Run the bot:
```bash
uv run python src/main.py
```
### Docker
1. Clone the repository:
```bash
git clone https://github.com/halon176/h-crypto-price-bot.git
```
2. Build the Docker image:
```bash
docker build -t h-crypto-price h-crypto-price-bot/.
```
3. Run the container:
```bash
# Basic setup
docker run -d \
-e TELEGRAM_TOKEN= \
--name h-crypto-price \
h-crypto-price
# With optional API keys
docker run -d \
-e TELEGRAM_TOKEN= \
-e ETHSCAN_API_KEY= \
-e CMC_API_KEY= \
--name h-crypto-price \
h-crypto-price
```
## Usage
Get cryptocurrency prices using `/p` followed by the symbol:
```
/p btc
/p eth
/p sol
```
Type `/help` for a full list of available commands.
## Contributing
Contributions are welcome! If you have any suggestions or bug reports, please open an issue on the GitHub repository.
## License
This project is licensed under the MIT License. See the LICENSE file for details.