API Documentation

Comprehensive developer guide for integrating with solanasniperbot.org trading automation platform. Access real-time market data, execute automated trades, and build custom trading strategies on the Solana blockchain.

Getting Started

The solanasniperbot.org API provides programmatic access to our Solana sniper bot infrastructure, enabling developers to build custom trading applications, automated strategies, and real-time monitoring tools. Our API follows RESTful principles with JSON responses and supports WebSocket connections for streaming data.

Base URL

https://api.solanasniperbot.org/v1

WebSocket URL

wss://ws.solanasniperbot.org/v1/stream

Note: All API endpoints require authentication via API keys. Rate limits apply based on your subscription tier (Velocity: 100 req/min, Thunder: 500 req/min, Quantum: 2000 req/min).

Authentication

solanasniperbot.org uses API key authentication with HMAC-SHA256 signing for secure request verification. Generate your API keys from the dashboard after subscribing to a plan.

Generating API Keys

  1. Navigate to Dashboard → Settings → API Keys
  2. Click "Generate New API Key"
  3. Store your API Key and Secret Key securely (secret key shown only once)
  4. Add appropriate permissions (read, trade, manage)

Authentication Headers

X-API-Key: your_api_key_here
X-API-Timestamp: 1704067200000
X-API-Signature: hmac_sha256_signature

Signature Generation Example

JavaScript / Node.js
const crypto = require('crypto');

function generateSignature(apiSecret, timestamp, method, path, body = '') {
  const message = timestamp + method + path + body;
  const signature = crypto
    .createHmac('sha256', apiSecret)
    .update(message)
    .digest('hex');
  return signature;
}

// Usage example
const apiKey = 'your_api_key';
const apiSecret = 'your_api_secret';
const timestamp = Date.now().toString();
const method = 'POST';
const path = '/v1/snipes';
const body = JSON.stringify({ token: 'SOL_TOKEN_ADDRESS', amount: 1.5 });

const signature = generateSignature(apiSecret, timestamp, method, path, body);

const headers = {
  'X-API-Key': apiKey,
  'X-API-Timestamp': timestamp,
  'X-API-Signature': signature,
  'Content-Type': 'application/json'
};
Python
import hmac
import hashlib
import time
import json

def generate_signature(api_secret, timestamp, method, path, body=''):
    message = f"{timestamp}{method}{path}{body}"
    signature = hmac.new(
        api_secret.encode('utf-8'),
        message.encode('utf-8'),
        hashlib.sha256
    ).hexdigest()
    return signature

# Usage example
api_key = 'your_api_key'
api_secret = 'your_api_secret'
timestamp = str(int(time.time() * 1000))
method = 'POST'
path = '/v1/snipes'
body = json.dumps({'token': 'SOL_TOKEN_ADDRESS', 'amount': 1.5})

signature = generate_signature(api_secret, timestamp, method, path, body)

headers = {
    'X-API-Key': api_key,
    'X-API-Timestamp': timestamp,
    'X-API-Signature': signature,
    'Content-Type': 'application/json'
}
Rust
use hmac::{Hmac, Mac};
use sha2::Sha256;
use hex;

type HmacSha256 = Hmac<Sha256>;

fn generate_signature(
    api_secret: &str,
    timestamp: &str,
    method: &str,
    path: &str,
    body: &str
) -> String {
    let message = format!("{}{}{}{}", timestamp, method, path, body);
    let mut mac = HmacSha256::new_from_slice(api_secret.as_bytes())
        .expect("HMAC can take key of any size");
    mac.update(message.as_bytes());
    hex::encode(mac.finalize().into_bytes())
}

// Usage example
let api_key = "your_api_key";
let api_secret = "your_api_secret";
let timestamp = chrono::Utc::now().timestamp_millis().to_string();
let method = "POST";
let path = "/v1/snipes";
let body = r#"{"token":"SOL_TOKEN_ADDRESS","amount":1.5}"#;

let signature = generate_signature(api_secret, &timestamp, method, path, body);

RESTful API Endpoints

GET/v1/markets/tokens/:address

Get Token Information

Retrieve comprehensive information about a specific Solana token including price, liquidity, holder count, and security metrics.

Request Example

curl -X GET "https://api.solanasniperbot.org/v1/markets/tokens/EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v" \
  -H "X-API-Key: your_api_key" \
  -H "X-API-Timestamp: 1704067200000" \
  -H "X-API-Signature: signature_here"

Response Example

{
  "success": true,
  "data": {
    "address": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
    "symbol": "USDC",
    "name": "USD Coin",
    "decimals": 6,
    "price": 1.0002,
    "price_change_24h": 0.02,
    "volume_24h": 458392847.32,
    "liquidity_usd": 127594839.21,
    "holder_count": 12847593,
    "market_cap": 3458392847,
    "fully_diluted_valuation": 3458392847,
    "circulating_supply": 3458392847,
    "total_supply": 3458392847,
    "security": {
      "is_honeypot": false,
      "is_proxy": false,
      "has_mint_authority": true,
      "has_freeze_authority": true,
      "risk_score": 12
    },
    "dex_listings": ["Raydium", "Jupiter", "Orca"],
    "timestamp": 1704067200000
  }
}
POST/v1/snipes

