Skip to main content

Prerequisites

Before you begin, ensure you have:
  • Node.js 18+ or Python 3.8+
  • A code editor (VS Code recommended)
  • For Premium API: An API key from raze.bot

Installation

npm install axios dotenv @solana/web3.js bs58

Configuration

For Premium API

Store your API key securely in environment variables:
# .env file
RAZE_API_KEY=your_api_key_here
Never commit your API key to version control. Add .env to your .gitignore file.

Quick Examples

Router V3 (Public API) - No API Key Required

import axios from 'axios';

// Buy tokens - no API key needed
const response = await axios.post('https://router.raze.bot/swap/sol/buy', {
  walletAddresses: ['YOUR_WALLET_ADDRESS'],
  tokenAddress: 'TOKEN_MINT_ADDRESS',
  solAmount: 0.1
});

console.log(response.data.transactions);

Quote - API Key Required

import axios from 'axios';

// Get quote - API key required
const mint = 'TOKEN_MINT_ADDRESS';
const response = await axios.get(
  `https://router.raze.bot/swap/sol/quote/${mint}`, {
    headers: { 'Authorization': `Bearer ${process.env.RAZE_API_KEY}` }
  }
);

console.log(response.data.data.avgPrice);

Endpoints

Each API has a single global hostname; GeoDNS routes you to the nearest region automatically:
APIBase URL
Tradinghttps://router.raze.bot
Historyhttps://api.raze.bot
Solana RPChttps://rpc.raze.bot
Streaming (WS)wss://ws.raze.bot
gRPCgrpc.raze.bot:443

Next Steps

Development Basics

Learn API fundamentals

API Reference

Explore all endpoints