API Documentation

Complete technical reference for MEGABOT's Solana infrastructure APIs

Quick Start

Get up and running with MEGABOT APIs in under 5 minutes. All APIs use RESTful design with JSON responses.

1. Get Your API Key

Sign up for a free account at getmegabot.com/signup.html and receive your API key instantly. No credit card required for the free tier.

Free Tier Includes

100,000 requests/month • 10 req/sec • All API access • No credit card needed

2. Make Your First Request

All API requests must include your API key in the X-API-Key header:

curl https://api.getmegabot.com/api/rpc/health \
  -H "X-API-Key: sk_live_your_api_key_here"

Base URL

https://api.getmegabot.com

Authentication

MEGABOT uses API keys to authenticate requests. Include your API key in every request header:

X-API-Key: sk_live_your_api_key_here
Security Best Practices
  • Never share your API keys publicly or commit them to version control
  • Use environment variables to store API keys in your applications
  • Rotate your API keys regularly for enhanced security
  • Use different API keys for development and production environments

API Key Types

Type Prefix Usage
Test Key sk_test_ Development and testing environments
Live Key sk_live_ Production environments only

Rate Limits

Rate limits vary by tier and are enforced to ensure fair usage. Your current limits are returned in response headers:

Header Description
X-RateLimit-Limit Maximum requests per second for your tier
X-RateLimit-Remaining Remaining requests in current window
X-RateLimit-Reset Unix timestamp when rate limit resets

Rate Limit Tiers

Tier Requests/Second Monthly Quota
Free 10 req/sec 100,000 requests
Starter 50 req/sec 1,000,000 requests
Pro 200 req/sec 10,000,000 requests
Enterprise Custom Custom
429 Too Many Requests

If you exceed your rate limit, you'll receive a 429 response. Implement exponential backoff or upgrade your tier for higher limits.

SolanaRouter API

Intelligent RPC management with automatic failover across 10+ premium providers including Helius, QuickNode, Alchemy, and Chainstack.

RPC Proxy Endpoint

POST
/api/rpc

Proxy any Solana RPC method with automatic failover and intelligent load balancing. Supports all standard Solana JSON-RPC methods including getBalance, getAccountInfo, getTransaction, and more.

Request Parameters

Parameter Type Required Description
jsonrpc string Yes JSON-RPC version (always "2.0")
id integer Yes Request identifier
method string Yes Solana RPC method name
params array No Method-specific parameters

Example Request

curl -X POST https://api.getmegabot.com/api/rpc \
  -H "X-API-Key: sk_live_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "getBalance",
    "params": ["83astBRguLMdt2h5U1Tpdq5tjFoJ6noeGwaY3mDLVcri"]
  }'

Example Response

{
  "jsonrpc": "2.0",
  "result": {
    "context": {
      "slot": 123456789
    },
    "value": 5000000000
  },
  "id": 1
}

Health Check Endpoint

GET
/api/rpc/health

Check health status of all RPC providers. Returns latency, success rate, and availability for each provider in the network.

Example Request

curl https://api.getmegabot.com/api/rpc/health \
  -H "X-API-Key: sk_live_your_api_key_here"

Example Response

{
  "status": "healthy",
  "providers": [
    {
      "name": "Helius",
      "status": "online",
      "latency_ms": 45,
      "success_rate": 99.9,
      "last_check": "2025-01-15T10:30:00Z"
    },
    {
      "name": "QuickNode",
      "status": "online",
      "latency_ms": 52,
      "success_rate": 99.8,
      "last_check": "2025-01-15T10:30:00Z"
    }
  ],
  "total_providers": 10,
  "healthy_providers": 10
}

Automatic Failover

SolanaRouter automatically retries failed requests across multiple providers with zero configuration. The system intelligently routes requests based on:

  • Provider health and uptime statistics
  • Response latency and performance metrics
  • Geographic proximity to minimize latency
  • Load balancing across provider network
Built-in Redundancy

Every request is automatically backed by 10+ premium RPC providers. If one fails, we instantly route to the next fastest provider.

PumpIntel API

Real-time Pump.fun analytics and token intelligence with quality scoring, safety checks, and graduation tracking.

Get Graduations

GET
/api/analytics/graduations

Get recently graduated tokens from Pump.fun with quality scores, holder distribution, and comprehensive safety analysis.

Query Parameters

Parameter Type Required Description
limit integer No Number of results (default: 20, max: 100)
min_score integer No Minimum quality score (0-100)
sort string No Sort by: time, score, volume (default: time)

Example Request

curl https://api.getmegabot.com/api/analytics/graduations?limit=20 \
  -H "X-API-Key: sk_live_your_api_key_here"

Example Response

{
  "graduations": [
    {
      "token_address": "DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263",
      "name": "Bonk",
      "symbol": "BONK",
      "graduation_time": "2025-01-15T10:00:00Z",
      "quality_score": 87,
      "holder_count": 15432,
      "liquidity_usd": 125000,
      "volume_24h": 450000,
      "safety_flags": [],
      "risk_level": "low"
    }
  ],
  "total_count": 1,
  "page": 1
}

Token Analysis

GET
/api/analytics/token/:address

