Point your bot at our paper-trading REST API. Real live crypto prices, leveraged positions up to 1000×, stop-loss/take-profit, partial closes and liquidation simulation — without risking a cent. Your bot's whole strategy, proven before it ever touches real money.
Sign in with just an email (no password, no KYC), then generate your key. Your bot's positions persist on your account.
/api/bot/v1/price?symbol=BTCLive price for any USDT pair. No key needed — try it right now in your browser.
/api/bot/v1/klines?symbol=BTC&interval=60OHLC candles for your strategy (intervals: 1, 5, 15, 30, 60, 240, 1440 minutes). No key needed.
/api/bot/v1/openOpen a simulated position at the live price. Body: {"symbol":"BTC","side":"long","margin_usd":100,"leverage":20,"sl":58000,"tp":66000} (sl/tp optional). Returns the position incl. its liq_price.
/api/bot/v1/closeClose a position at the live price. Body: {"id":"bp...","pct":50} — pct is optional (default 100); partial closes split the position exactly like on the site.
/api/bot/v1/close_allPanic button — closes every open position at the live price in one call.
/api/bot/v1/positionsAll your positions with live mark_price and unrealized_pnl_usd; crossed liquidations and SL/TP are settled automatically.
/api/bot/v1/accountAccount summary: open positions, margin in use, live unrealized P&L, realized P&L, wins/losses and win rate.
Authenticate with the X-API-Key header on every call except /price and /klines.
# price (no key)
curl "https://marginpad.io/api/bot/v1/price?symbol=SOL"
# open a 20x long with $100 margin
curl -X POST "https://marginpad.io/api/bot/v1/open" \
-H "X-API-Key: YOUR_KEY" -H "Content-Type: application/json" \
-d '{"symbol":"SOL","side":"long","margin_usd":100,"leverage":20}'
# check live P&L
curl "https://marginpad.io/api/bot/v1/positions" -H "X-API-Key: YOUR_KEY"
# close half, let the rest run
curl -X POST "https://marginpad.io/api/bot/v1/close" \
-H "X-API-Key: YOUR_KEY" -H "Content-Type: application/json" \
-d '{"id":"POSITION_ID","pct":50}'
# python bot skeleton
import requests, time
API = "https://marginpad.io/api/bot"
H = {"X-API-Key": "YOUR_KEY"}
price = requests.get(f"{API}/v1/price", params={"symbol": "BTC"}).json()["price"]
if my_signal(price): # your strategy here
r = requests.post(f"{API}/v1/open", headers=H, json={
"symbol": "BTC", "side": "long", "margin_usd": 50, "leverage": 10,
"sl": price * 0.97, "tp": price * 1.06,
}).json()
print("opened", r["position"]["id"], "liq @", r["position"]["liq_price"])
# node.js bot skeleton
const API = "https://marginpad.io/api/bot";
const H = { "X-API-Key": "YOUR_KEY", "content-type": "application/json" };
const { price } = await (await fetch(`${API}/v1/price?symbol=ETH`)).json();
if (mySignal(price)) { // your strategy here
const r = await (await fetch(`${API}/v1/open`, { method: "POST", headers: H,
body: JSON.stringify({ symbol: "ETH", side: "short", margin_usd: 50, leverage: 10 }) })).json();
console.log("opened", r.position.id, "liq @", r.position.liq_price);
}
Most crypto trading bots that look profitable in a backtest lose money the first week they go live. Backtests replay clean historical candles — they can't catch a race condition in your order logic, a position-sizing bug that only shows up after a losing streak, or leverage that quietly grows past what your margin survives.
Forward testing (paper trading) runs the same bot, the same code path, against real live prices in real time. Your bot places actual orders — they're just settled in simulated dollars. If the strategy has a flaw, it shows up here, where a bug costs you nothing, instead of on an exchange where it costs you the account.
The usual workflow: backtest the idea on historical data to filter out obvious losers, then point the bot at this API for days or weeks of live forward testing, and only fund a real exchange account once the paper results hold up. Track the results in the Trading Journal and compare against your manual trades in Paper Trade.
| Backtesting | Paper trading (this API) | Live trading | |
|---|---|---|---|
| Prices | Historical candles | Real live prices, real time | Real live prices |
| Risk | None | None — simulated dollars | Real money at stake |
| Catches logic bugs | Rarely — replayed data hides them | Yes — same code path as live | Yes, but each bug costs money |
| Overfitting check | No — you tuned on this data | Yes — unseen future data | Yes |
| Cost | Free | Free | Fees + losses + funding |
| Best for | Filtering ideas fast | Proving the bot before funding it | A strategy already proven twice |
Do all three, in that order. The middle step is the one most people skip — and the one that would have saved them.
Orders fill instantly at the real live price (multi-exchange feed — the same prices as our Paper Trade). No slippage model yet, so treat results as an upper bound.
Isolated margin. Losses are capped at your margin. The liquidation price uses a 0.5% maintenance margin rate; when the live price crosses it the position settles at the liq price automatically. Stop-loss and take-profit orders execute automatically too — when the live price crosses your sl or tp, the position settles at that level (status closed_sl / closed_tp).
120 requests/minute per key · 50 open positions · $1–$100,000 margin per trade · leverage 1–1000×. Need more for a serious project? Message us via the site.
Positions opened via the API live on your account server-side. The Trading Journal and account profile analytics for API positions are on the roadmap.
Yes. It's a paper-trading simulator — positions use real live market prices but no real money. Sign in with an email, generate an API key and start testing immediately.
Any language that can make an HTTPS request — Python, JavaScript/Node.js, Go, Rust, PHP, or plain curl. Standard REST, JSON responses, one X-API-Key header.
Backtesting replays historical candles (fast, but hides bugs and overfitting). Paper trading runs your bot on live prices in real time and catches what backtests can't. Do both — backtest here, then forward-test on this API.
Any USDT pair with a live price on major exchanges — BTC, ETH, SOL and hundreds of altcoins. Check a symbol with GET /api/bot/v1/price?symbol=SOL.
No. No deposit, no wallet, no KYC. You only sign in with an email so your API key and positions persist across sessions.