🚀 Need a ready-to-deploy version?
Includes Docker, setup guide, sample responses, and full API structure.
This Flask-based API provides geolocation data for a given IP address using the public ip-api.com service.
- 🔎 Lookup city, region, country, lat/lon, and org for any IP
- 📬 POST endpoint:
/geoip - 📦 Minimal and fast response
- 🔁 Built on top of ip-api.com
- 🐳 Docker-ready
Request Body:
{
"ip": "8.8.8.8"
}Success Response:
{
"ip": "8.8.8.8",
"city": "Mountain View",
"region": "California",
"country": "United States",
"latitude": 37.386,
"longitude": -122.084,
"org": "Google LLC"
}{ "error": "Missing IP parameter" }
{ "error": "Failed to fetch IP data" }pip install -r requirements.txt- Flask
- requests
python app.pyOr with Docker:
docker build -t geoip-api .
docker run -p 5000:5000 geoip-apiCheck the /screens folder for test results via Postman or curl.
Clean modular version with Docker, error handling and easy deployment:
- Email: talabov.ali72@gmail.com
- Telegram: @talabovali
Need it in another stack? Node.js? Go?
Drop me a message!