Skip to content
Launch App >

Helper endpoints for swap quotes, health checks, and version info.

Get a Jupiter swap quote preview.

POST /jupiter
Content-Type: application/json
{
"inputMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"outputMint": "So11111111111111111111111111111111111111112",
"amount": 100000000,
"slippageBps": 50,
"dexes": []
}
FieldTypeDescription
inputMintstringInput token mint
outputMintstringOutput token mint
amountnumberAmount in base units
slippageBpsnumberSlippage in basis points
dexesstring[]DEXes to use (empty = all)

Returns Jupiter quote data:

{
"inputMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"outputMint": "So11111111111111111111111111111111111111112",
"inAmount": "100000000",
"outAmount": "450000000",
"priceImpactPct": 0.01,
"routePlan": [...]
}
interface JupiterQuote {
inputMint: string;
outputMint: string;
inAmount: string;
outAmount: string;
priceImpactPct: number;
}
async function getQuote(
inputMint: string,
outputMint: string,
amount: number,
slippageBps: number = 50
): Promise<JupiterQuote> {
const response = await fetch('https://worker.turbine.cash/jupiter', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
inputMint,
outputMint,
amount,
slippageBps,
dexes: [],
}),
});
return response.json();
}
// Preview a 100 USDC -> SOL swap
const quote = await getQuote(
'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v',
'So11111111111111111111111111111111111111112',
100_000_000,
50
);
console.log(`You'll receive approximately ${quote.outAmount} lamports`);
console.log(`Price impact: ${quote.priceImpactPct}%`);
SlippagebpsUse Case
0.1%10Stablecoin pairs
0.5%50Standard trades
1.0%100Volatile pairs
3.0%300Low liquidity

Check API server health.

GET /health

Healthy:

200 OK
"ok"

Unhealthy:

503 Service Unavailable
async function checkHealth(): Promise<boolean> {
try {
const response = await fetch('https://worker.turbine.cash/health');
return response.ok;
} catch {
return false;
}
}

Get current API version.

GET /version
200 OK
"0.1.0"
async function getVersion(): Promise<string> {
const response = await fetch('https://worker.turbine.cash/version');
return response.text();
}

For production applications, implement health checks:

class TurbineHealthMonitor {
private healthy = true;
private lastCheck = 0;
async check(): Promise<boolean> {
const now = Date.now();
if (now - this.lastCheck < 60000) {
return this.healthy;
}
try {
const response = await fetch('https://worker.turbine.cash/health', {
signal: AbortSignal.timeout(5000),
});
this.healthy = response.ok;
} catch {
this.healthy = false;
}
this.lastCheck = now;
return this.healthy;
}
isHealthy(): boolean {
return this.healthy;
}
}