Asynchronous multi-provider IP metadata lookup backend.
This module retrieves geolocation, ASN, organization, and privacy information for any IP address.
It aggregates data from multiple free public APIs — ipapi.co, ipinfo.io, and BigDataCloud — and merges them into a unified JSON schema.
It works immediately without any account or API key, while supporting optional tokens for enhanced accuracy.
GitHub-hosted IP Lookup Backend Source
IPINFO_TOKEN → enables ipinfo.io integrationBDC_KEY → enables BigDataCloud community API_merge_first_good) — ranks and normalizes results.| Variable | Description | Example |
|---|---|---|
REDIS_URL |
Optional Redis connection string (used for cache) | redis://localhost:6379/0 |
IPCACHE_TTL_SEC |
Default cache lifetime (seconds) | 1800 |
IPINFO_TOKEN |
Optional token for ipinfo.io API | <your_token> |
BDC_KEY |
Optional API key for BigDataCloud | <your_key> |
If no tokens are provided, the module still works using ipapi.co’s public endpoint.
import asyncio
from core.ip_lookup import lookup_ip
result = asyncio.run(lookup_ip("8.8.8.8"))
print(result)
Author: glitter💫 Trust Chain: DNSSEC · DANE · HSTS · CSP GitHub-hosted IP Lookup Backend Source