{ "info": { "author": "NetworksDB", "author_email": "contact@networksdb.io", "bugtrack_url": null, "classifiers": [], "description": "# NetworksDB.io official Python library\n\nThis 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.\n\n**This requires a NetworksDB API token**. You can get one for free at our website, https://networksdb.io/api/docs. Free keys come with limitations, such as a limited monthly quota and truncated output for large result sets.\n\nThe details returned by the API include, but aren't limited to, the following:\n\n- **Organisation info**: Name, address, phone, countries, number of IPv4 and IPv6 networks, number of networks by country, assigned ASNs\n- **Organisation networks**: Description, name, size, CIDR, start IP, end IP for each network operated by a specific organisation\n- **IP info**: Number of domains resolving to the IPv4 or IPv6 address, owner organisation info, name and description of the network containing the address.\n- **IP geolocation**: Country, state, city, latitude and longitude. \n- **ASN info**: Information about the autonomous system, including the owner company.\n- **ASN networks**: IPv4/6 network prefixes announced by the autonomous system, including the company they are allocated to.\n- **Reverse DNS**: List of domain names resolving to the IP address.\n- **\"Mass\" reverse DNS**: List of domain names resolving to addresses in an IP range.\n\n## Installation\n\n```\npip install networksdb\n```\n\nOr clone the repository and run `python3 setup.py install`.\n\n## Quick Start\n\nStart by getting an instance of a NetworksDB API handler, supplying your API key.\n```\nfrom networksdb import NetworksDB\n>>> api = NetworksDB('0123456789')\n```\nGet information about an IP address:\n```\n>>> ip = api.ip_info('8.8.8.8')\n```\nOmitting the parameter will return information about your source IP address.\n\nReturn information about the owner, networks and domains:\n```\n>>> ip.organisation.name\n'Google LLC'\n>>> ip.domains_on_ip\n7243\n>>> ip.network.cidr\n'8.8.8.0/24'\n>>> ip.network.netname\n'LVLT-GOGL-8-8-8'\n```\n\nRequest geolocation information (This works with IPv6 addresses too):\n```\n>>> geo = api.ip_geo('8.8.8.8')\n>>> geo.continent, geo.country, geo.state, geo.city, geo.latitude, geo.longitude\n('North America', 'United States', 'California', 'Mountain View', 37.406, -122.079)\n```\n\nView the full API response details by printing any `Response` object:\n```\n>>> print(ip)\n{\n \"ip\": \"8.8.8.8\",\n \"domains_on_ip\": 7243,\n \"url\": \"https://networksdb.io/ip/8.8.8.8\",\n \"organisation\": {\n \"name\": \"Google LLC\",\n \"id\": \"google-llc\",\n \"url\": \"https://networksdb.io/ip-addresses-of/google-llc\"\n },\n \"network\": {\n \"netname\": \"LVLT-GOGL-8-8-8\",\n \"description\": \"Google LLC\",\n \"cidr\": \"8.8.8.0/24\",\n \"first_ip\": \"8.8.8.0\",\n \"last_ip\": \"8.8.8.255\",\n \"url\": \"https://networksdb.io/ips-in-network/8.8.8.0/8.8.8.255\"\n }\n}\n```\n\n### Organisation search\n\nTo 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:\n\n```\n>>> search = api.org_search('Github')\n>>> search.total\n1\n>>> search.results[0].organisation\n'GitHub, Inc'\n>>> search.results[0].id\n'github-inc'\n```\n### Organisation Info\nOnce you've found the correct ID, pass it to the *organisation info* API call:\n```\n>>> github = api.org_info('github-inc')\n>>>> print(github)\n{\n \"organisation\": \"GitHub, Inc\",\n \"id\": \"github-inc\",\n \"address\": null,\n \"phone\": null,\n \"countries\": [\n \"United States\"\n ],\n \"networks\": {\n \"ipv4\": 8,\n \"ipv6\": 2\n },\n \"networks_by_country\": {\n \"United States\": 10\n },\n \"url\": \"https://networksdb.io/ip-addresses-of/github-inc\",\n \"asns\": [\n \"36459\"\n ]\n}\n```\n### Organisation networks\n\nFind out which networks they own or operate:\n```\n>>> github_networks = api.org_networks(github.id)\n>>> for result in github_networks.results:\n... print(result.netname, result.description, result.cidr)\n... \nGITHU GitHub, Inc 140.82.112.0/20\nUS-GITHUB-20170413 GitHub, Inc 185.199.108.0/22\nGITHUB-NET4-1 GitHub, Inc 192.30.252.0/22\nRSPC-728F4421-0D7C-4F42-BDFD-A6D290538501 GitHub 74.205.116.224/28\nZAYO-IDIA-235983-64-124-138-32-28 GitHub 64.124.138.32/28\nRSPC-039EB5D8-39DC-445A-9C23-05529A657DDC GitHub 148.62.46.192/29\nRSPC-48B1F3A4-2615-4566-99CD-D126E3C102BB GitHub 174.143.3.100/30\nRSPC-CC4A7060-6141-4A22-BD6B-98A2B581247D GitHub 148.62.46.150/31\n```\nOr, for IPv6:\n```\n>>> github_ipv6_networks = api.org_networks('github-inc', ipv6=True)\n>>> for result in github_ipv6_networks.results:\n... print(result.netname, result.description, result.cidr)\n... \nUS-GITHUB-20170419 GitHub, Inc 2a0a:a440::/29\nGITHUB-NET6-1 GitHub, Inc 2620:112:3000::/44\n```\n\n### Reverse DNS\n\nList the domains names resolving to a given IPv4 or IPv6 address:\n```\n>>> reverse_dns = api.reverse_dns('185.199.108.153')\n>>> reverse_dns.total\n96658\n>>> reverse_dns.results[:10]\n('0-0.uk', '0000000000000.net', '000fff.design', '001.run', '0061.ru', '00ul.com', '01-partners.com', '01010111.com', '013627.xyz', '01coin.io')\n```\nMass reverse DNS is the same thing, but on a full network block:\n```\n>>> mass_reverse = api.mass_reverse_dns('185.199.108.0/22')\n>>> mass_reverse.total\n359808\n>>> for res in mass_reverse.results[:4]:\n... print(res.ip, res.domains)\n... \n185.199.108.0 ('jidanlee.com', 'jitianbo.com', 'tessmichi.com')\n185.199.108.1 ('deepwaves.tech',)\n185.199.108.15 ('canyourecognize.ga', 'djuric.se', 'glenberis.co.uk', 'hectormanrique.com', 'trustkaro.com')\n185.199.108.22 ('jidanlee.com',)\n```\nNote: This API endpoint is not available to the free plan.\n\n### Find all domains hosted by a company\nIt's pretty easy to iterate through the company's networks and request the list of domain names for each network:\n```\n>>> for network in api.org_networks('paypal-inc').results:\n... mass_reverse = api.mass_reverse_dns(network.first_ip, network.last_ip)\n... print([_.domains for _ in mass_reverse.results])\n... \n[...]\n[('test-paypal.com',), ('test-paypal.com',), ('paypal-australia.com.au', 'paypal-business.co.uk', 'paypal-business.com.au', 'paypal-businesscenter.com', 'paypal-communications.com', 'paypal-danmark.dk', 'paypal-donations.co.uk', 'paypal-donations.com', 'paypal-globalshops.com', 'paypal-knowledge-test.com', 'paypal-knowledge.com', 'paypal-marketing.ca', 'paypal-marketing.co.uk', 'paypal-media.com', 'paypal-norge.no', 'paypal-optimizer.com', 'paypal-partners.com', 'paypal-passport.com', 'paypal-prepagata.com', 'paypal-promo.es', 'paypal-sverige.se', 'paypal-turkiye.com', 'paypal.com.cn', 'paypalbenefits.com', 'paypalgivingfund.org', 'paypalobjects.com'), ('paypal-australia.com.au', 'paypal-business.co.uk', 'paypal-business.com.au', 'paypal-businesscenter.com', 'paypal-communications.com', 'paypal-danmark.dk', 'paypal-donations.co.uk')]\n[...]\n```\n\n### ASN information\nRequest information about a particular ASN:\n```\n>>> asn = api.asn_info(19956)\n>>> asn.as_name, asn.description, asn.networks_announced.ipv4\n('TENNESSEE-NET', 'AT&T Corp.', 18)\n```\nRetreive the networks announced by the ASN and find out who they are assigned to (for IPv6, pass the parameter `ipv6=True`):\n```\n>>> as_nets = api.asn_networks(19956)\n>>> for net in as_nets.results:\n... print(net.cidr, net.countrycode, net.organisation.name)\n... \n12.204.201.0/24 US AT&T Services, Inc.\n12.204.208.0/24 US State of Tennesse-Nettn\n12.204.209.0/24 US AT&T Services, Inc.\n64.79.176.0/21 US Southwest Tennessee Community College\n64.79.184.0/21 US Southwest Tennessee Community College\n66.4.14.0/23 US AT&T Services, Inc.\n66.4.27.0/24 US AT&T Services, Inc.\n66.4.28.0/22 US AT&T Services, Inc.\n70.150.247.0/24 US TNII Networks\n72.159.76.0/24 US Tennessee State Govt\n170.141.60.0/23 US AT&T Services, Inc.\n170.141.62.0/24 US AT&T Services, Inc.\n170.178.136.0/22 US Motlow State Community College\n192.230.240.0/20 US Chattanooga State Community College\n198.146.0.0/16 US Tennessee Board of Regents\n206.23.0.0/16 US Tennessee Board of Regents\n208.63.129.0/24 US AT&T Services, Inc.\n208.182.101.0/24 US AT&T Services, Inc.\n```\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://networksdb.io", "keywords": "", "license": "Apache License 2.0", "maintainer": "", "maintainer_email": "", "name": "networksdb", "package_url": "https://pypi.org/project/networksdb/", "platform": "", "project_url": "https://pypi.org/project/networksdb/", "project_urls": { "Homepage": "https://networksdb.io" }, "release_url": "https://pypi.org/project/networksdb/1.0.3/", "requires_dist": [ "requests", "attrdict" ], "requires_python": "", "summary": "Official Python library for NetworksDB.io", "version": "1.0.3" }, "last_serial": 5872799, "releases": { "1.0.3": [ { "comment_text": "", "digests": { "md5": "01862f9bb4b4c95e78558ba3b83315ff", "sha256": "289988664a67dd12852563c5f38b9435d5133be39f71c440b7e47e38f3371032" }, "downloads": -1, "filename": "networksdb-1.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "01862f9bb4b4c95e78558ba3b83315ff", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 9226, "upload_time": "2019-09-23T10:31:34", "url": "https://files.pythonhosted.org/packages/c0/17/1c90993adafa7cf1f5715c54ff65eea326cdd48b595091e02d2423df8e6c/networksdb-1.0.3-py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "01862f9bb4b4c95e78558ba3b83315ff", "sha256": "289988664a67dd12852563c5f38b9435d5133be39f71c440b7e47e38f3371032" }, "downloads": -1, "filename": "networksdb-1.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "01862f9bb4b4c95e78558ba3b83315ff", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 9226, "upload_time": "2019-09-23T10:31:34", "url": "https://files.pythonhosted.org/packages/c0/17/1c90993adafa7cf1f5715c54ff65eea326cdd48b595091e02d2423df8e6c/networksdb-1.0.3-py3-none-any.whl" } ] }