Quick Start
Get up and running with Axol API in 5 minutes.
1. Get API Key
Get your API key at app.axol.io.
2. Install SDK
pip install axol-api-client
3. Make Your First Call
from axol import AxolClient
# Initialize client
client = AxolClient(api_key="your_api_key")
# Get current gas prices
gas = client.gas_prices("ethereum")
print(f"ETH Gas: {gas['fast']} gwei")
# Get block data
block = client.get_block("ethereum", "latest")
print(f"Latest block: {block['number']}")
# Stream real-time data
async def handle_gas_update(data):
print(f"Gas update: {data}")
client.ws.subscribe("gas_prices", handle_gas_update)
Common Operations
Multi-chain Balance Check
# Check balances across chains
address = "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb5"
balances = client.get_balances(address, [
"ethereum", "polygon", "arbitrum", "optimism"
])
for chain, balance in balances.items():
print(f"{chain}: {balance}")
Transaction History
# Get recent transactions
txs = client.get_transactions(
address="0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb5",
chain="ethereum",
limit=10
)
for tx in txs:
print(f"{tx['hash']}: {tx['value']} ETH")
WebSocket Streaming
import asyncio
async def stream_events():
# Connect to WebSocket
await client.ws.connect()
# Subscribe to multiple channels
await client.ws.subscribe("gas_prices", on_gas_update)
await client.ws.subscribe("new_blocks", on_new_block)
# Keep connection alive
await client.ws.run_forever()
def on_gas_update(data):
print(f"Gas: {data}")
def on_new_block(data):
print(f"Block: {data['number']}")
# Run the stream
asyncio.run(stream_events())
Rate Limits
All tiers use Compute Unit (CU) based limits:
- Free: 150M CUs/month, 500 CUPs throughput
- Paid tiers: Higher limits available - view pricing
Learn more: Pricing