Python client for iplocate.net — IP geolocation API
Project description
iplocate-client
Python client for iplocate.net — IP geolocation API.
Installation
pip install iplocate-client
Quick start
from iplocate_client import IPLocate
client = IPLocate()
# Your current IP
client.lookup()
# Specific IP
client.lookup("8.8.8.8")
# Only specific fields
client.lookup("8.8.8.8", fields=["country", "city", "asn"])
Bulk lookup
Free tier: 50 req/min. With API key (free, requires account on iplocate.net): 250 req/min.
client = IPLocate(api_key="your_api_key")
results = client.bulk(["8.8.8.8", "1.1.1.1"])
Max 20 IPs per request.
Async
from iplocate_client import AsyncIPLocate
client = AsyncIPLocate()
data = await client.lookup("8.8.8.8")
results = await client.bulk(["8.8.8.8", "1.1.1.1"])
Available fields
city continent country country_iso latitude longitude timezone postal asn asn_number
Response always includes ip and ip_ver.
Error handling
from iplocate_client import RateLimitError, InvalidIPError
try:
client.lookup("bad_ip")
except InvalidIPError as e:
print(e)
except RateLimitError:
print("slow down")
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file iplocate_client-0.1.0.tar.gz.
File metadata
- Download URL: iplocate_client-0.1.0.tar.gz
- Upload date:
- Size: 3.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1debadef69f3d3059f8d898e5adb1935fe478c63dd785ef9c31e5f98dffe267a
|
|
| MD5 |
4460a819f65493112f68ce85cb0a8d3f
|
|
| BLAKE2b-256 |
8ccd5707ebf2cf04ed77c84e86f69cc56e4cc8526e655eccf373c0dd525519a0
|
File details
Details for the file iplocate_client-0.1.0-py3-none-any.whl.
File metadata
- Download URL: iplocate_client-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7b74fb1d2c7ea9174d8d3c460c059ca3ee7adaff5d97b4e5fa461fb450238629
|
|
| MD5 |
4146dd0e19ea5c3929957dae5d8984d6
|
|
| BLAKE2b-256 |
1c34d7f941d9a29f1f44730be32fb81434eedb87db2a2bc02a4f3aa5d0b0ccb6
|