Skip to content
Switch branches/tags

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time
  official Python library

This is the official Python client for the NetworksDB API. This allows you to lookup owner details for any IPv4 or IPv6 IP address, find out which networks, IP addresses and domains are operated by organisations, and much more.

This requires a NetworksDB API token. You can get one for free at our website, Free keys come with limitations, such as a limited monthly quota and truncated output for large result sets.

The details returned by the API include, but aren't limited to, the following:

  • Organisation info: Name, address, phone, countries, number of IPv4 and IPv6 networks, number of networks by country, assigned ASNs
  • Organisation networks: Description, name, size, CIDR, start IP, end IP for each network operated by a specific organisation
  • IP info: Number of domains resolving to the IPv4 or IPv6 address, owner organisation info, name and description of the network containing the address.
  • IP geolocation: Country, state, city, latitude and longitude.
  • ASN info: Information about the autonomous system, including the owner company.
  • ASN networks: IPv4/6 network prefixes announced by the autonomous system, including the company they are allocated to.
  • Reverse DNS: List of domain names resolving to the IP address.
  • "Mass" reverse DNS: List of domain names resolving to addresses in an IP range (not available to free API keys).


pip install networksdb

Or clone the repository and run python3 install.

Quick Start

Start by getting an instance of a NetworksDB API handler, supplying your API key.

from networksdb import NetworksDB
>>> api = NetworksDB('11111111-2222-3333-4444-555555555555')

Get information about an IP address:

>>> ip = api.ip_info('')

Omitting the parameter will return information about your source IP address.

Return information about the owner, networks and domains:

'Google LLC'
>>> ip.domains_on_ip

Request geolocation information (This works with IPv6 addresses too):

>>> geo = api.ip_geo('')
>>> geo.continent,, geo.state,, geo.latitude, geo.longitude
('North America', 'United States', 'California', 'Mountain View', 37.406, -122.079)

View the full API response details by printing any Response object:

>>> print(ip)
    "ip": "",
    "domains_on_ip": 7243,
    "url": "",
    "organisation": {
        "name": "Google LLC",
        "id": "google-llc",
        "url": ""
    "network": {
        "netname": "LVLT-GOGL-8-8-8",
        "description": "Google LLC",
        "cidr": "",
        "first_ip": "",
        "last_ip": "",
        "url": ""

Organisation search

To request organisation details, you need to supply its NetworksDB id. To find organisation IDs, use the organisation search API The results are sorted by the number of IPv4 addresses for each organisation:

>>> search = api.org_search('Github')
>>> search.results[0].organisation
'GitHub, Inc'
>>> search.results[0].id

Organisation info

Once you've found the correct ID, pass it to the organisation info API call:

>>> github = api.org_info('github-inc')
>>> print(github)
    "organisation": "GitHub, Inc",
    "id": "github-inc",
    "address": null,
    "phone": null,
    "countries": [
        "United States"
    "networks": {
        "ipv4": 8,
        "ipv6": 2
    "networks_by_country": {
        "United States": 10
    "url": "",
    "asns": [

Organisation networks

Find out which networks they own or operate:

>>> github_networks = api.org_networks(
>>> for range in github_networks.results:
...     print(range.netname, range.description, range.cidr)
GITHU GitHub, Inc
US-GITHUB-20170413 GitHub, Inc
GITHUB-NET4-1 GitHub, Inc
RSPC-728F4421-0D7C-4F42-BDFD-A6D290538501 GitHub
ZAYO-IDIA-235983-64-124-138-32-28 GitHub
RSPC-039EB5D8-39DC-445A-9C23-05529A657DDC GitHub
RSPC-48B1F3A4-2615-4566-99CD-D126E3C102BB GitHub
RSPC-CC4A7060-6141-4A22-BD6B-98A2B581247D GitHub

Or, for IPv6:

>>> github_ipv6_networks = api.org_networks(, ipv6=True)
>>> for range in github_ipv6_networks.results:
...     print(range.netname, range.description, range.cidr)
US-GITHUB-20170419 GitHub, Inc 2a0a:a440::/29
GITHUB-NET6-1 GitHub, Inc 2620:112:3000::/44

Reverse DNS

List the domains names resolving to a given IPv4 or IPv6 address:

>>> reverse_dns = api.reverse_dns('')
>>> reverse_dns.results[:10]
('', '', '', '', '', '', '', '', '', '')

Mass reverse DNS is the same thing, but on a full network block:

>>> mass_reverse = api.mass_reverse_dns('')
>>> for res in mass_reverse.results[:4]:
...     print(res.ip,
... ('', '', '') ('',) ('', '', '', '', '') ('',)

Note: Mass reverse DNS is not available to free API keys.

Find all domains hosted by a company

It's pretty easy to iterate through the company's networks and request the list of domain names for each network:

>>> for network in api.org_networks('paypal-inc').results:
...     mass_reverse = api.mass_reverse_dns(network.first_ip, network.last_ip)
...     print([ for _ in mass_reverse.results])
[('',), ('',), ('', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''), ('', '', '', '', '', '', '')]

ASN information

Request information about a particular ASN:

>>> asn = api.asn_info(19956)
>>> asn.as_name, asn.description, asn.networks_announced.ipv4
('TENNESSEE-NET', 'AT&T Corp.', 18)

Retreive the networks announced by the ASN and find out who they are assigned to (for IPv6, pass the parameter ipv6=True):

>>> as_nets = api.asn_networks(19956)
>>> for net in as_nets.results:
...     print(net.cidr, net.countrycode,
... US AT&T Services, Inc. US State of Tennesse-Nettn US AT&T Services, Inc. US Southwest Tennessee Community College US Southwest Tennessee Community College US AT&T Services, Inc. US AT&T Services, Inc. US AT&T Services, Inc. US TNII Networks US Tennessee State Govt US AT&T Services, Inc. US AT&T Services, Inc. US Motlow State Community College US Chattanooga State Community College US Tennessee Board of Regents US Tennessee Board of Regents US AT&T Services, Inc. US AT&T Services, Inc.


Official python library for the API







No releases published


No packages published