Authentication
All API requests require authentication using a Bearer token. Get your API key from your dashboard.
Getting Your API Key
- Log into your Solana Sniper Bot account
- Navigate to Settings > API Access
- Click "Generate New API Key"
- Copy and securely store your key
Verify your API key and get account information.
curl -X POST https://api.solanasniper.bot/v2/auth/verify \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json"
{
"success": true,
"data": {
"user_id": "usr_abc123",
"plan": "pro",
"rate_limit": 300,
"expires_at": "2025-12-31T23:59:59Z",
"permissions": ["read", "write", "trade"]
}
}
Keep Your API Key Secure
Never expose your API key in client-side code or public repositories. Rotate keys immediately if compromised.
Wallet
Manage wallet connections and check balances.
Get the SOL and token balances of your connected wallet.
{
"success": true,
"data": {
"address": "YourWa11etAddressHere...",
"sol_balance": 5.234,
"tokens": [
{
"mint": "TokenMintAddress...",
"symbol": "BONK",
"balance": 1000000,
"usd_value": 45.67
}
],
"total_usd_value": 892.45
}
}
Connect a new wallet using private key (encrypted).
Parameters
private_key
string
Yes
Base58 encoded private key
label
string
No
Custom label for the wallet
Remove wallet connection from your account.
Trading
Execute trades and manage your sniping operations.
Execute a buy order for a specific token.
Parameters
token_address
string
Yes
Token mint address
amount_sol
number
Yes
Amount of SOL to spend
slippage
number
No
Slippage tolerance % (default: 25)
priority
string
No
low, medium, high, turbo
curl -X POST https://api.solanasniper.bot/v2/trade/buy \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"token_address": "TokenMintAddress...",
"amount_sol": 0.5,
"slippage": 25,
"priority": "high"
}'
{
"success": true,
"data": {
"transaction_id": "tx_xyz789",
"signature": "5xYz...",
"status": "confirmed",
"tokens_received": 1250000,
"price_per_token": 0.0000004,
"total_sol_spent": 0.5,
"fees": 0.000025
}
}
Sell tokens from your wallet.
Parameters
token_address
string
Yes
Token mint address
percentage
number
Yes
Percentage of holdings to sell (1-100)
min_sol
number
No
Minimum SOL to receive
Start automated sniping with specified parameters.
{
"platforms": ["pumpfun", "raydium"],
"buy_amount": 0.3,
"slippage": 30,
"anti_rug": "high",
"auto_sell": {
"take_profit": 100,
"stop_loss": 50,
"trailing": 20
},
"filters": {
"min_liquidity": 5,
"max_supply": 1000000000,
"lp_burned": true
}
}
Stop automated sniping.
Tokens
Get information about tokens and analyze potential risks.
Get detailed information about a specific token.
{
"success": true,
"data": {
"address": "TokenMintAddress...",
"name": "Example Token",
"symbol": "EXM",
"decimals": 9,
"supply": 1000000000,
"price_usd": 0.0001234,
"market_cap": 123400,
"liquidity": 45.6,
"holders": 1250,
"volume_24h": 89000,
"price_change_24h": 15.4,
"created_at": "2025-01-15T10:30:00Z"
}
}
Analyze token security and rug pull risks.
{
"success": true,
"data": {
"risk_score": 25,
"risk_level": "low",
"checks": {
"honeypot": false,
"mint_authority": "renounced",
"freeze_authority": "renounced",
"lp_burned": true,
"top_holder_percentage": 8.5,
"buy_tax": 0,
"sell_tax": 0
},
"warnings": [],
"recommendation": "safe_to_trade"
}
}
Get list of newly launched tokens.
Query Parameters
platform
string
No
Filter by platform
limit
number
No
Number of results (max 100)
min_liquidity
number
No
Minimum liquidity in SOL
Positions
Track and manage your open trading positions.
Get all open positions with current P&L.
{
"success": true,
"data": {
"positions": [
{
"id": "pos_abc123",
"token_address": "TokenMintAddress...",
"symbol": "BONK",
"tokens_held": 1000000,
"entry_price": 0.0000001,
"current_price": 0.00000015,
"entry_sol": 0.1,
"current_value_sol": 0.15,
"pnl_percentage": 50,
"pnl_sol": 0.05,
"opened_at": "2025-01-15T10:30:00Z"
}
],
"total_invested": 2.5,
"total_current_value": 3.2,
"total_pnl": 0.7,
"total_pnl_percentage": 28
}
}
Get historical closed positions.
Query Parameters
from
string
No
Start date (ISO 8601)
to
string
No
End date (ISO 8601)
limit
number
No
Number of results
WebSocket
Real-time data streams for token launches and trade updates.
Connection
wss://ws.solanasniper.bot/v2?token=YOUR_API_KEY
Subscribe to Events
{
"action": "subscribe",
"channels": [
"new_tokens",
"my_trades",
"price_alerts"
]
}
Event Types
new_token
Fired when a new token is detected on monitored platforms
{
"type": "new_token",
"data": {
"address": "...",
"platform": "pumpfun",
"name": "Token Name",
"liquidity": 5.2
}
}
trade_executed
Fired when your trade is executed
{
"type": "trade_executed",
"data": {
"id": "tx_123",
"action": "buy",
"token": "...",
"amount": 0.5,
"status": "confirmed"
}
}
price_alert
Fired when a token hits your price target
{
"type": "price_alert",
"data": {
"token": "...",
"trigger": "take_profit",
"current_pnl": 105
}
}
Error Codes
Standard error responses and their meanings.
Error Response Format
{
"success": false,
"error": {
"code": "INSUFFICIENT_BALANCE",
"message": "Not enough SOL in wallet for this transaction",
"details": {
"required": 0.5,
"available": 0.32
}
}
}
Code Examples
Quick start examples in popular programming languages.
JavaScript / Node.js
const API_KEY = 'your_api_key';
const BASE_URL = 'https://api.solanasniper.bot/v2';
async function buyToken(tokenAddress, amount) {
const response = await fetch(`${BASE_URL}/trade/buy`, {
method: 'POST',
headers: {
'Authorization': `Bearer ${API_KEY}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
token_address: tokenAddress,
amount_sol: amount,
slippage: 25,
priority: 'high'
})
});
return response.json();
}
// Example usage
buyToken('TokenMintAddress...', 0.5)
.then(result => console.log(result))
.catch(error => console.error(error));
Python
import requests
API_KEY = 'your_api_key'
BASE_URL = 'https://api.solanasniper.bot/v2'
def buy_token(token_address: str, amount: float):
response = requests.post(
f'{BASE_URL}/trade/buy',
headers={
'Authorization': f'Bearer {API_KEY}',
'Content-Type': 'application/json'
},
json={
'token_address': token_address,
'amount_sol': amount,
'slippage': 25,
'priority': 'high'
}
)
return response.json()
# Example usage
result = buy_token('TokenMintAddress...', 0.5)
print(result)
WebSocket Example
const WebSocket = require('ws');
const ws = new WebSocket('wss://ws.solanasniper.bot/v2?token=YOUR_API_KEY');
ws.on('open', () => {
console.log('Connected to WebSocket');
// Subscribe to new tokens
ws.send(JSON.stringify({
action: 'subscribe',
channels: ['new_tokens']
}));
});
ws.on('message', (data) => {
const event = JSON.parse(data);
if (event.type === 'new_token') {
console.log('New token detected:', event.data);
// Execute your trading logic here
}
});
ws.on('error', (error) => {
console.error('WebSocket error:', error);
});