🔒 Malicious URL Detection API and ML Pipeline
🧪 Run the full notebook on Kaggle: Malicious URL ML (Kaggle)
Frontend Repo: chatdrive
Try the live application here: 🔗 ChatDrive
This project provides a FastAPI-based web service and a machine learning pipeline for detecting potentially malicious URLs.
💬 It is designed to integrate with a chatting website, enabling real-time detection of malicious URLs shared in conversations.
It includes:
- 🔗 A REST API for URL analysis and prediction
- 🧩 Feature extraction and model inference using pandas and joblib
- 📓 A Jupyter notebook for model training and evaluation
- 🐍 Python: 3.11.13
- ⚡ FastAPI: Web API framework
- 📊 pandas, numpy: Data processing
- 📦 joblib: Model serialization
- 🤖 scikit-learn: ML pipeline (used in notebook)
- ✅ pydantic: Data validation
- 🌐 CORS: Enabled for API
- Clone the repository:
git clone https://github.com/Satyam1Vishwakarma/chatdrive-ml.git cd chatdrive-ml - Install dependencies:
pip install -r requirements.txt
uvicorn app:app --reloadThe API will be available at http://localhost:8000.
POST /predict— Accepts a URL and returns a prediction (malicious or not).
See malicious-url-ml.ipynb for the full ML workflow: data loading, feature engineering, model training, evaluation, and export.
app.py— FastAPI app and feature extractionmalicious-url-ml.ipynb— Jupyter notebook for ML pipelinestatic/— Pretrained model files (url_model.pkl, etc.)requirements.txt— Python dependenciesversion.txt— Python version