REST API Reference
Complete HTTP REST API documentation for AllenHark services.
Base URL
https://api.allenhark.com/v1
Authentication
Include your API key in the Authorization header:
1Authorization: Bearer your_api_key_hereEndpoints
Account Management
Get Account Info
1GET /accountResponse:
1{
2 "id": "acc_123456",
3 "email": "user@example.com",
4 "tier": "professional",
5 "credits": 1000,
6 "rateLimit": {
7 "requests": 10000,
8 "period": "hour"
9 }
10}Get API Usage
1GET /account/usageQuery Parameters:
start(string): Start date (ISO 8601)end(string): End date (ISO 8601)
Response:
1{
2 "period": {
3 "start": "2024-01-01T00:00:00Z",
4 "end": "2024-01-31T23:59:59Z"
5 },
6 "usage": {
7 "rpcRequests": 1500000,
8 "grpcStreams": 50,
9 "relayTransactions": 1000
10 },
11 "costs": {
12 "total": 150.00,
13 "breakdown": {
14 "rpc": 50.00,
15 "grpc": 75.00,
16 "relay": 25.00
17 }
18 }
19}Trading Bots
List Bots
1GET /botsResponse:
1{
2 "bots": [
3 {
4 "id": "bot_abc123",
5 "type": "pumpfun-sniper",
6 "status": "running",
7 "created": "2024-01-15T10:30:00Z",
8 "stats": {
9 "trades": 150,
10 "winRate": 0.68,
11 "profit": 12.5
12 }
13 }
14 ]
15}Create Bot
1POST /botsRequest Body:
1{
2 "type": "pumpfun-sniper",
3 "config": {
4 "buyAmount": 0.1,
5 "slippage": 10,
6 "autoSell": {
7 "takeProfit": 2.0,
8 "stopLoss": 0.5
9 }
10 }
11}Response:
1{
2 "id": "bot_abc123",
3 "type": "pumpfun-sniper",
4 "status": "created",
5 "config": { /* ... */ }
6}Start Bot
1POST /bots/{botId}/startResponse:
1{
2 "id": "bot_abc123",
3 "status": "running",
4 "startedAt": "2024-01-15T10:30:00Z"
5}Stop Bot
1POST /bots/{botId}/stopGet Bot Stats
1GET /bots/{botId}/statsResponse:
1{
2 "id": "bot_abc123",
3 "stats": {
4 "totalTrades": 150,
5 "winningTrades": 102,
6 "losingTrades": 48,
7 "winRate": 0.68,
8 "totalProfit": 12.5,
9 "avgProfit": 0.083,
10 "maxDrawdown": -2.3,
11 "sharpeRatio": 1.85
12 }
13}Market Data
Get Token Info
1GET /market/token/{mint}Response:
1{
2 "mint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
3 "symbol": "USDC",
4 "name": "USD Coin",
5 "decimals": 6,
6 "supply": 1000000000,
7 "price": 1.00,
8 "volume24h": 50000000,
9 "holders": 125000
10}Get Pool Info
1GET /market/pool/{address}Response:
1{
2 "address": "58oQChx4yWmvKdwLLZzBi4ChoCc2fqCUWBkwMihLYQo2",
3 "dex": "raydium",
4 "tokenA": "SOL",
5 "tokenB": "USDC",
6 "liquidity": 5000000,
7 "volume24h": 1000000,
8 "fee": 0.0025
9}Transactions
Send Transaction
1POST /transactions/sendRequest Body:
1{
2 "transaction": "base64_encoded_transaction",
3 "options": {
4 "skipPreflight": false,
5 "maxRetries": 3,
6 "priorityFee": "auto"
7 }
8}Response:
1{
2 "signature": "5VERv8NMvzbJMEkV8xnrLkEaWRtSz9CosKDYjCJjBRnbJLgp8uirBgmQpjKhoR4tjF3ZpRzrFmBV6UjKdiSZkQUW",
3 "status": "confirmed",
4 "slot": 250123456
5}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