πŸ”‘API

The RayBot API provides programmatic access to wallet management . This documentation covers all public-facing endpoints, authentication, rate limits, and usage examples.

Base URL: https://webapi.raybot.app


πŸ” Authentication

API Key Authentication

You can get your API key directly from RayBot Telegram Bot by sending /api command.

All requests to /publicapi endpoints require:

  • api_user: Your API user id

  • token: Your API key

These can be provided as query parameters:

GET /publicapi/wallets?api_user=your_user_id&token=your_api_key

Rate Limits

  • Public API endpoints (/publicapi): 5 requests per 10 seconds


πŸ€– Bot numbers

With each request, you need to specify a Telegram bot number. Use the table below to find the correct bot:

Bots
0: @solana_notify_bot
1: @ray_purple_bot
2: @ray_red_bot
3: @ray_blue_bot
4: @ray_gold_bot
5: @ray_silver_bot
6: @ray_black_bot
7: @ray_ruby_bot
8: @ray_sapphire_bot
9: @ray_pearl_bot
10: @ray_green_bot
11: @ray_yellow_bot
12: @ray_opal_bot
13: @ray_diamond_bot
14: @ray_emerald_bot
15: @ray_topaz_bot
16: @ray_cyan_bot
17: @ray_orange_bot
18: @ray_adamite_bot
19: @ray_amber_bot
20: @ray_onyx_bot
21: @ray_quartz_bot
22: @ray_obsidian_bot
23: @ray_nephrite_bot
24: @ray_moonstone_bot
25: @ray_agate_bot
26: @ray_azure_bot
27: @ray_magenta_bot
28: @ray_lime_bot
29: @ray_olive_bot
30: @ray_aqua_bot
31: @ray_bronze_bot
32: @ray_violet_bot
33: @ray_khaki_bot

πŸ“‹ Endpoints

1. Add Wallets

Endpoint: POST /publicapi/wallets/add

Add multiple wallets to a user's bot configuration.

Parameters:

  • Query Parameters:

    • api_user (string, required): Your API user ID

    • token (string, required): API authentication token

  • Request Body:

{
  "user_id": "string",
  "bot": 1,
  "wallets": [
    {
      "wallet_address": "string",
      "wallet_name": "string (optional)"
    },
    {
      "wallet_address": "string",
      "wallet_name": "string (optional)"
    },
    ...
  ]
}

Validation Rules:

  • Maximum 10 wallets per request

  • wallet_address must be alphanumeric

  • bot must be integer between 0-32

  • wallets array must contain 1-10 items

Response:

{
  "status": "ok" | "error",
  "wallets": [
    {
      "address": "string",
      "type": "solana" | "evm",
      "status": "active" | "limit" | "user_pause",
      "wallet_name": "string",
      "bot": 1
    }
  ]
}

Status Codes:

  • 201: Wallets added successfully

  • 400: Invalid request data

  • 401: Invalid authentication

  • 403: User not authorized

  • 429: Rate limit exceeded


2. Delete Wallets

Endpoint: POST /publicapi/wallets/delete

Parameters:

  • Query Parameters:

    • api_user (string, required): Your API user ID

    • token (string, required): API authentication token

  • Request Body:

{
  "wallets": ["wallet_address_1", "wallet_address_2"],
  "user_id": "string",
  "bot": 1
}

Validation Rules:

  • wallets must be a non-empty array

  • Each wallet address must be valid Solana, EVM, or TRON address

  • bot must be integer between 0-32

Response:

{
  "status": "ok",
  "deletedCount": 2
}

Status Codes:

  • 200: Wallets deleted successfully

  • 400: Invalid wallet addresses

  • 401: Invalid authentication

  • 404: No wallets found

  • 429: Rate limit exceeded


3. Get Wallets

Endpoint: GET /publicapi/wallets

Retrieve all wallets for the authenticated user.

Parameters:

  • Query Parameters:

    • api_user (string, required): Your API user ID

    • token (string, required): API authentication token

Response:

{
  "status": "ok",
  "wallets": [
    {
      "address": "string",
      "type": "solana" | "evm",
      "status": "active" | "user_pause" | "limit",
      "wallet_name": "string",
      "bot": 1
    }
  ]
}

Status Codes:

  • 200: Success

  • 401: Invalid authentication

  • 429: Rate limit exceeded


πŸ”§ SDKs and Examples

JavaScript/Node.js Example

const axios = require('axios');

const apiClient = axios.create({
  baseURL: 'https://webapi.raybot.app',
  timeout: 30000,
});

// Add wallets
async function addWallets(userId, token, wallets, bot = 1) {
  try {
    const response = await apiClient.post(
      `/publicapi/wallets/add?api_user=${userId}&token=${token}`,
      {
        user_id: userId,
        bot: bot,
        wallets: wallets
      }
    );
    return response.data;
  } catch (error) {
    console.error('Error adding wallets:', error.response?.data || error.message);
    throw error;
  }
}

// Usage examples
const wallets = [
  { wallet_address: 'ABC123...', wallet_name: 'My Wallet 1' },
  { wallet_address: 'DEF456...', wallet_name: 'My Wallet 2' }
];

addWallets('api_user_id', 'your_api_token', wallets)
  .then(result => console.log('Wallets added:', result))
  .catch(error => console.error('Failed to add wallets:', error));

Python Example

import requests
import json

class RayBotAPI:
    def __init__(self, base_url, user_id, token):
        self.base_url = base_url
        self.user_id = user_id
        self.token = token
        
    def add_wallets(self, wallets, bot=1):
        url = f"{self.base_url}/publicapi/wallets/add"
        params = {"api_user": self.user_id, "token": self.token}
        data = {
            "user_id": self.user_id,
            "bot": bot,
            "wallets": wallets
        }
        
        response = requests.post(url, params=params, json=data)
        response.raise_for_status()
        return response.json()

# Usage
api = RayBotAPI("https://webapi.raybot.app", "api_user_id", "your_token")

wallets = [
    {"wallet_address": "ABC123...", "wallet_name": "My Wallet 1"}
]

try:
    result = api.add_wallets(wallets)
    print(f"Added {len(result['wallets'])} wallets")
except requests.exceptions.HTTPError as e:
    print(f"Error: {e.response.json()}")

Last updated