BigDataCloud Python SDK
Official Python SDK for BigDataCloud APIs. Strongly-typed client for IP Geolocation, Reverse Geocoding, Phone & Email Verification, Network Engineering — plus a GraphQL interface for all packages.
Installation
pip install bigdatacloud
API Key
Get a free API key at bigdatacloud.com/login. No credit card required.
Store your key in the BIGDATACLOUD_API_KEY environment variable:
export BIGDATACLOUD_API_KEY=your-key-here
Quick Start
from bigdatacloud import BigDataCloudClient
# Reads BIGDATACLOUD_API_KEY from environment
client = BigDataCloudClient.from_environment()
# Or pass the key directly
# client = BigDataCloudClient("your-key-here")
# IP Geolocation
geo = client.ip_geolocation.get("1.1.1.1")
print(f"{geo.location.city}, {geo.country.name}")
# Full geolocation with hazard report
full = client.ip_geolocation.get_full("1.1.1.1")
print(f"Security: {full.security_threat}")
print(f"Is Tor: {full.hazard_report.is_known_as_tor_server}")
# Reverse Geocoding
place = client.reverse_geocoding.reverse_geocode(-33.87, 151.21)
print(f"{place.city}, {place.principal_subdivision}, {place.country_name}")
# Phone Validation
phone = client.verification.validate_phone("+61412345678", "AU")
print(f"Valid: {phone.is_valid}, Type: {phone.line_type}")
# Email Verification
email = client.verification.verify_email("user@example.com")
print(f"Valid: {email.is_valid}, Disposable: {email.is_disposable}")
Context Manager
with BigDataCloudClient.from_environment() as client:
geo = client.ip_geolocation.get("1.1.1.1")
Confidence Area
The confidence_area field may encode multiple polygons. Use the helper:
from bigdatacloud import split_into_polygons
geo = client.ip_geolocation.get_with_confidence_area("1.1.1.1")
polygons = split_into_polygons(geo.confidence_area)
for ring in polygons:
print(f"Polygon with {len(ring)} points")
GraphQL
BigDataCloud is the only IP geolocation provider with a GraphQL interface. Use the fluent builders to select exactly the fields you need:
# Select only city, country flag, and confidence
result = client.graphql.ip_geolocation.ip_data("1.1.1.1",
lambda q: q.locality().country(lambda c: c.flag_emoji()).confidence())
print(result["locality"]["city"])
# Reverse geocoding with timezone
loc = client.graphql.reverse_geocoding.location_data(-33.87, 151.21,
lambda q: q.locality().country().timezone())
# Phone & Email
email = client.graphql.verification.email_verification("user@example.com")
phone = client.graphql.verification.phone_number("+61412345678")
# Network Engineering
asn = client.graphql.network_engineering.asn_info_full("AS13335",
lambda q: q.basic_info().receiving_from())
Raw queries are also supported:
data = client.graphql.ip_geolocation.query_raw("""
{
ipData(ip: "1.1.1.1") {
locality { city }
country { name }
}
}
""")
Available APIs
| Client | Key Methods |
|---|---|
client.ip_geolocation |
get, get_with_confidence_area, get_full, get_country_by_ip, get_country_info, get_all_countries, get_hazard_report, get_user_risk, get_asn_info, get_network_by_ip, get_timezone_by_iana_id, get_timezone_by_ip, parse_user_agent |
client.reverse_geocoding |
reverse_geocode, reverse_geocode_with_timezone, get_timezone_by_location |
client.verification |
validate_phone, validate_phone_by_ip, verify_email |
client.network_engineering |
get_asn_info_extended, get_receiving_from, get_transit_to, get_bgp_prefixes, get_networks_by_cidr, get_asn_rank_list, get_tor_exit_nodes |
client.graphql.ip_geolocation |
ip_data, country_info, user_agent, timezone_info, query_raw |
client.graphql.reverse_geocoding |
location_data, query_raw |
client.graphql.verification |
email_verification, phone_number, query_raw |
client.graphql.network_engineering |
asn_info_full, network_by_ip, query_raw |
Samples
python samples/ip_geolocation.py
python samples/reverse_geocoding.py
python samples/verification.py
python samples/network_engineering.py
python samples/graphql_sample.py
License
MIT — see LICENSE.
Metadata
Release files for bigdatacloud 1.1.0
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 | |
|---|---|---|---|---|
| bigdatacloud-1.1.0.tar.gz | 20.0 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| bigdatacloud-1.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 44.3 kB
Release files / bigdatacloud-1.1.0.tar.gz
| Download URL | bigdatacloud-1.1.0.tar.gz |
|---|---|
| Size | 20.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
49e63a6cf587cf044fdd895ebd48ee4be4c53016ec48fcaf5d815e3f853c686a
|
|
BLAKE2b-256 checksum How to use checksums |
747d62cc9ae6fb855dd4157a2b58fc1659c253d4eb0071a4ec47867debe3ac6d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.12
|
Release files / bigdatacloud-1.1.0-py3-none-any.whl
| Download URL | bigdatacloud-1.1.0-py3-none-any.whl |
|---|---|
| Size | 24.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d37cd02e2f530665bcbe5ee30399991b6fdbf0937c32c9d48cd57a0051108716
|
|
BLAKE2b-256 checksum How to use checksums |
33f4e97b71b8497dbf659b972dad6daeb74d5dd8a19c88d34520edaffd5f34cd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.12
|
Security for bigdatacloud 1.1.0
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.