Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/sajidsdk19/location-finder/archive/refs/heads/main.zipA comprehensive location detection application built with Streamlit that provides precise geolocation services through browser-based detection and manual coordinate lookup.
🌐 Live Demo
Try it now: https://locationfinder.streamlit.app/
✨ Features
🎯 Core Functionality
- Browser-Based Location Detection: Utilizes HTML5 Geolocation API for precise, real-time location detection
- Manual Coordinate Input: Backup option for entering latitude/longitude coordinates manually
- Reverse Geocoding: Converts coordinates to human-readable addresses using OpenStreetMap's Nominatim API
- Interactive Maps: Embedded OpenStreetMap visualization for detected locations
- WordPress Plugin: Ready-to-use plugin for integrating location detection into WordPress sites
🎨 User Interface
- Modern, responsive design with gradient backgrounds and glassmorphism effects
- Tabbed interface for easy navigation between features
- Real-time loading indicators and error handling
- Mobile-friendly and works across all modern browsers
🔒 Privacy & Security
- No data storage: Your location is never saved or stored
- Browser-only processing: All detection happens client-side
- No tracking: No cookies or user tracking implemented
- Open source: Transparent and auditable code
🚀 Getting Started
Prerequisites
- Python 3.7 or higher
- pip (Python package installer)
Installation
-
Clone the repository
git clone https://github.com/sajidsdk19/Location-finder.git cd Location-finder -
Install dependencies
pip install -r requirements.txt -
Run the application
streamlit run app.py -
Access the app
- Open your browser and navigate to
http://localhost:8501
- Open your browser and navigate to
📦 Dependencies
streamlit
requests
🛠️ How It Works
Browser Detection
- User clicks "Detect My Location" button
- Browser requests permission to access location
- HTML5 Geolocation API retrieves precise coordinates
- OpenStreetMap Nominatim API converts coordinates to address
- Results displayed with interactive map
Manual Input
- User enters latitude and longitude coordinates
- Application validates input
- Reverse geocoding fetches location details
- Address and map displayed
📱 Browser Compatibility
| Browser | Support | Notes |
|---|---|---|
| Chrome | ✅ Excellent | Recommended |
| Firefox | ✅ Excellent | Works great |
| Safari | ✅ Good | May need permission |
| Edge | ✅ Good | Works well |
| Mobile | ✅ Excellent | Usually most accurate |
🌍 WordPress Plugin
The repository includes a WordPress plugin (geocity.zip) that enables location-based content on WordPress websites.
Plugin Features
- Simple shortcode
[geot_city]for displaying visitor's city - IP-based location detection using ip-api.com
- Automatic fallback for localhost testing
- XSS protection with proper sanitization
- Compatible with all modern WordPress themes
Plugin Installation
- Download
geocity.zipfrom the repository - Go to WordPress Admin → Plugins → Add New
- Click "Upload Plugin" and select the zip file
- Activate the plugin
- Use
[geot_city]shortcode anywhere on your site
Plugin Usage Example
Welcome to our site! You're visiting from [geot_city].
📍 Accuracy Information
- GPS devices: Usually 3-5 meters
- Smartphones: Usually 5-10 meters
- WiFi/Cell: Usually 10-100+ meters
- Desktop: Varies widely (IP-based fallback)
For best accuracy, use a smartphone with GPS enabled.
🔧 Technical Details
Technologies Used
- Frontend: HTML5, CSS3, JavaScript
- Backend: Python, Streamlit
- APIs:
- OpenStreetMap Nominatim (Reverse Geocoding)
- HTML5 Geolocation API (Browser Detection)
- ip-api.com (WordPress Plugin)
Project Structure
Location-finder/
├── app.py # Main Streamlit application
├── requirements.txt # Python dependencies
├── geocity.zip # WordPress plugin
├── geocity.php # Plugin source file
└── README.md # Documentation
🤝 Contributing
Contributions, issues, and feature requests are welcome! Feel free to check the issues page.
👨💻 Developer
Sajid Khan
- Personal Website: sajidkhan.me
- Company: solutions.techscape.pk
- GitHub: @sajidsdk19
- Email: sajid@techscape.pk
📄 License
This project is open source and available for personal and commercial use.
🙏 Acknowledgments
- OpenStreetMap for providing free geocoding services
- Streamlit for the amazing web framework
- ip-api.com for IP-based geolocation services
⭐ If you find this project useful, please consider giving it a star on GitHub!