MinerSwap API
Plug crypto swaps into your app, Discord or Telegram bot, shop or wallet. Same routes and fees as the website, one simple REST API.
curl https://minerautoswap.fr/api/v1/rate?from=LTC&to=SOL&amount=2.5 \
-H "X-API-Key: msk_..."
{
"amountIn": "2.5",
"amountOutEstimate": "1.4358",
"valueEur": "155.28",
"feeBps": 50
}
Getting started
Base URL: https://minerautoswap.fr/api/v1. All requests and responses use JSON.
- Create a free account, then open Account → API and create a key.
- Check the estimated output with
GET /rate. - Create the swap with
POST /swaps. You get a deposit address. - Your user sends the coins to that address. Poll
GET /swaps/{id}until the status isSUCCESS.
Swaps made with your key count toward your account volume, level and stats, exactly like swaps made on the website.
Authentication
Send your key in the X-API-Key header (or Authorization: Bearer msk_…). Keys start with msk_.
X-API-Key: msk_4f1c…
Keep your key secret: call the API from your server, not from a public web page. If a key leaks, revoke it from your account and create a new one. A key is shown only once when you create it.
Rate limits
60 requests per minute per key, and up to 10 new swaps per minute. Above that you get a 429 response; wait a few seconds and retry.
List assets
Every coin and network you can swap right now. Use symbol and network (or the combined id) in other requests.
{
"assets": [
{ "symbol": "BTC", "network": "btc", "id": "BTC-BTC", "name": "Bitcoin", "decimals": 8 },
{ "symbol": "USDT", "network": "tron", "id": "USDT-TRON", "name": "Tether", "decimals": 6 }
]
}
Estimate a rate
| Query | Description |
|---|---|
| fromrequired | Asset you send, e.g. LTC or USDT TRON. |
| torequired | Asset you receive. |
| amountrequired | Amount of the from asset. |
Indicative market estimate after the 0.5% fee. It doesn't reserve anything: the firm amount comes with the swap.
Create a swap
| Field | Description |
|---|---|
| fromrequired | Asset sent: "LTC", "USDT TRON" or {"symbol":"USDT","network":"tron"}. |
| torequired | Asset received, same format. |
| amountrequired | Amount of from, e.g. "2.5". You can also send a euro amount like "150 EUR". |
| recipientrequired | Wallet that receives the to asset. |
| refundTorequired | Wallet on the from network used if the swap can't complete. |
| private | true for a private swap: not listed publicly and not linked to your account. |
| reference | Your own order ID (max 80 chars), returned as-is. |
curl -X POST https://minerautoswap.fr/api/v1/swaps \
-H "X-API-Key: $MINERSWAP_KEY" \
-H "Content-Type: application/json" \
-d '{
"from": "LTC",
"to": "SOL",
"amount": "2.5",
"recipient": "7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU",
"refundTo": "ltc1qg82tg8hzxw0cn2xzt7f2v0sh8ksl5x6y9a9k3d"
}'
Response 201
{
"id": "7f3a9c21-5b2e-4c11-9a2b-0d7e3c4f5a61",
"status": "PENDING_DEPOSIT",
"from": { "symbol": "LTC", "network": "ltc", "id": "LTC-LTC" },
"to": { "symbol": "SOL", "network": "sol", "id": "SOL-SOL" },
"amountIn": "2.5",
"amountOutEstimate": "1.4358",
"feeBps": 50,
"depositAddress": "ltc1q…",
"depositMemo": null,
"expiresAt": "2026-10-07T14:20:00.000Z",
"trackUrl": "https://minerautoswap.fr/status.html?id=7f3a9c21-…"
}
⚠️ If depositMemo is not null, the user must include it with the deposit (XRP, XLM, TON…), otherwise the funds can't be matched. Deposits after expiresAt are refunded to refundTo.
Get a swap
Returns the same object with the latest status, the timeline of each step and the payout txid once sent. Polling every 10–30 seconds is plenty.
List your swaps
Your most recent swaps (up to 100), newest first. Private swaps are not listed, since they aren't linked to your account; keep their id to follow them.
Statuses
PENDING_DEPOSITWaiting for the user's deposit.
KNOWN_DEPOSIT_TXDeposit seen on-chain.
CONFIRMING_DEPOSITWaiting for confirmations.
PROCESSINGThe swap is being executed.
SENDING_TO_CLIENTPayout on its way.
SUCCESSDone.
txid is the payout transaction.INCOMPLETE_DEPOSITLess than the quoted amount was sent.
REFUNDED · FAILED · EXPIRED · CANCELEDFinal, no payout.
Errors
Errors return a non-2xx status with a readable message and a stable code:
{ "error": "Receiving wallet is not a valid SOL address.", "code": "invalid_request" }
| HTTP | Code |
|---|---|
| 400 | invalid_request, invalid_amount, missing_wallet |
| 401 | missing_api_key, invalid_api_key |
| 404 | not_found |
| 429 | rate_limited |
| 503 | price_unavailable |
Full example
Create a swap and wait until it completes (Node.js 18+):
const API = "https://minerautoswap.fr/api/v1";
const headers = { "X-API-Key": process.env.MINERSWAP_KEY, "Content-Type": "application/json" };
const swap = await (await fetch(`${API}/swaps`, {
method: "POST", headers,
body: JSON.stringify({ from: "USDT TRON", to: "BTC", amount: "100", recipient: "bc1q…", refundTo: "T…" })
})).json();
if (swap.error) throw new Error(swap.error);
console.log(`Send ${swap.amountIn} USDT (TRON) to ${swap.depositAddress}`);
const FINAL = ["SUCCESS", "REFUNDED", "FAILED", "EXPIRED", "CANCELED", "INCOMPLETE_DEPOSIT"];
let current = swap;
while (!FINAL.includes(current.status)) {
await new Promise((r) => setTimeout(r, 15000));
current = await (await fetch(`${API}/swaps/${swap.id}`, { headers })).json();
console.log(current.status);
}
console.log("Payout tx:", current.txid);
Questions or higher limits? Contact us or ask on Discord.