ipinfaux
Unofficial ipinfo.io scraper. Gets IP data using a JWT token.
install
pip install ipinfaux
quick start
get a jwt token (login)
from ipinfaux import GetJWTByLogin
# login with email/password
jwt = GetJWTByLogin.login("your@email.com", "yourpassword")
# or with a proxy
jwt = GetJWTByLogin.login("your@email.com", "yourpassword", "http://proxy:8080")
lookup an ip
from ipinfaux import GetFullData
# use your jwt token
data = GetFullData("8.8.8.8", "your-jwt-token")
# check if it worked
if data.error:
print(f"failed: {data.error}")
else:
# access data
print(data.summary)
print(data.geolocation)
print(data.privacy)
examples
get data as json
data = GetFullData("1.1.1.1", jwt)
print(data.as_json()) # print json
data.save() # save to ipinfo_1.1.1.1.json
data.save("custom.json") # save to custom file
get data as csv
data = GetFullData("8.8.8.8", jwt)
print(data.as_csv()) # print csv
data.save_csv() # save to ipinfo_8.8.8.8.csv
data.save_csv("data.csv", delimiter=",")
multiple ips
ips = ["8.8.8.8", "1.1.1.1", "9.9.9.9"]
results = []
for ip in ips:
data = GetFullData(ip, jwt)
if not data.error:
results.append(data)
print(f"{ip}: {data.geolocation.get('city')}")
# save all to one csv
if results:
results[0].save_csv_batch(results, "all_ips.csv")
data structure
{
"ip": "8.8.8.8",
"summary": {
"asn": "AS15169",
"rpki": true,
"asn_name": "Google LLC",
"hostname": "dns.google",
"range": "8.8.8.0/24",
"company": "Google LLC",
"hosted_domains_count": 20572,
"privacy": true,
"anycast": true,
"asn_type": "hosting",
"abuse_email": "network-abuse@google.com"
},
"geolocation": {
"city": "Mountain View",
"state": "California",
"country": "United States",
"country_code": "us",
"postal": "94043",
"timezone": "America/Los_Angeles",
"latitude": 37.4056,
"longitude": -122.0775
},
"privacy": {
"hosting": true,
"vpn": false,
"proxy": false,
"tor": false,
"relay": false,
"residential_proxy": false,
"details": {}
},
"asn": {
"asn": "15169",
"asn_name": "Google LLC",
"domain": "google.com",
"asn_type": "hosting"
},
"abuse": {
"address": "Mountain View, 1600 Amphitheatre Parkway, 94043",
"phone": "+1-650-253-0000",
"email": "network-abuse@google.com",
"name": "Abuse",
"network": "8.8.8.0/24"
},
"domains": {
"count": 15,
"domains": [
"hdchina.org",
"55188.com",
"ymck.me",
"ymjump.com",
"musicool.cn",
"viewpointcloud.com",
"itempurl.com",
"authrock.com",
"gbwhatspro.com",
"epicloud.link",
"btempurl.com",
"mysapo.vn",
"everincloud.com",
"farglory-hotel.com.tw",
"raptorx.co"
]
},
"tags": {
"airplane": false,
"airport": false,
"anycast": true,
"bittorrent": false,
"cdn": true,
"cloud": false,
"crawler": false,
"geodns": false,
"hosting": true,
"hotel": false,
"hotspot": false,
"ix": false,
"mailserver": false,
"mobile": false,
"nameserver": false,
"portscan": false,
"proxy": false,
"relay": false,
"router": false,
"satellite": false,
"ssh": false,
"tor": false,
"vpn": false,
"webserver": true,
"bus_station": false,
"conference_center": false,
"coworking_space": false,
"in_transit": false,
"library": false,
"sports_center": false,
"stadium": false,
"subway_station": false,
"train_station": false
},
"other_providers": {
"exists": false,
"city": null,
"state": null,
"country_code": null,
"distance_km": null,
"distance_text": null,
"full_text": null
}
}
fields explained
- summary - basic ip info (asn, hostname, company)
- geolocation - where the ip is located
- privacy - if ip is vpn/proxy/tor etc
- asn - autonomous system details
- abuse - who to contact for abuse
- domains - domains hosted on this ip
- tags - what kind of ip it is (cdn, hosting, etc)
- other_providers - only applicable if ipinfo thinks its wrong, shows what maxmind thinks
requirements
- python 3.7+
- requests
- beautifulsoup4
license
mit
Metadata
Release files for ipinfaux 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ipinfaux-0.0.1.tar.gz | 12.1 kB | Without provenance | Details for ipinfaux-0.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ipinfaux-0.0.1-py3-none-any.whl | Python 3 | none | any | Details for ipinfaux-0.0.1-py3-none-any.whl |
Total release size: 22.6 kB
Release files / ipinfaux-0.0.1.tar.gz
| Download URL | ipinfaux-0.0.1.tar.gz |
|---|---|
| Size | 12.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
79e34570b7f9263df8e0f49db1db19397fd0730ebec4cbcfd04c2c0399f85648
|
|
BLAKE2b-256 checksum How to use checksums |
e5c11dd72997f544eca280dc285993fa6215a0cad420734c1ec54cd369e71ea9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.2
|
Release files / ipinfaux-0.0.1-py3-none-any.whl
| Download URL | ipinfaux-0.0.1-py3-none-any.whl |
|---|---|
| Size | 10.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
70a01a2936ad89f4ed00eb70db66b26a321a0617599148a8128b87c30d1577d3
|
|
BLAKE2b-256 checksum How to use checksums |
bcd3911a1a7a5bf40e46fe7be58920f9cf09c93a1dd37754147ac980015e90d3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.2
|
Security for ipinfaux 0.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.