Example
pip install "as213905 @ git+https://git.datacoria.com/Phylex/as213905-sdk.git@v1.1.0#subdirectory=python"Example
import os
from as213905 import AS213905, APIError
client = AS213905(os.environ["AS213905_API_KEY"])
try:
traffic = client.traffic(days=7)
print(f"p95: {traffic['p95_kbps']} kbps")
except APIError as error:
print(error.status, error.code, error.required_scope)
raiseCredential handling
Read the API key from a secret or environment variable. Reuse one client instance, set request cancellation in your application, and handle 429 responses according to Retry-After.