Create Snipe Order

Execute an automated snipe order for token launch detection and instant purchase. Our Pump.fun sniper bot monitors DEX pools and executes trades within milliseconds of liquidity addition.

Request Parameters

ParameterTypeRequiredDescription
token_addressstringYesTarget token contract address
amount_solnumberYesSOL amount to spend
slippagenumberNoMax slippage tolerance (default: 10%)
priority_feenumberNoPriority fee in microlamports
anti_rugbooleanNoEnable anti-rug checks (default: true)
auto_sellobjectNoAuto-sell configuration

Request Example

curl -X POST "https://api.solanasniperbot.org/v1/snipes" \
  -H "X-API-Key: your_api_key" \
  -H "X-API-Timestamp: 1704067200000" \
  -H "X-API-Signature: signature_here" \
  -H "Content-Type: application/json" \
  -d '{
    "token_address": "TokenAddress123...",
    "amount_sol": 2.5,
    "slippage": 15,
    "priority_fee": 50000,
    "anti_rug": true,
    "auto_sell": {
      "enabled": true,
      "take_profit": 200,
      "stop_loss": 50
    }
  }'

Response Example

{
  "success": true,
  "data": {
    "snipe_id": "snp_8dj39fks83jd9f",
    "status": "pending",
    "token_address": "TokenAddress123...",
    "amount_sol": 2.5,
    "estimated_tokens": 156789.234,
    "priority_fee": 50000,
    "created_at": 1704067200000
  }
}
GET/v1/account/balance

Get Account Balance

Retrieve current SOL balance and token holdings for connected wallet.

Response Example

{
  "success": true,
  "data": {
    "wallet_address": "YourWalletAddress123...",
    "sol_balance": 45.23847,
    "tokens": [
      {
        "address": "TokenAddress1...",
        "symbol": "TOKEN1",
        "balance": 1500.45,
        "value_usd": 3250.89
      },
      {
        "address": "TokenAddress2...",
        "symbol": "TOKEN2",
        "balance": 8900.12,
        "value_usd": 15678.34
      }
    ],
    "total_value_usd": 48929.23
  }
}
GET/v1/trades/history

Get Trade History

Retrieve paginated trade history with filtering options for date range, token, and trade type.

Query Parameters

ParameterTypeDescription
limitintegerNumber of results (1-100, default: 50)
offsetintegerPagination offset (default: 0)
tokenstringFilter by token address
typestringFilter by type: buy, sell, or all

Response Example

{
  "success": true,
  "data": {
    "trades": [
      {
        "trade_id": "trd_8dj39fks83jd9f",
        "type": "buy",
        "token_address": "TokenAddress123...",
        "token_symbol": "TOKEN",
        "amount_sol": 2.5,
        "tokens_received": 156789.234,
        "price": 0.00001594,
        "signature": "TransactionSignature123...",
        "timestamp": 1704067200000,
        "profit_loss": null
      }
    ],
    "pagination": {
      "total": 347,
      "limit": 50,
      "offset": 0,
      "has_more": true
    }
  }
}

WebSocket Streaming API

Subscribe to real-time market data streams for instant notifications on new token launches, price updates, liquidity changes, and trade execution status. WebSocket connections provide sub-second latency for time-sensitive trading operations.

Connection Example

JavaScript WebSocket Client
const WebSocket = require('ws');

const ws = new WebSocket('wss://ws.solanasniperbot.org/v1/stream', {
  headers: {
    'X-API-Key': 'your_api_key',
    'X-API-Timestamp': Date.now().toString(),
    'X-API-Signature': 'your_signature'
  }
});

ws.on('open', () => {
  console.log('Connected to SolanaSniperBot WebSocket');
  
  // Subscribe to new token launches on Pump.fun
  ws.send(JSON.stringify({
    action: 'subscribe',
    channels: ['launches:pumpfun', 'prices:all', 'trades:account']
  }));
});

ws.on('message', (data) => {
  const message = JSON.parse(data);
  console.log('Received:', message);
  
  if (message.channel === 'launches:pumpfun') {
    console.log('New token launched:', message.data);
    // Execute auto-snipe logic here
  }
});

ws.on('error', (error) => {
  console.error('WebSocket error:', error);
});

ws.on('close', () => {
  console.log('WebSocket connection closed');
});

Available Channels

ChannelDescription
launches:pumpfunNew token launches on Pump.fun
launches:raydiumNew pools on Raydium DEX
prices:allReal-time price updates for all tokens
prices:TOKEN_ADDRESSPrice updates for specific token
trades:accountYour trade execution status updates
alerts:rugAnti-rug alerts for monitored tokens

