Skip to content

A simple, fast Flask API that returns detailed geolocation data for any IP address — using the free ip-api.com service under the hood.

Notifications You must be signed in to change notification settings

Talabov/GeoIP_API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

🌐 GeoIP Lookup API


🚀 Need a ready-to-deploy version?

Includes Docker, setup guide, sample responses, and full API structure.

👉 Buy it on Gumroad


This Flask-based API provides geolocation data for a given IP address using the public ip-api.com service.


✅ Features

  • 🔎 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

🚀 Endpoint

POST /geoip

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 Responses

{ "error": "Missing IP parameter" }

{ "error": "Failed to fetch IP data" }

⚙️ Requirements

pip install -r requirements.txt
  • Flask
  • requests

🖥 How to Run

python app.py

Or with Docker:

docker build -t geoip-api .
docker run -p 5000:5000 geoip-api

📸 Example Screenshots

Check the /screens folder for test results via Postman or curl.


💼 Buy the Packaged Version

Clean modular version with Docker, error handling and easy deployment:

👉 Available on Gumroad


📬 Contact


Need it in another stack? Node.js? Go?
Drop me a message!

About

A simple, fast Flask API that returns detailed geolocation data for any IP address — using the free ip-api.com service under the hood.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published