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 my.raze.bot
Installation
npm install axios dotenv @solana/web3.js bs58
pip install requests python-dotenv solana base58
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 V2 (Public API) - No API Key Required
import axios from 'axios';
// Buy tokens - no API key needed
const response = await axios.post('https://de.raze.sh/v2/sol/buy', {
walletAddresses: ['YOUR_WALLET_ADDRESS'],
tokenAddress: 'TOKEN_MINT_ADDRESS',
solAmount: 0.1
});
console.log(response.data.transactions);
import requests
# Buy tokens - no API key needed
response = requests.post('https://de.raze.sh/v2/sol/buy', json={
'walletAddresses': ['YOUR_WALLET_ADDRESS'],
'tokenAddress': 'TOKEN_MINT_ADDRESS',
'solAmount': 0.1
})
print(response.json()['transactions'])
Premium API - API Key Required
import axios from 'axios';
import dotenv from 'dotenv';
dotenv.config();
// Get quote with API key
const mint = 'TOKEN_MINT_ADDRESS';
const response = await axios.get(
`https://de.raze.sh/sol/quote/${mint}?apiKey=${process.env.RAZE_API_KEY}`
);
console.log(response.data.quote);
import requests
import os
from dotenv import load_dotenv
load_dotenv()
# Get quote with API key
mint = 'TOKEN_MINT_ADDRESS'
response = requests.get(
f'https://de.raze.sh/sol/quote/{mint}',
params={'apiKey': os.getenv('RAZE_API_KEY')}
)
print(response.json()['quote'])
Server Regions
Choose the server closest to you for best performance:
| Region | Base URL |
|---|
| Germany | https://de.raze.sh |
| United States | https://us.raze.sh |
| Tokyo | https://tokyo.raze.sh |
Next Steps