Python 3 Integration

Python 3 module (using urllib.request)

import urllib.request
import json

def Lookup(ip):

	response = urllib.request.Request("{}".format(ip))
	response.add_header("X-Key", "YOUR_API_KEY_HERE")
		response = json.loads(urllib.request.urlopen(response).read().decode())
		return False # In the case of an error, pass all IP's to avoid blocking innocents

	return response.get("block") # Defaults to None if failed to get block value

To query an IP; you save the IPHub module in the same directory as your code and name it as then import it like a regular module:

import IPHub
IPHub.Lookup("") # returns True