A Flask-based web application that allows users to input a phone number (with international country code) and retrieve approximate geographical information, including:
Country/Region description Mobile carrier/service provider Approximate latitude and longitude (via geocoding the region) An interactive map centered on the approximate location (using Folium)
It also supports basic IP address lookup (if a dotted IP is entered instead of a phone number), displaying city, region, country, and coordinates. Important Disclaimer: This tool provides an approximate location based on publicly available phone number registration data and geocoding. It does NOT offer real-time GPS tracking or exact device location. Precise tracking is impossible without carrier or device access. Use ethically and legally only. Perfect for educational purposes, learning Flask, or OSINT demonstrations!
Simple web interface with form input Parse and validate international phone numbers using phonenumbers Get the region description and the carrier name Geocode the region to coordinates using the OpenCage API Display results with an embedded interactive Folium map (commented out in the current code but ready to enable) Bonus: Basic IP geolocation using the free DbIpCity database Error handling for invalid inputs
Backend: Flask (Python) Libraries: phone numbers for parsing and metadata OpenCage for geocoding (requires free API key) folium for map generation (optional/enabled in code comments) ip2geotools for IP lookup
Frontend: HTML templates (Jinja2)
Clone the repository: git clone https://github.com/Evic7/location_tracker.git
cd location_tracker Create a virtual environment (recommended): python -m venv venv source venv/bin/activate On Windows: venv\Scripts\activate
pip install -r requirements.txt(Includes Flask, phonenumbers, folium, opencage, etc.)
Get an OpenCage API Key (free tier available):
Sign up at https://opencagedata.com/
Replace the Key variable in app.py with your own key: PythonKey = "your_api_key_here."
Run the app locally: python app.py Open your browser and go to http://127.0.0.1:5000/
Enter a phone number like +14155552671 (US example) or +2348012345678 (Nigeria)
Submit to see location details
To enable the interactive map:
Uncomment the Folium map section in app.py (around line 70+)
The map will embed directly in the results page
Project Structure
location_tracker/
βββ app.py # Main Flask application
βββ requirements.txt # Python dependencies
βββ vercel.json # Vercel deployment config
β
βββ static/
β βββ css/
β β βββ main.css
β β
β βββ js/
β β βββ index.js
β β
β βββ resources/
β βββ background.jpg
β βββ earth.bmp
β βββ loop1.jpg
β βββ loop2.jpg
β βββ loop3.jpg
β βββ loop4.jpg
β βββ loop5.jpg
β βββ loop6.jpg
β βββ loop7.jpg
β
βββ templates/
β βββ base.html
β βββ index.html
β βββ locate.html
Fully enable and style the Folium map embed. Add validation for phone number format. Improve UI with Bootstrap/CSS. Deploy to platforms like Render, Vercel, or Heroku. Add timezone info or more details.
This project is for educational purposes only. Respect privacy lawsβdo not use for harassment, stalking, or illegal activities. Location data is approximate and often only region-level. Contributing Feel free to fork, improve the UI/map, fix bugs, or add features! Open issues or submit pull requests.