Skip to content
Simple IP enrichment service and API wrapping PyASN and MaxMind GeoIP.
Python HTML
Branch: master
Clone or download
9b Merge pull request #5 from foospidy/master
Update requirements.txt
Latest commit 6fcab55 Oct 17, 2019



NetInfo is a simple IP enrichment service to provide additional data related to an IP address. The primary utility of NetInfo is to serve as a API wrapper and management system for the PyASN and MaxMind GeoIP libraries. NetInfo will automatically seek and download new update files, ensuring the databases are always up-to-date. The local API queries the PyASN and GeoIP instance and returns back enrichment data for an IP address.

Getting Started

Grab the dependencies:

$ apt-get install redis-server rabbitmq-server

Check out netinfo to /opt/:

$ cd /opt && git clone

Change directory to the netinfo working directory:

$ cd netinfo/

Setup the virtualenv:

$ virtualenv -p python3 venv3

Activate the virtualenv:

$ source venv3/bin/activate

Install the requirements:

$ (venv3) pip install -r requirements.txt

Install the services and start them.

See Services README.

Or start the Celery Daemon:

$ (venv3) /opt/netinfo/venv3/bin/celery worker -A worker.celery --loglevel=info -B

And start the server:

$ (venv3) /opt/netinfo/venv3/bin/uwsgi --ini wsgi.ini

You can then access the API through http://localhost:7777 for more details.

Sample Output

When calling http://localhost:7777/lookup?ip=

  "as_name": "UUNET - MCI Communications Services, Inc. d/b/a Verizon Business, US",
  "as_num": 701,
  "city": "Vienna",
  "country_iso": "US",
  "country_name": "United States",
  "ip": "",
  "ip_hex": "0x4a60c052",
  "ip_version": 4,
  "latitude": 38.8977,
  "longitude": -77.288,
  "network": "",
  "network_broadcast": "",
  "network_hostmask": "",
  "network_netmask": "",
  "network_size": 65536,
  "postal_code": "22181",
  "region_iso": "VA",
  "region_name": "Virginia"

Unlike the standard PyASN library, NetInfo will add the AS name to the response, additional network data and the original IP address that was requested.

API Endpoints

The following endpoints are available within the NetInfo service.


Get back AS, network information and geolocation for an IP address.


Get back all IP addresses as part of a network range.


Get back all prefixes advertised for a specific AS network.


Get back the name of the AS network.


Get back geolocation information for an IP address.

You can’t perform that action at this time.