Skip to main content

a3api

Official Python client for the A3 Age Assurance API.

Typed, async-ready, with built-in retries — supports Python 3.9+.

Installation

pip install a3api

Quick Start

from a3api import A3Client, AssessAgeRequest, OsSignal

client = A3Client(api_key="your-api-key")

response = client.assess_age(AssessAgeRequest(
    os_signal=OsSignal.AGE_18_PLUS,
    user_country_code="US",
))

print(response.verdict)           # CONSISTENT
print(response.confidence_score)  # 0.95
print(response.verification_token)

Async

from a3api import AsyncA3Client, AssessAgeRequest, OsSignal

async with AsyncA3Client(api_key="your-api-key") as client:
    response = await client.assess_age(AssessAgeRequest(
        os_signal=OsSignal.AGE_18_PLUS,
        user_country_code="US",
    ))

With Behavioral Signals

from a3api import (
    A3Client, AssessAgeRequest, OsSignal,
    BehavioralMetrics, DeviceContext,
)

client = A3Client(api_key="your-api-key")

response = client.assess_age(AssessAgeRequest(
    os_signal=OsSignal.AGE_13_15,
    user_country_code="US",
    behavioral_metrics=BehavioralMetrics(
        avg_touch_precision=0.82,
        scroll_velocity=340.0,
        form_completion_time_ms=12000.0,
    ),
    device_context=DeviceContext(
        os_version="iOS 17.2",
        device_model="iPhone 15",
        is_high_contrast_enabled=False,
        screen_scale_factor=3.0,
    ),
))

Error Handling

from a3api import (
    A3Client, A3AuthenticationError,
    A3RateLimitError, A3ValidationError, A3ConnectionError,
)

try:
    response = client.assess_age(request)
except A3AuthenticationError:
    # Invalid or missing API key (401)
    pass
except A3RateLimitError as e:
    # Too many requests (429) — e.retry_after has the wait time
    pass
except A3ValidationError as e:
    # Bad request (400) — e.validation_errors has details
    pass
except A3ConnectionError:
    # Network or timeout error
    pass

Configuration

client = A3Client(
    api_key="your-api-key",
    base_url="https://api.a3api.io",  # default
    timeout=30.0,                      # seconds, default
    max_retries=2,                     # default
)

License

MIT

Metadata

Release files for a3api 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for a3api 0.1.2
File Size Uploaded Provenance
a3api-0.1.2.tar.gz 10.4 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for a3api 0.1.2
File Interpreter ABI Platform
a3api-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 19.1 kB

Release files / a3api-0.1.2.tar.gz

Download URL a3api-0.1.2.tar.gz
Size 10.4 kB
Tags Source
SHA-256 checksum
How to use checksums
6364299e1e4f5fba0795fee5b3830e83ef73ed35ae6e2ba7f32d04c80081bb0e
BLAKE2b-256 checksum
How to use checksums
5e41d2ae5c363e1e5340a3eac7bb75e379c1243926e598660925eafc0d72fa7b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.11

Release files / a3api-0.1.2-py3-none-any.whl

Download URL a3api-0.1.2-py3-none-any.whl
Size 8.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9c6c7502d0a6e5ab920f84223d5ec0b03b3fd4965dc8d20800bae8237e900e4c
BLAKE2b-256 checksum
How to use checksums
250e530d155366f549ff438a993de7d3ac98936925e265b64bdacb24f36b45b6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.11

Security for a3api 0.1.2

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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page