Message Format Example

// New Token Launch Event
{
  "channel": "launches:pumpfun",
  "event": "new_token",
  "data": {
    "token_address": "NewTokenAddress123...",
    "name": "Awesome Token",
    "symbol": "AWESOME",
    "initial_liquidity": 5000.0,
    "creator": "CreatorAddress123...",
    "timestamp": 1704067200000,
    "security_score": 85
  }
}

// Price Update Event
{
  "channel": "prices:all",
  "event": "price_update",
  "data": {
    "token_address": "TokenAddress123...",
    "symbol": "TOKEN",
    "price": 0.00001594,
    "price_change_1m": 2.34,
    "volume_1m": 45678.90,
    "timestamp": 1704067200000
  }
}

// Trade Execution Event
{
  "channel": "trades:account",
  "event": "trade_executed",
  "data": {
    "trade_id": "trd_8dj39fks83jd9f",
    "type": "buy",
    "status": "confirmed",
    "token_address": "TokenAddress123...",
    "amount_sol": 2.5,
    "tokens_received": 156789.234,
    "signature": "TransactionSignature123...",
    "timestamp": 1704067200000
  }
}

Error Handling

The API uses standard HTTP status codes and returns detailed error messages in JSON format. Implement proper error handling and retry logic for production applications.

HTTP Status Codes

CodeMeaning
200Success - Request completed successfully
400Bad Request - Invalid parameters or malformed request
401Unauthorized - Invalid or missing API key
403Forbidden - Insufficient permissions for requested action
429Rate Limited - Too many requests, slow down
500Server Error - Internal server error, retry later

Error Response Format

{
  "success": false,
  "error": {
    "code": "INSUFFICIENT_BALANCE",
    "message": "Insufficient SOL balance to execute trade",
    "details": {
      "required": 2.5,
      "available": 1.3
    }
  }
}

Rate Limits & Best Practices

Rate limits are enforced based on your subscription tier to ensure fair resource allocation and optimal platform performance for all users.

PlanREST APIWebSocket
Velocity Pack100 requests/minute5 connections
Thunder Pack500 requests/minute25 connections
Quantum Pack2000 requests/minute100 connections

Best Practices

  • Cache frequently accessed data to reduce API calls
  • Use WebSocket streams for real-time data instead of polling REST endpoints
  • Implement exponential backoff retry logic for failed requests
  • Monitor rate limit headers in responses: X-RateLimit-Remaining
  • Batch multiple operations when possible to conserve API quota
  • Use webhooks for event-driven updates instead of continuous polling
  • Validate all input parameters client-side before API calls
  • Store API credentials securely using environment variables or secret managers

Security Considerations

Protecting your API credentials and implementing secure coding practices is critical for safe automated trading operations. Follow industry-standard security guidelines outlined by organizations like OWASP API Security Project.

Critical Security Rules

  • NEVER commit API keys to version control or share them publicly
  • NEVER expose API keys in client-side code or browser environments
  • NEVER reuse the same API key across multiple applications
  • NEVER store API secrets in plaintext configuration files

Recommended Practices

  • Use environment variables or secure vault services for credential storage
  • Rotate API keys regularly (recommended: every 90 days)
  • Implement IP whitelisting for production API keys when possible
  • Set appropriate permission scopes for each API key (read-only vs. trade permissions)
  • Monitor API usage logs for suspicious activity or unauthorized access attempts
  • Use separate API keys for development, staging, and production environments
  • Implement request signing to prevent man-in-the-middle attacks
  • Always use HTTPS/WSS for API communications

Official SDK Libraries

We provide official SDKs for popular programming languages to simplify integration with solanasniperbot.org. Each SDK handles authentication, request signing, and error handling automatically.

JavaScript / TypeScript

npm install @solanasniperbot/sdk

Full TypeScript support with type definitions included

Python

pip install solanasniperbot-sdk

Compatible with Python 3.8+

Rust

cargo add solanasniperbot-sdk

High-performance native Rust implementation

Go

go get github.com/solanasniperbot/sdk-go

Optimized for concurrent operations

Developer Support & Resources

Our developer support team is available to assist with API integration, troubleshooting, and technical questions. We also maintain comprehensive documentation and community resources.

Technical Support

Email: [email protected]

Response time: < 24 hours for all tiers

General Inquiries

Email: [email protected]

For account, billing, and subscription questions

Additional Resources

  • Interactive API playground available in your dashboard for testing endpoints without writing code
  • Code examples repository with implementation guides for common use cases
  • Community Discord server for peer support and discussions with other developers
  • Changelog and API version updates published at changelog.solanasniperbot.org
  • Status page for real-time API health monitoring at status.solanasniperbot.org

Related Documentation: Terms of Service · Privacy Policy · Risk Disclaimer