Skip to content

A Telegram bot that checks phone numbers for validity, carrier info, and scam risk using Twilio Lookup, DuckDuckGo search, and AI-powered analysis.

Notifications You must be signed in to change notification settings

imad-collab/PhoneCheckerBot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“ž PhoneCheckerBot A Telegram bot that checks phone numbers for validity, carrier info, and scam risk using Twilio Lookup, DuckDuckGo live search, and AI-powered analysis.

πŸš€ Features βœ… Validate numbers in E.164 format 🌍 Detect country, carrier, and line type (Mobile, Landline, VoIP) πŸ”Ž Search web (DuckDuckGo) for scam/spam reports πŸ€– AI-powered decision engine with risk scoring πŸ—‚οΈ Import personal contacts (VCF β†’ JSON safelist) πŸ’Ύ Store lookup history for quick reference πŸ” Safe number whitelist (customer support, personal contacts)

πŸ“¦ Tech Stack Python 3.11+ python-telegram-bot Twilio Lookup API httpx

  • BeautifulSoup4 OpenAI (LLM-based analysis)

βš™οΈ Installation Clone this repo: git clone https://github.com/YOUR_USERNAME/PhoneCheckerBot.git

Create virtual environment: python3 -m venv .venv source .venv/bin/activate # Mac/Linux .venv\Scripts\activate # Windows

Install dependencies: pip install -r requirements.txt

πŸ”‘ Setup Copy .env.example β†’ .env and add your keys:

TELEGRAM_BOT_TOKEN=your_telegram_token TWILIO_ACCOUNT_SID=your_sid TWILIO_AUTH_TOKEN=your_auth_token OPENAI_API_KEY=your_openai_api_key

Add your safelist numbers in services/safe_numbers.json: { "+611300555123": "βœ… SAFE – DHL Customer Service", "+611800123456": "βœ… SAFE – NAB Bank Helpline", "+61426648942": "βœ… SAFE – Your Personal Number" }

(Optional) Convert your contacts VCF file: python services/convert_vcf.py

▢️ Run the Bot python bot.py

πŸ’¬ Usage In Telegram: Send any phone number (must be E.164 format like +61426648942).

Bot replies with structured JSON output:

{ "number": "+61426964413", "country_code": "+61", "region": "Australia", "carrier": "Optus", "line_type": "Mobile", "sim_user": "Unknown", "spam_status": "βœ… Safe", "risk_score": "Low" }

πŸ—‚οΈ Project Structure phone-checker-bot/ β”œβ”€β”€ bot.py # Main Telegram bot β”œβ”€β”€ services/ β”‚ β”œβ”€β”€ twilio_service.py # Twilio lookup β”‚ β”œβ”€β”€ ddg_service.py # DuckDuckGo scraper β”‚ β”œβ”€β”€ gpt_service.py # OpenAI risk analysis β”‚ β”œβ”€β”€ history_service.py # Save & retrieve lookups β”‚ β”œβ”€β”€ convert_vcf.py # Convert VCF contacts β†’ JSON β”‚ β”œβ”€β”€ safe_numbers.json # Whitelisted safe numbers β”‚ └── lookups.json # History of lookups β”œβ”€β”€ requirements.txt └── README.md

πŸ“Œ Deployment Local Run: Python environment (as above) Docker: Build container and run Cloud: Deploy on Oracle Cloud / AWS EC2 / Heroku / Railway

✨ Future Improvements Web dashboard for number lookups SMS/WhatsApp integration Automatic scam database sync (e.g., Scamwatch API) Improved carrier + SIM user detection

About

A Telegram bot that checks phone numbers for validity, carrier info, and scam risk using Twilio Lookup, DuckDuckGo search, and AI-powered analysis.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages