Skip to content

Commit

Permalink
Better description fix type for bulk
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewCopeland committed Mar 23, 2024
1 parent 87ed8ac commit 03f5d17
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 10 deletions.
17 changes: 13 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# IPDetective Client
IPDetective is an API that focuses on bot and non-human IP detection to quickly identify if an IP address comes from a datacenter, VPN or proxy. You can signup to the free API by simply signing in to access your API key. IPDetective tracks over 1000 ASNs and detects over 250 million IP addresses as non-human users from +100 different origins, ranging from data centers, botnets, proxies and vpns.
[IPDetective](https://ipdetective.io) is an API that focuses on bot and non-human IP detection to quickly identify if an IP address comes from a datacenter, VPN or proxy. You can signup to the free API by simply signing in to access your API key. IPDetective tracks over 1000 ASNs and detects over 250 million IP addresses as non-human users from +100 different origins, ranging from data centers, botnets, proxies and vpns.

## Features
- IP Bot Detection
Expand All @@ -14,10 +14,19 @@ from ipdetective import IPDetective
def main():
api_key = os.getenv('IPDETECTIVE_API_KEY')
ip_client = IPDetective(api_key)
ip_address = '8.8.8.8'
ip_info = ip_client.GetIpInfo(ip_address)

# Get information about a singular IP address
ip_info = ip_client.GetIpInfo('8.8.8.8')
print(ip_info)
# {'ip': '8.8.8.8', 'bot': True, 'type': 'bot', 'asn': 15169, 'asn_description': 'GOOGLE', 'country_code': 'US', 'country_name': 'United States of America'}

# Get information about build IP addresses
bulk_ip_info = ip_client.GetBulkIpInfo(['8.8.8.8', '1.1.1.1'])
print(bulk_ip_info)
# [{'ip': '1.1.1.1', 'bot': True, 'type': 'bot', 'asn': 13335, 'asn_description': 'CLOUDFLARENET', 'country_code': 'US', 'country_name': 'United States of America'}, {'ip': '8.8.8.8', 'bot': True, 'type': 'bot', 'asn': 15169, 'asn_description': 'GOOGLE', 'country_code': 'US', 'country_name': 'United States of America'}]

if __name__ == "__main__":
main()
```
```

[Check out our website](https://ipdetective.io)
2 changes: 1 addition & 1 deletion ipdetective.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def GetIpInfo(self, ip_address):
return {"error": "Internal server error occured"}
return response.json()

def GetBuilkIpInfo(self, ip_addresses):
def GetBulkIpInfo(self, ip_addresses):
headers = {'x-api-key': self.api_key}
url = f"{self.base_url}?info=true"
response = requests.post(url, headers=headers, json=ip_addresses)
Expand Down
12 changes: 9 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
from setuptools import setup, find_packages
from pathlib import Path
this_directory = Path(__file__).parent
long_description = (this_directory / "README.md").read_text()

setup(
name='ipdetective',
version='1.0.0',
version='1.0.1',
description='A Python client for IPDetective API',
long_description='''This package provides a Python client for retrieving bot and geolocation information for IP addresses using the IPDetective API. It allows users to query various details such as the country code, country name, ASN (Autonomous System Number), and IP Address classification like VPN, Proxy, Datacenter and Bot''',
long_description=long_description,
author='IPDetective',
author_email='[email protected]',
url='https://github.com/AndrewCopeland/ipdetective-client-python',
project_urls={
'Homepage': 'https://ipdetective.io',
'Source': 'https://github.com/AndrewCopeland/ipdetective-client-python'
},
packages=find_packages(),
install_requires=['requests'],
classifiers=[
Expand Down
9 changes: 7 additions & 2 deletions test.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,14 @@
def main():
api_key = os.getenv('IPDETECTIVE_API_KEY')
ip_client = IPDetective(api_key)
ip_address = '8.8.8.8'
ip_info = ip_client.GetIpInfo(ip_address)

# Get information about a singular IP address
ip_info = ip_client.GetIpInfo('8.8.8.8')
print(ip_info)

# Get information about build IP addresses
bulk_ip_info = ip_client.GetBulkIpInfo(['8.8.8.8', '1.1.1.1'])
print(bulk_ip_info)

if __name__ == "__main__":
main()

0 comments on commit 03f5d17

Please sign in to comment.