Skip to main content

Getting Started with Axol API

Get up and running with Axol API in 5 minutes. This guide covers signup, authentication, making your first request, and exploring key features.

Step 1: Sign Up and Get Your API Key

1.1 Create Account

Visit app.axol.io and sign up:

  • No credit card required for Free tier
  • Instant access to 150M compute units per month
  • Access to all 23+ supported blockchains

1.2 Get Your API Key

After signup:

  1. Navigate to Dashboard → API Keys
  2. Click "Generate New Key"
  3. Give it a name (e.g., "Production", "Development")
  4. Copy your API key - it starts with axol_

Security Best Practice: Never commit API keys to git or share them publicly.

# Store in environment variable
export AXOL_API_KEY="axol_your_key_here"

Step 2: Make Your First Request

2.1 Test with cURL

The simplest way to test:

curl -H "X-API-Key: $AXOL_API_KEY" \
https://api.axol.io/api/v1/gas/ethereum

Response:

{
"chain": "ethereum",
"slow": 20,
"standard": 25,
"fast": 30,
"instant": 35,
"timestamp": "2026-01-15T10:30:00Z",
"unit": "gwei"
}

2.2 Check Your Usage

Every response includes usage headers:

X-RateLimit-CU-Limit: 150000000
X-RateLimit-CU-Remaining: 149999995
X-RateLimit-CU-Reset: 1704153600
X-RateLimit-CU-Used: 5

What this means:

  • Your monthly limit: 150M CUs
  • Remaining this month: 149,999,995 CUs
  • This request used: 5 CUs
  • Limit resets on: Your next billing date (unix timestamp)

Step 3: Explore Core Features

3.1 Get Blockchain Data

Ethereum Balance

curl -H "X-API-Key: $AXOL_API_KEY" \
https://api.axol.io/api/v1/blockchain/ethereum/balance/0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb8

Response:

{
"address": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb8",
"balance": "12.5 ETH",
"balance_wei": "12500000000000000000",
"chain": "ethereum"
}

CU Cost: 15 CUs

Solana Balance

curl -H "X-API-Key: $AXOL_API_KEY" \
https://api.axol.io/api/v1/blockchain/solana/balance/7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU

Response:

{
"address": "7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU",
"balance": "10.5 SOL",
"balance_lamports": "10500000000",
"chain": "solana"
}

CU Cost: 15 CUs

3.2 Gas Price API (Built-in Value-Add)

Current Gas Prices

curl -H "X-API-Key: $AXOL_API_KEY" \
https://api.axol.io/api/v1/gas/ethereum

CU Cost: 5 CUs (10x cheaper than blockchain calls!)

Multi-Chain Gas Comparison

curl -H "X-API-Key: $AXOL_API_KEY" \
https://api.axol.io/api/v1/gas/compare?chains=ethereum,polygon,arbitrum

Response:

{
"comparison": [
{ "chain": "ethereum", "standard": 25 },
{ "chain": "polygon", "standard": 80 },
{ "chain": "arbitrum", "standard": 0.1 }
],
"cheapest": "arbitrum",
"timestamp": "2025-10-12T10:30:00Z"
}

CU Cost: 10 CUs

Historical Gas Data

curl -H "X-API-Key: $AXOL_API_KEY" \
"https://api.axol.io/api/v1/gas/ethereum/history?days=7"

CU Cost: 20 CUs per day requested

3.3 Price API (Built-in Value-Add)

Token Price

curl -H "X-API-Key: $AXOL_API_KEY" \
https://api.axol.io/api/v1/price/ethereum/USDC

Response:

{
"symbol": "USDC",
"price_usd": 0.9998,
"price_change_24h": -0.02,
"volume_24h": 5000000000,
"market_cap": 24000000000,
"timestamp": "2025-10-12T10:30:00Z"
}

CU Cost: 5 CUs

Historical Prices

curl -H "X-API-Key: $AXOL_API_KEY" \
"https://api.axol.io/api/v1/price/ethereum/ETH/history?days=30"

CU Cost: 15 CUs per day requested


Step 4: Use SDKs for Easier Integration

4.1 Python SDK

Install

pip install axol-api-client

Basic Usage

from axol import AxolClient

# Initialize client
client = AxolClient(api_key="your_api_key")

# Get gas prices
gas = client.gas.get_prices("ethereum")
print(f"Standard gas price: {gas.standard} gwei")

# Get balance
balance = client.blockchain.get_balance(
chain="ethereum",
address="0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb8"
)
print(f"Balance: {balance.balance_eth} ETH")

# Get token price
price = client.price.get_token_price(
chain="ethereum",
symbol="USDC"
)
print(f"USDC price: ${price.price_usd}")

Python SDK docs →

4.2 TypeScript/JavaScript SDK

Install

