A Free Paper Trading API
Testing a strategy against live prices usually means opening a broker demo, installing a terminal and learning its API first. biquote's demo trading API skips all of that: one request opens a virtual margin account, the next one places an order, and the account is marked to the same live prices the rest of the API serves. No signup, no API key, no real money.
Open an account and place a trade
# 1. Open an account. The accountKey is shown once: keep it.
curl -X POST https://biquote.io/api/demo/accounts \
-H "Content-Type: application/json" \
-d '{"balance": 10000, "leverage": 100, "stopOutLevel": 50}'
# 2. Buy 0.10 lot of gold with a stop loss and a take profit
curl -X POST https://biquote.io/api/demo/orders \
-H "X-Demo-Key: bqd_your_key" -H "Content-Type: application/json" \
-d '{"symbol": "XAUUSD", "side": "buy", "volume": 0.1, "stopLoss": 3000, "takeProfit": 4500}'
# 3. Balance, equity, margin and margin level
curl https://biquote.io/api/demo/account -H "X-Demo-Key: bqd_your_key"
The order answers with the position it opened and the account after it:
{
"position": {
"id": 37, "symbol": "XAUUSD", "side": "buy", "volume": 0.1,
"openPrice": 3643.343, "stopLoss": 3000, "takeProfit": 4500,
"currentPrice": 3643.204, "profit": -1.39, "margin": 364.33
},
"order": null,
"account": { "balance": 10000, "equity": 9998.61, "margin": 364.33,
"freeMargin": 9634.28, "marginLevel": 2744.35 }
}
The same thing in Python
# pip install biquote
from biquote import Biquote
bq = Biquote()
acct = bq.create_demo_account(balance=10_000, leverage=100, stop_out_level=50)
print(acct.key) # shown once: it is the account
opened = acct.buy("XAUUSD", 0.1, stop_loss=3000, take_profit=4500)
position = opened["position"]
s = acct.summary()
print(s["equity"], s["margin"], s["marginLevel"])
acct.close(position["id"])
for deal in acct.history():
print(deal["reason"], deal["profit"])
No SDK is required: every call is plain JSON over HTTPS with one header, X-Demo-Key.
What an account can do
| Feature | Detail |
|---|---|
| Account settings | Starting balance up to 10,000,000 USD, leverage 1 to 1000, your own stop-out and margin-call levels |
| Orders | Market, limit and stop, each with optional stop loss and take profit |
| Positions | Modify stops, close in full or in part, close all |
| Margin | Equity, margin, free margin and margin level, with stop-out when the level falls below yours |
| History | Every closed trade with its reason: user, stop_loss, take_profit or stop_out |
| Live events | Fills, closes, stop-outs and margin calls pushed over the SignalR hub |
| Instruments | Forex, gold and silver, index CFDs, crypto and stock CFDs |
How orders fill
- A buy opens at the ask and closes at the bid; a sell the reverse.
- Margin is lots × contract size × open price ÷ leverage, converted to USD. Check
GET /api/demo/instruments/{symbol}before sizing a trade: gold is 100 ounces per lot, a currency pair 100,000 units. - Stop loss, take profit and pending orders are checked against the newest price and fill at that price. Through a gap, that is the far side of the gap, not the level you set.
- A symbol with no price for five minutes counts as closed: market orders return
market_closed, pending orders wait.
What people build with it
- Trading bots. Run the full loop (signal, order, stop, exit) against live prices before it touches a real account.
- Forward tests. Let a backtested strategy trade for a few weeks and compare.
- Trading games and courses. Give each student or player an account; the key is all they need.
- AI agents. A sandbox where an agent can place orders with nothing at stake.
Questions
Is the paper trading API free? Do I need an account?
It is free and needs no signup or API key. One POST request opens a demo account and returns a key; that key is the account.
Which instruments can I trade?
Any symbol the API quotes whose profit can be converted to USD: forex pairs, gold and silver, index CFDs, crypto and stock CFDs. GET /api/demo/instruments/{symbol} shows the contract size, volume limits and the margin one lot needs.
How realistic are the fills?
Orders fill at the quoted bid or ask with no slippage, commission or swap. Stops and pending orders are checked against sampled prices and fill at the newest price, so through a gap they fill on the far side. Results will differ from a real account.
Can I run a trading bot on it?
Yes. An account holds up to 200 open positions and 200 pending orders, and requests count against the normal limit of 15,000 per minute per IP. You can open 20 new accounts per IP per day; an account unused for 30 days is deleted.
Is real money involved?
No. It is a simulator, not a broker: funds are virtual, nothing is sent to any market, and nothing can be withdrawn.
Full reference, error codes and the live event contract: Demo trading API documentation.