Documentation index

REST API Reference

Complete HTTP REST API documentation for AllenHark services.

Base URL

Text
https://api.allenhark.com/v1

Authentication

Include your API key in the Authorization header:

Terminal
Authorization: Bearer your_api_key_here

Endpoints

Account Management

Get Account Info

Text
GET /account

Response:

JSON
{
  "id": "acc_123456",
  "email": "user@example.com",
  "tier": "professional",
  "credits": 1000,
  "rateLimit": {
    "requests": 10000,
    "period": "hour"
  }
}

Get API Usage

Text
GET /account/usage

Query Parameters:

  • start (string): Start date (ISO 8601)
  • end (string): End date (ISO 8601)

Response:

JSON
{
  "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

Text
GET /bots

Response:

JSON
{
  "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

Text
POST /bots

Request Body:

JSON
{
  "type": "pumpfun-sniper",
  "config": {
    "buyAmount": 0.1,
    "slippage": 10,
    "autoSell": {
      "takeProfit": 2.0,
      "stopLoss": 0.5
    }
  }
}

Response:

JSON
{
  "id": "bot_abc123",
  "type": "pumpfun-sniper",
  "status": "created",
  "config": { /* ... */ }
}

Start Bot

Text
POST /bots/{botId}/start

Response:

JSON
{
  "id": "bot_abc123",
  "status": "running",
  "startedAt": "2024-01-15T10:30:00Z"
}

Stop Bot

Text
POST /bots/{botId}/stop

Get Bot Stats

Text
GET /bots/{botId}/stats

Response:

JSON
{
  "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

Text
GET /market/token/{mint}

Response:

JSON
{
  "mint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
  "symbol": "USDC",
  "name": "USD Coin",
  "decimals": 6,
  "supply": 1000000000,
  "price": 1.00,
  "volume24h": 50000000,
  "holders": 125000
}

Get Pool Info

Text
GET /market/pool/{address}

Response:

JSON
{
  "address": "58oQChx4yWmvKdwLLZzBi4ChoCc2fqCUWBkwMihLYQo2",
  "dex": "raydium",
  "tokenA": "SOL",
  "tokenB": "USDC",
  "liquidity": 5000000,
  "volume24h": 1000000,
  "fee": 0.0025
}

Transactions

Send Transaction

Text
POST /transactions/send

Request Body:

JSON
{
  "transaction": "base64_encoded_transaction",
  "options": {
    "skipPreflight": false,
    "maxRetries": 3,
    "priorityFee": "auto"
  }
}

Response:

JSON
{
  "signature": "5VERv8NMvzbJMEkV8xnrLkEaWRtSz9CosKDYjCJjBRnbJLgp8uirBgmQpjKhoR4tjF3ZpRzrFmBV6UjKdiSZkQUW",
  "status": "confirmed",
  "slot": 250123456
}

Error Codes

CodeDescription
400Bad Request - Invalid parameters
401Unauthorized - Invalid API key
403Forbidden - Insufficient permissions
404Not Found - Resource doesn't exist
429Too Many Requests - Rate limit exceeded
500Internal Server Error

Rate Limits

  • Free Tier: 100 requests/minute
  • Professional: 1000 requests/minute
  • Enterprise: Unlimited

SDKs