AxiomTradeAPI-py now uses the new Axiom trending endpoint:
from axiomtradeapi import AxiomTradeClient
import os
client = AxiomTradeClient(
auth_token=os.getenv("AXIOM_ACCESS_TOKEN"),
refresh_token=os.getenv("AXIOM_REFRESH_TOKEN")
)
trending = client.get_trending_tokens("1h")
print(f"Found {len(trending.get('tokens', []))} tokens")
The SDK returns a backward-compatible dictionary with these keys:
Example:
result = client.get_trending_tokens("24h")
print(result["requestedTimePeriod"])
print(result["timePeriod"])
print(result["fallbackUsed"])
print(result["attemptedTimePeriods"])
Axiom occasionally returns transient 500 errors for some time ranges even while authentication is valid. When that happens, the SDK now:
This makes the call much more reliable for live bots and dashboards.
Normalized token entries may include fields such as:
Because the upstream payload is array-based and may evolve, the SDK also preserves the original row under raw.
The client now attempts a browser-style bootstrap automatically before trending calls. This reduces failures in environments where Axiom expects the user to be registered as an active browser session.
You can still call client.connect manually if you want to prewarm the session yourself.
For production bots, prefer checking fallbackUsed before making timeframe-sensitive decisions:
result = client.get_trending_tokens("7d")
if result.get("fallbackUsed"):
print("Using fallback data due to upstream instability")