Idealista Notifier Bot
February 12, 2025 Β· View on GitHub
Overview
This project is a Telegram bot that automatically scrapes Idealista for new apartment listings in Barcelona. It filters listings based on predefined criteria and sends real-time notifications via Telegram, including:
- π Location
- π° Price
- ποΈ Rooms
- π Size (mΒ²)
- π’ Floor
- π Description
- π Direct link to the listing
Project Structure
idealista-notifier/
βββ src/
β βββ scraper.py # Scrapes Idealista & sends Telegram notifications
βββ .env # Stores API keys (excluded from Git)
βββ requirements.txt # Python dependencies
βββ Dockerfile # Container configuration
βββ docker-compose.yml # Deployment configuration
βββ README.md # Project documentation
How It Works
- The script scrapes Idealista every 2 minutes
- It filters out unwanted areas (e.g., Raval, GΓ²tic)
- If a new listing appears, it extracts:
- Location, price, size, rooms, floor, and description
- It sends a formatted message to your Telegram bot
Setup & Installation
- Clone the Repository
git clone https://github.com/martin0995/idealista-notifier.git
cd idealista-notifier
- Install Dependencies
pip install -r requirements.txt
- Set Up Environment Variables
Create a
.envfile in the root directory and add:
TELEGRAM_BOT_TOKEN=your_bot_token_here
TELEGRAM_CHAT_ID=your_chat_id_here
- TELEGRAM_BOT_TOKEN β Get this from Telegram's @BotFather
- TELEGRAM_CHAT_ID β Get this using the
/getUpdatesAPI
- Run the Bot
python3 src/scraper.py
Docker Setup
Run Locally with Docker
To run the bot using Docker:
docker build -t idealista-bot .
docker run -d --restart unless-stopped --name idealista-bot idealista-bot
Run with Docker Compose
docker-compose up -d
This ensures the bot persists data and auto-restarts if it stops.
Deploy to Railway.app
- Install Railway CLI
curl -fsSL https://railway.app/install.sh | sh
railway login
- Link Project & Deploy
railway init
railway up
- Set Environment Variables
railway variables --set "TELEGRAM_BOT_TOKEN=your_bot_token_here" --set "TELEGRAM_CHAT_ID=your_chat_id_here"
- Check Logs & Status
railway logs -f
railway status
The bot will now run 24/7, even if you turn off your computer.
Telegram Bot Link
Try it out: https://t.me/Idealista_Notifier_Bot
Contributing
Feel free to open issues or submit a pull request to improve the project!