API
BetaThe HTTP endpoints behind Rings Swap. They return JSON. None of them signs or holds funds.
Overview
Base URL: the site you are on (for example https://your-domain/api). No API key. Amounts are integers in the token's smallest unit (lamports for SOL). Mints are base58 addresses.
GET /api/priceLive
USD price and 24 h change for up to 50 tokens.
| Query | Type | Description |
|---|---|---|
ids | string | Comma-separated mint addresses (max 50) |
curl "/api/price?ids=So11111111111111111111111111111111111111112,EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
{
"So11111111111111111111111111111111111111112": { "usdPrice": 71.39, "change24h": 2.29 },
"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v": { "usdPrice": 0.9996, "change24h": -0.02 }
}GET /api/quoteLive
A market quote for selling an exact amount. Read only: no transaction is built.
| Query | Type | Description |
|---|---|---|
in | string | Mint you sell |
out | string | Mint you buy |
amount | integer string | Amount you sell, in the smallest unit |
slippageBps | integer | Max slippage in basis points (1 to 5000, default 50) |
curl "/api/quote?in=EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v&out=So11111111111111111111111111111111111111112&amount=250000000&slippageBps=50"
{
"inAmount": "250000000",
"outAmount": "3497900000",
"minOut": "3480410000",
"priceImpactPct": 0.001,
"hops": 1
}GET /api/tokensLive
Token search and metadata. Use one of the three forms.
| Query | Description |
|---|---|
q=bonk | Search by name, symbol or mint |
mints=a,b | Metadata for these mints |
list=trending | Trending tokens over 24 h |
[{
"mint": "DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263",
"symbol": "Bonk", "name": "Bonk", "decimals": 5, "icon": "https://…", "verified": true,
"usdPrice": 0.00000208, "change24h": 2.72, "mcap": 1840000000, "volume24h": 21000000
}]GET /api/balancesLive
The public mainnet balances of a wallet: SOL plus every token account (both token programs) with a non-zero balance.
| Query | Type | Description |
|---|---|---|
owner | string | Wallet address |
{
"sol": 12480000000,
"tokens": [{ "mint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v", "amount": "250000000", "decimals": 6 }]
}POST /api/swap/buildLive
Builds an unsigned normal swap for a wallet to sign: a fresh quote, a compute limit from the route's simulation, a priority fee from current demand and a fast-landing tip. The server never signs. Limited to 20 requests per minute per IP.
| Field | Type | Description |
|---|---|---|
in | string | Mint you sell |
out | string | Mint you buy |
amount | integer string | Amount you sell, in the smallest unit |
slippageBps | integer | Max slippage in basis points |
user | string | The wallet that signs and pays |
{
"tx": "<base64 v0 transaction, unsigned>",
"lastValidBlockHeight": 312345678,
"quote": { "inAmount": "250000000", "outAmount": "3497900000", "minOut": "3480410000", "priceImpactPct": 0.001, "route": ["…"] },
"fees": { "baseLamports": 5000, "priorityLamports": 18000, "tipLamports": 200000, "platformBps": 0 }
}Sign tx with the wallet, then post the signed transaction to /api/swap/send and poll the status endpoint.
POST /api/swap/sendLive
Relays a transaction the wallet has already signed to Helius Sender, which routes it to validators and Jito at once. It cannot change the transaction (that would break the signature). Re-send the same bytes every 2 s until it is confirmed or its blockhash expires.
{ "tx": "<base64 signed transaction>" }{ "signature": "5VERv8…" }GET /api/swap/statusLive
| Query | Description |
|---|---|
sig | Transaction signature |
lastValidBlockHeight | From the build response, to detect expiry |
{ "status": "pending" | "confirmed" | "finalized" | "failed" | "expired" }WaitlistLive
The private swap waitlist. Stores the wallet address and when it joined, nothing else.
| Request | Response |
|---|---|
GET /api/waitlist | { "count": 1234 } |
GET /api/waitlist?address=… | { "count": 1234, "position": 87 | null } |
POST /api/waitlist { "address": "…" } | { "count": 1235, "position": 1235, "isNew": true } |
Private swap APIAfter the audit
These endpoints are planned and do not exist yet. They are listed so integrators can see the intended shape; it may change before launch.
| Endpoint | Purpose |
|---|---|
POST /api/private/deposit | Build a deposit from a public to a private balance (you sign it) |
POST /api/private/swap | Build a private swap (you sign it) |
POST /api/private/withdraw | Build a withdrawal back to your public balance |
GET /api/private/status?sig= | Status of a private transaction by signature |
What will not exist
No endpoint will ever take a private key, a seed phrase or custody of funds. Transactions are built on the server and signed by your wallet.
Errors
| Status | Meaning |
|---|---|
| 400 | A parameter is missing or invalid (bad mint, amount or owner) |
| 422 | The swap would fail if sent (for example, a balance is too low) |
| 429 | Too many requests; wait a moment |
| 502 | The upstream market data or RPC did not answer; retry |
{ "error": "bad request" }