Blog / 2026-10-05
A free Solana swap API for bots: quote, build, sign, execute
Most swap APIs either hold your keys or ask for a subscription. This one does neither: you ask for a quote, get an unsigned transaction for your own address, sign it in your own code and send it back for execution. Calling the API is free, and Ambolt never holds keys or funds.
The three calls
curl "https://api.ambolt.dev/api/swap/quote?inputMint=So11111111111111111111111111111111111111112&outputMint=EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v&amount=10000000"
- Quote returns the expected output, the minimum after slippage, price impact, route and the fee, which is already included.
- Build (
POST /api/swap/buildwithtakerset to your address) returns an unsigned base64 transaction and arequestId. - Execute (
POST /api/swap/executewith the signed transaction and therequestId) returns the result and the signature.
Signing with your own key
import { Keypair, VersionedTransaction } from "@solana/web3.js";
import bs58 from "bs58";
const keypair = Keypair.fromSecretKey(bs58.decode(process.env.SOLANA_SECRET_KEY));
const built = await post("build", { inputMint, outputMint, amount: "10000000", slippageBps: 50, taker: keypair.publicKey.toBase58() });
const tx = VersionedTransaction.deserialize(Buffer.from(built.transaction, "base64"));
tx.sign([keypair]);
const result = await post("execute", { signedTransaction: Buffer.from(tx.serialize()).toString("base64"), requestId: built.requestId });
The SDKs wrap the three calls (ambolt.swap.quote, build, execute), and the guide has the same flow in Python and for browser wallets.
Before you sign
- The build response has
checks:takerInTransactionandunsignedmust both be true. - The fee payer must be your own address. Never sign a transaction whose fee payer is someone else.
- Quotes are indicative and move with every block.
Limits
The API is rate limited per IP address (a 429 carries Retry-After). It is not investment advice and not a recommendation to trade any token; prices move, tokens can lose value and swaps can fail.
More from the blog
- Check SSL certificates and domain expiry for a whole list of domains
- EU and UK public tenders in one schema, with OCDS export
- How an agent pays per call with x402
- PDF and DOCX to Markdown and tables, without an LLM
- All tools and prices
- Guides
Data and prices change; every API response states its source and date. Informational only, not financial, legal or tax advice.