Get detailed analysis for a specific token including price performance, holder metrics, and comprehensive risk assessment.

Path Parameters

Parameter Type Required Description
address string Yes Token mint address

Example Request

curl https://api.getmegabot.com/api/analytics/token/PUMP_TOKEN_ADDRESS \
  -H "X-API-Key: sk_live_your_api_key_here"

Quality Scoring

PumpIntel assigns quality scores (0-100) to tokens based on multiple factors:

  • Holder distribution and concentration metrics
  • Liquidity depth and trading volume patterns
  • Developer wallet behavior and transparency
  • Community engagement and social signals
  • Contract safety and audit results
Score Range Rating Description
80-100 Excellent High quality with strong fundamentals
60-79 Good Solid metrics with minor concerns
40-59 Fair Mixed signals, proceed with caution
0-39 Poor Multiple red flags detected

WhaleAPI

Track smart money and institutional whale wallets in real-time with confidence scoring and portfolio analysis.

Discover Whales

GET
/api/whale/discover

Discover top-performing whale wallets based on historical performance, win rate, and trading patterns.

Query Parameters

Parameter Type Required Description
limit integer No Number of results (default: 10, max: 50)
min_confidence integer No Minimum confidence score (0-100)
sort string No Sort by: pnl, winrate, volume (default: pnl)

Example Request

curl https://api.getmegabot.com/api/whale/discover?limit=10 \
  -H "X-API-Key: sk_live_your_api_key_here"

Example Response

{
  "whales": [
    {
      "address": "7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU",
      "confidence_score": 94,
      "total_pnl": 1250000,
      "win_rate": 0.78,
      "trades_30d": 156,
      "avg_position_size": 45000,
      "last_active": "2025-01-15T09:45:00Z"
    }
  ],
  "total_count": 1
}

Portfolio Analysis

GET
/api/whale/:address/portfolio

Get comprehensive portfolio analysis for a whale wallet including current positions, P&L, and entry/exit timing.

Path Parameters

Parameter Type Required Description
address string Yes Whale wallet address

Example Request

curl https://api.getmegabot.com/api/whale/WALLET_ADDRESS/portfolio \
  -H "X-API-Key: sk_live_your_api_key_here"

Example Response

{
  "wallet": "7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU",
  "total_value_usd": 850000,
  "positions": [
    {
      "token_address": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
      "token_symbol": "USDC",
      "amount": 500000,
      "value_usd": 500000,
      "entry_price": 1.0,
      "current_price": 1.0,
      "pnl_percent": 0,
      "entry_time": "2025-01-10T08:00:00Z"
    }
  ],
  "total_pnl": 125000,
  "total_pnl_percent": 17.2
}

Real-time Alerts

Configure webhooks to receive instant notifications when tracked whale wallets make significant moves:

  • New position entries above threshold size
  • Position exits and profit-taking events
  • Large token accumulation patterns
  • Smart money token discoveries
Pro & Enterprise Only

Real-time whale alerts via webhooks are available on Pro and Enterprise tiers. Configure in your dashboard.

Error Codes

MEGABOT uses standard HTTP response codes to indicate the success or failure of requests:

Code Status Description
200 OK Request successful
400 Bad Request Invalid parameters or malformed request
401 Unauthorized Invalid or missing API key
403 Forbidden Valid API key but insufficient permissions
404 Not Found Resource does not exist
429 Too Many Requests Rate limit exceeded
500 Internal Server Error Server error (contact support if persistent)
503 Service Unavailable Temporary service disruption

Error Response Format

{
  "error": {
    "code": "INVALID_API_KEY",
    "message": "The API key provided is invalid or expired",
    "status": 401,
    "timestamp": "2025-01-15T10:30:00Z"
  }
}

Webhooks

Configure webhooks to receive real-time notifications for whale activities and token graduations. Webhooks are available on Pro and Enterprise tiers.

Webhook Events

Event Type Description
whale.position.opened Whale wallet opens new position
whale.position.closed Whale wallet closes position
pump.graduation Token graduates from Pump.fun
pump.quality.high High quality token detected (score > 80)

Webhook Payload Example

{
  "event": "whale.position.opened",
  "timestamp": "2025-01-15T10:30:00Z",
  "data": {
    "whale_address": "7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU",
    "token_address": "DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263",
    "amount": 50000,
    "value_usd": 45000,
    "transaction_signature": "5j7s..."
  },
  "signature": "sha256_hmac_signature_here"
}

Verifying Webhook Signatures

All webhook payloads include an HMAC signature in the X-Webhook-Signature header. Verify signatures to ensure authenticity:

import hmac
import hashlib

def verify_webhook(payload, signature, secret):
    computed = hmac.new(
        secret.encode(),
        payload.encode(),
        hashlib.sha256
    ).hexdigest()
    return hmac.compare_digest(computed, signature)

Support

Need help integrating MEGABOT APIs? We're here to help!

Support Channel Response Time Availability
Email Support 24 hours All paid plans
Priority Support 4 hours Pro & Enterprise
Dedicated Slack 1 hour Enterprise only
Contact Support

Email: support@getmegabot.com

Include your API key prefix (first 8 characters) in all support requests for faster resolution.