All Projects → kz26 → balise

kz26 / balise

Licence: MIT license
A portable, lightweight, locally-hosted IPv4 and IPv6 geolocation API/server

Programming Languages

python
139335 projects - #7 most used programming language

Balise

A portable, lightweight, locally-hosted IPv4 and IPv6 geolocation API/server

balise 2.x is designed to operate with MaxMind's GeoIP2/GeoLite 2 databases. For GeoIP Legacy/GeoLite Legacy support, use the balise 1.x branch.

Requirements

Installation and setup

  1. Create a virtualenv (highly recommended)
  2. Adjust configuration in settings.cfg as appropriate
  3. python main.py or run using your favorite WSGI server

If you will be running balise behind a reverse proxy, use main_rp.py instead as a WSGI entry point so that the client IP address is passed along properly.

API/Usage

Results are returned in JSON format.

/: Return GeoIP data for the IP address that made the request /<IPv4 or IPv6 address>: Return data for the specified IP address

Example

GET /128.135.100.101

{
  "region": {
    "iso_code": "IL",
    "name": "Illinois"
  },
  "org": "University of Chicago",
  "city": "Chicago",
  "country": {
    "iso_code": "US",
    "name": "United States"
  },
  "postal_code": "60637",
  "location": {
    "latitude": 41.7804,
    "longitude": -87.6027,
    "time_zone": "America\/Chicago",
    "metro_code": 602
  },
  "asn": 160,
  "ip": "128.135.100.101"
}

License

Balise is made available under the terms of the MIT license. Please refer to LICENSE.txt for more information.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].