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/v1WebSocket URL
wss://ws.solanasniperbot.org/v1/streamNote: 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
- Navigate to Dashboard → Settings → API Keys
- Click "Generate New API Key"
- Store your API Key and Secret Key securely (secret key shown only once)
- Add appropriate permissions (read, trade, manage)
Authentication Headers
X-API-Key: your_api_key_here
X-API-Timestamp: 1704067200000
X-API-Signature: hmac_sha256_signatureSignature Generation Example
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'
};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'
}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, ×tamp, method, path, body);RESTful API Endpoints
/v1/markets/tokens/:addressGet 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
}
}/v1/snipesCreate 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
| Parameter | Type | Required | Description |
|---|---|---|---|
token_address | string | Yes | Target token contract address |
amount_sol | number | Yes | SOL amount to spend |
slippage | number | No | Max slippage tolerance (default: 10%) |
priority_fee | number | No | Priority fee in microlamports |
anti_rug | boolean | No | Enable anti-rug checks (default: true) |
auto_sell | object | No | Auto-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
}
}/v1/account/balanceGet 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
}
}/v1/trades/historyGet Trade History
Retrieve paginated trade history with filtering options for date range, token, and trade type.
Query Parameters
| Parameter | Type | Description |
|---|---|---|
limit | integer | Number of results (1-100, default: 50) |
offset | integer | Pagination offset (default: 0) |
token | string | Filter by token address |
type | string | Filter 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
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
| Channel | Description |
|---|---|
launches:pumpfun | New token launches on Pump.fun |
launches:raydium | New pools on Raydium DEX |
prices:all | Real-time price updates for all tokens |
prices:TOKEN_ADDRESS | Price updates for specific token |
trades:account | Your trade execution status updates |
alerts:rug | Anti-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
| Code | Meaning |
|---|---|
200 | Success - Request completed successfully |
400 | Bad Request - Invalid parameters or malformed request |
401 | Unauthorized - Invalid or missing API key |
403 | Forbidden - Insufficient permissions for requested action |
429 | Rate Limited - Too many requests, slow down |
500 | Server 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.
| Plan | REST API | WebSocket |
|---|---|---|
| Velocity Pack | 100 requests/minute | 5 connections |
| Thunder Pack | 500 requests/minute | 25 connections |
| Quantum Pack | 2000 requests/minute | 100 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/sdkFull TypeScript support with type definitions included
Python
pip install solanasniperbot-sdkCompatible with Python 3.8+
Rust
cargo add solanasniperbot-sdkHigh-performance native Rust implementation
Go
go get github.com/solanasniperbot/sdk-goOptimized 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.
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