REST API Reference
Complete HTTP REST API documentation for AllenHark services.
Base URL
https://api.allenhark.com/v1Authentication
Include your API key in the Authorization header:
Authorization: Bearer your_api_key_hereEndpoints
Account Management
Get Account Info
GET /accountResponse:
{
"id": "acc_123456",
"email": "user@example.com",
"tier": "professional",
"credits": 1000,
"rateLimit": {
"requests": 10000,
"period": "hour"
}
}Get API Usage
GET /account/usageQuery Parameters:
start(string): Start date (ISO 8601)end(string): End date (ISO 8601)
Response:
{
"period": {
"start": "2024-01-01T00:00:00Z",
"end": "2024-01-31T23:59:59Z"
},
"usage": {
"rpcRequests": 1500000,
"grpcStreams": 50,
"relayTransactions": 1000
},
"costs": {
"total": 150.00,
"breakdown": {
"rpc": 50.00,
"grpc": 75.00,
"relay": 25.00
}
}
}Trading Bots
List Bots
GET /botsResponse:
{
"bots": [
{
"id": "bot_abc123",
"type": "pumpfun-sniper",
"status": "running",
"created": "2024-01-15T10:30:00Z",
"stats": {
"trades": 150,
"winRate": 0.68,
"profit": 12.5
}
}
]
}Create Bot
POST /botsRequest Body:
{
"type": "pumpfun-sniper",
"config": {
"buyAmount": 0.1,
"slippage": 10,
"autoSell": {
"takeProfit": 2.0,
"stopLoss": 0.5
}
}
}Response:
{
"id": "bot_abc123",
"type": "pumpfun-sniper",
"status": "created",
"config": { /* ... */ }
}Start Bot
POST /bots/{botId}/startResponse:
{
"id": "bot_abc123",
"status": "running",
"startedAt": "2024-01-15T10:30:00Z"
}Stop Bot
POST /bots/{botId}/stopGet Bot Stats
GET /bots/{botId}/statsResponse:
{
"id": "bot_abc123",
"stats": {
"totalTrades": 150,
"winningTrades": 102,
"losingTrades": 48,
"winRate": 0.68,
"totalProfit": 12.5,
"avgProfit": 0.083,
"maxDrawdown": -2.3,
"sharpeRatio": 1.85
}
}Market Data
Get Token Info
GET /market/token/{mint}Response:
{
"mint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"symbol": "USDC",
"name": "USD Coin",
"decimals": 6,
"supply": 1000000000,
"price": 1.00,
"volume24h": 50000000,
"holders": 125000
}Get Pool Info
GET /market/pool/{address}Response:
{
"address": "58oQChx4yWmvKdwLLZzBi4ChoCc2fqCUWBkwMihLYQo2",
"dex": "raydium",
"tokenA": "SOL",
"tokenB": "USDC",
"liquidity": 5000000,
"volume24h": 1000000,
"fee": 0.0025
}Transactions
Send Transaction
POST /transactions/sendRequest Body:
{
"transaction": "base64_encoded_transaction",
"options": {
"skipPreflight": false,
"maxRetries": 3,
"priorityFee": "auto"
}
}Response:
{
"signature": "5VERv8NMvzbJMEkV8xnrLkEaWRtSz9CosKDYjCJjBRnbJLgp8uirBgmQpjKhoR4tjF3ZpRzrFmBV6UjKdiSZkQUW",
"status": "confirmed",
"slot": 250123456
}Error Codes
| Code | Description |
|---|---|
| 400 | Bad Request - Invalid parameters |
| 401 | Unauthorized - Invalid API key |
| 403 | Forbidden - Insufficient permissions |
| 404 | Not Found - Resource doesn't exist |
| 429 | Too Many Requests - Rate limit exceeded |
| 500 | Internal Server Error |
Rate Limits
- Free Tier: 100 requests/minute
- Professional: 1000 requests/minute
- Enterprise: Unlimited