npm install @axol/api-client
# or
yarn add @axol/api-client

Basic Usage

import { AxolClient } from '@axol/api-client';

// Initialize client
const client = new AxolClient({ apiKey: 'your_api_key' });

// Get gas prices
const gas = await client.gas.getPrices('ethereum');
console.log(`Standard gas: ${gas.standard} gwei`);

// Get balance
const balance = await client.blockchain.getBalance({
chain: 'ethereum',
address: '0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb8'
});
console.log(`Balance: ${balance.balanceEth} ETH`);

// Get token price
const price = await client.price.getTokenPrice({
chain: 'ethereum',
symbol: 'USDC'
});
console.log(`USDC price: $${price.priceUsd}`);

TypeScript SDK docs →


Step 5: Monitor Your Usage

5.1 Dashboard

Visit app.axol.io/dashboard to see:

  • Current month CU usage (standard + trace)
  • Projected overage cost (if applicable)
  • Historical usage charts
  • Cost breakdown by method
  • Chain-by-chain analysis

5.2 Set Up Alerts

Configure alerts at 80%, 90%, and 95% of your monthly limit:

  1. Navigate to Dashboard → Alerts
  2. Click "Create Alert"
  3. Choose trigger percentage
  4. Add email or webhook destination

5.3 Usage Headers

Check usage on every response:

response = client.gas.get_prices("ethereum")

# Access usage info
print(f"CU used: {response.headers['X-RateLimit-CU-Used']}")
print(f"CU remaining: {response.headers['X-RateLimit-CU-Remaining']}")

Step 6: Optimize Your Usage

6.1 Choose the Right Method

Use the cheapest method that meets your needs:

NeedUseCU CostDon't UseCU Cost
Latest blocketh_blockNumber10eth_getBlockByNumber21-36
Current gasGas API5eth_gasPrice10
Token pricePrice API5On-chain oracle call26+

Savings Example:

  • 1M gas queries via eth_gasPrice = 10M CUs
  • 1M gas queries via Gas API = 5M CUs
  • Save 5M CUs (50%)

6.2 Cache When Possible

Cache responses that don't change frequently:

import time

class GasCache:
def __init__(self, ttl=60):
self.cache = {}
self.ttl = ttl

def get_gas(self, chain):
now = time.time()
if chain in self.cache:
data, timestamp = self.cache[chain]
if now - timestamp < self.ttl:
return data # Cache hit - no CU cost!

# Cache miss - fetch from API
data = client.gas.get_prices(chain)
self.cache[chain] = (data, now)
return data

6.3 Batch Requests

Use multi-chain endpoints when querying multiple chains:

# Instead of 3 separate calls (15 CUs)
curl /api/v1/gas/ethereum # 5 CUs
curl /api/v1/gas/polygon # 5 CUs
curl /api/v1/gas/arbitrum # 5 CUs

# Use comparison endpoint (10 CUs)
curl /api/v1/gas/compare?chains=ethereum,polygon,arbitrum # 10 CUs

# Save 5 CUs (33%)

Common Patterns

Pattern 1: Gas-Optimized Transaction

# 1. Check gas prices (5 CUs)
gas = client.gas.get_prices("ethereum")

# 2. Use appropriate tier based on urgency
if urgent:
gas_price = gas.fast
else:
gas_price = gas.standard

# 3. Estimate gas (87 CUs)
estimate = client.blockchain.estimate_gas(
chain="ethereum",
to="0x...",
data="0x..."
)

# 4. Send transaction
tx = send_transaction(gas_price, estimate)

# Total: 92 CUs

Pattern 2: Multi-Chain Portfolio Tracker

chains = ["ethereum", "polygon", "arbitrum", "optimism"]
address = "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb8"

portfolio = {}
for chain in chains:
# Get balance (15 CUs each)
balance = client.blockchain.get_balance(chain, address)

# Get token price (5 CUs each)
price = client.price.get_token_price(chain, "ETH")

portfolio[chain] = {
"balance": balance.balance,
"value_usd": balance.balance * price.price_usd
}

# Total: 80 CUs for 4-chain portfolio

Pattern 3: Real-Time Gas Monitoring

def monitor_gas(threshold_gwei=20):
"""Alert when gas drops below threshold."""
while True:
gas = client.gas.get_prices("ethereum")

if gas.standard <= threshold_gwei:
send_alert(f"Gas at {gas.standard} gwei!")
return

time.sleep(60) # Check every minute (5 CUs/check)

# Cost: ~7,200 CUs/day (5 CUs × 60 checks/hr × 24 hrs)

Next Steps

Learn More

Explore Features

Upgrade Your Plan


Getting Help

Documentation Issues?

Community & Support:

Technical Support:

  • Free tier: Community support via Discord
  • Paid tiers: Email hello@axol.io

Sales Questions: