Short answer: A paper trading API is an official test environment that takes API orders with virtual funds, such as Binance's Spot Testnet and Demo Mode, Bybit's testnet and demo, OKX's demo header or Alpaca's paper host. As read on 5 November 2026, these can prove signing, error handling, rate-limit handling and order state logic, but none can prove liquidity, queue position or latency in the live market. Paper results show how software behaves, never future results.
What a passing test proves differs sharply by environment: one sandbox ignores your order entirely, and one documented demo host now redirects to a marketing page.
Each environment was read on its official page on 5 November 2026, and public endpoints were called that day without keys. Signed flows need a real test key and were not run. This page ranks nothing and recommends no venue. Rules depend on your jurisdiction and each platform's terms. Article 99/A of Capital Markets Law No. 6362 treats activity by foreign crypto-asset platforms directed at Turkish residents as unauthorized. Automated trading can lose money.
Paper trading API environments compared
Eight official environments at six venues differ in host, key, market data and retention.
| Environment | Host | API key | Market data and limits stated |
|---|---|---|---|
| Alpaca paper | paper-api.alpaca.markets | Separate paper key; email-only signup | Fills simulated from quotes; Paper Only accounts get IEX data only; stated to be free; also simulates crypto |
| Binance Demo Mode | demo-api.binance.com | Binance account, then the Demo Trading key page | Prices and books similar to live, which Binance says is not real data; filters and limits as live; balance resets on demand |
| Binance Spot Testnet | testnet.binance.vision | GitHub login on the testnet site | Prices and books independent of live; reset to blank about monthly with no notice, orders included; sometimes gets features before live |
| Bybit demo | api-demo.bybit.com | Created from demo mode | Public data identical to mainnet; not every API available; no WebSocket order entry; orders kept 7 days |
| Bybit testnet | api-testnet.bybit.com | From the testnet site | Separate market; no reset rule on the pages read |
| Coinbase Advanced Trade sandbox | api-sandbox.coinbase.com | None; no authentication | All responses static; a note limits it to Accounts and Orders, yet its tables also list Portfolios and Perpetuals |
| Kraken Spot UAT | Separate URL, on request | Isolated keys, through an account manager | Said to mirror production; not self-service |
| OKX demo | openapi.okx.com with header x-simulated-trading: 1; wss://wspap.okx.com | Created under Demo Trading | Withdrawals, deposits, purchase and redemption not supported |
Kraken's derivatives demo is left out because its documents conflict: the Exchange overview and quickstart call demo-futures.kraken.com self-service, while a support article updated 29 October 2026 says it was decommissioned on Monday, 14 July, year not given, and offers testing to qualified clients. On 5 November 2026 a REST call there returned HTTP 301 to a marketing page. Setup details are in the guides to the Binance testnet, Bybit, OKX and Kraken Futures.
What a paper trading API can prove, and what it cannot
A test environment proves that your code talks to the API correctly and survives its answers; nothing in it proves how an order would fill live.
| Environment | Can show | Cannot show |
|---|---|---|
| Alpaca paper | Order lifecycle; partial fills, given randomly 10% of the time | Liquidity: size is not checked against quoted quantity. Alpaca also lists market impact, latency slippage, queue position, price improvement, regulatory fees and dividends as not modeled |
| Binance Demo Mode, Bybit demo | Signing, rate limits and order state against live-like data; Bybit only on its listed endpoints | Your own market impact, real trade flow; WebSocket order entry on Bybit |
| Binance Spot Testnet, Bybit testnet | Signing, filters, error codes, order state; on Binance, surviving a wiped account | Live prices, live order limits, live liquidity |
| Coinbase sandbox | JSON parsing and error branches, using the X-Sandbox header | Signing, order logic, state, market data |
| OKX demo | Signing, the mode header, order flow | Deposits and withdrawals, book size, your own market impact |
Three things stay unproven everywhere: whether your size exists at that price, where your limit order sits in the queue, and the delay from your server to the live matching engine. For costs, see slippage from the order book and backtesting pitfalls.
How close are test order books to production?
In two runs on 5 November 2026, demo hosts sat on or near production's mid price, the testnets were much thinner, and the Bybit testnet was far off on price.
Method: BTCUSDT spot public books, 12 rounds 20 seconds apart from 05:37 UTC and again from 19:41 UTC, one Python client calling hosts in turn (so gaps include movement within a round), no keys. Depth is the quantity within 10 basis points of mid, among the levels returned (up to 1,000 on Binance, 200 on Bybit, 400 on OKX). Only relative figures appear here, because exchange data terms can limit display.
| Environment | Median mid-price gap, bps | Median depth against production |
|---|---|---|
| Binance Demo Mode | 0.00 / 0.00 | 1.00 / 1.00 times |
| Binance Spot Testnet | 1.05 / 0.44 | 0.43 / 0.38 times |
| Bybit demo | 0.00 / 0.52 | 1.00 / 1.01 times |
| Bybit testnet | 278.94 / 269.51 | 0.06 / 0.06 times |
| OKX demo | 0.00 / 0.20 | 0.43 / 0.52 times |
- Trade flow. The latest 1,000 public trades spanned 1,783 seconds on the Spot Testnet, 194 on Demo Mode and 38 on the production data host in the morning, and 1,292, 71 and 21 in the evening, so a resting order's wait does not carry over.
- Order limits.
exchangeInforeturned 50 orders per 10 seconds on the Spot Testnet against 100 on Demo Mode and production; see the rate limit guide.
Binance calls its Testnet independent, yet its median gap stayed near 1 bp (largest 18 bps), so a close price does not make a market real. Your demo order is also not in the production book, so it cannot show your own impact.
Paper trading API in Python: dry-run mode and a live-host guard
Make dry-run the default and refuse every live host unless the configuration names it, at the point where a request leaves the process, so that a stray URL or redirect cannot place a real order.
import json, os
from urllib.parse import urlsplit
import requests
from requests.adapters import HTTPAdapter
TEST_HOSTS = {"testnet.binance.vision", "demo-api.binance.com", "api-testnet.bybit.com",
"api-demo.bybit.com", "api-sandbox.coinbase.com", "paper-api.alpaca.markets"}
HEADER_HOSTS = {"openapi.okx.com", "www.okx.com"} # one host; the header picks demo
class LiveRefused(RuntimeError):
pass
def environment_of(url, headers):
host = urlsplit(url).hostname
if host in HEADER_HOSTS and headers.get("x-simulated-trading") == "1":
return "test"
return "test" if host in TEST_HOSTS else "live" # unknown hosts count as live
class Guard(HTTPAdapter):
"""Checks every request, redirects included, as it leaves the process."""
def __init__(self, mode, live_host=None, **kw):
super().__init__(**kw)
self.mode, self.live_host = mode, live_host
def send(self, request, **kw):
host = urlsplit(request.url).hostname
if environment_of(request.url, request.headers) == "live":
if not (self.mode == "live" and host == self.live_host):
raise LiveRefused(f"{request.method} {host} refused in mode {self.mode}")
if self.mode == "dry-run" and request.method not in ("GET", "HEAD"):
reply = requests.Response()
reply.status_code, reply.url = 200, request.url
reply._content = json.dumps({"dryRun": True}).encode()
return reply
return super().send(request, **kw)
def build_session(env=os.environ):
mode = env.get("BOT_MODE", "dry-run") # dry-run unless told otherwise
if mode not in ("dry-run", "test", "live"):
raise SystemExit(f"unknown BOT_MODE {mode}")
live_host = env.get("BOT_LIVE_HOST") if mode == "live" else None
if mode == "live" and not (live_host and env.get("BOT_LIVE_CONFIRM") == f"I mean {live_host}"):
raise SystemExit("live needs BOT_LIVE_HOST and a matching BOT_LIVE_CONFIRM")
session = requests.Session()
for scheme in ("https://", "http://"):
session.mount(scheme, Guard(mode, live_host))
return session
if __name__ == "__main__":
order = {"symbol": "BTCUSDT", "side": "BUY", "type": "MARKET", "quantity": "0.001"}
testnet = "https://testnet.binance.vision/api/v3/order"
okx = "https://openapi.okx.com/api/v5/public/time"
dry, test = build_session({}), build_session({"BOT_MODE": "test"})
demo = {"x-simulated-trading": "1"}
for label, call in [("dry-run, testnet order", lambda: dry.post(testnet, params=order)),
("test, unsigned testnet order", lambda: test.post(testnet, params=order)),
("test, live order", lambda: test.post("https://api.binance.com/api/v3/order")),
("test, OKX no header", lambda: test.get(okx)),
("test, OKX demo header", lambda: test.get(okx, headers=demo)),
("live, unconfirmed", lambda: build_session({"BOT_MODE": "live"}))]:
try:
print(f"{label}: {call().text[:50]}")
except (LiveRefused, SystemExit) as err:
print(f"{label}: REFUSED {err}")Output on 5 November 2026 (Python 3.11.3, requests 2.31.0, public endpoints, no key):
dry-run, testnet order: {"dryRun": true}
test, unsigned testnet order: {"code":-1102,"msg":"Mandatory parameter 'signatur
test, live order: REFUSED POST api.binance.com refused in mode test
test, OKX no header: REFUSED GET openapi.okx.com refused in mode test
test, OKX demo header: {"code":"0","data":[{"ts":"1793858234970"}],"msg":
live, unconfirmed: REFUSED live needs BOT_LIVE_HOST and a matching BOT_LIVE_CONFIRMA host allowlist alone fails on OKX, where demo and production share a host, so the guard also reads the header. In separate checks, a local server redirecting to api.binance.com was refused, a confirmed live mode allowed only its named host, and exchange.session = build_session() in CCXT 4.5.10 refused its default live host. WebSocket URLs bypass this adapter and need the same check. A made-up key with a correct signature on the Spot Testnet returned -2015 or -2014, so testing without a real key proves only the request shape.
Failure cases when code moves between environments
These bugs come from assuming one environment behaves like the next; test the differences on purpose.
Tested 5 November 2026. A limit buy of 0.0002 BTC-USD and a limit sell of 999 ETH-EUR, both sent to the Coinbase sandbox, returned byte-identical bodies: a sell of 1 BTC-USD at 70000.44 with client order ID sandbox_success_order. Code that checks the reply against the request fails there. See the Coinbase sandbox guide.
- Redirects that look like success. A client following redirects from
demo-futures.kraken.comends on an HTML page with HTTP 200, so the failure appears as a JSON decoding error. - Wiped state. The Spot Testnet resets without notice and clears orders, which makes it a free reconciliation drill.
- CCXT sandbox mode. In CCXT 4.5.10,
set_sandbox_mode(True)adds the OKX header and points Bybit at its testnet, not demo, which has a separateenable_demo_trading(True). It raisesNotSupportedonkrakenandcoinbase, and still pointskrakenfuturesat the redirected host.
TradingView paper trading: is there a public order API?
No public order API for TradingView paper trading appears on the official pages read on 5 November 2026: an absence in the documents, not a statement from TradingView.
Its Help Center describes paper orders through the order ticket, depth of market and chart. The beta MCP documentation lists no order tool, and the REST specification is written for brokers integrating with TradingView. TradingView's Terms of Use (opens in a new tab), read the same day, license its data, alerts and webhooks for display-only use and prohibit automated trading, including through third-party products, so read them and take legal advice. A webhook receiver in dry-run mode tests that receiver, not TradingView's paper engine.
Crypto paper trading API free: what free costs you
Alpaca states that its paper trading is free, and no fee appeared on the other pages read on 5 November 2026, but each environment takes something else in exchange: realism at the Coinbase sandbox and Spot Testnet, some endpoints and old order records at Bybit demo, and full market data on Alpaca's Paper Only accounts. Most need an account with the venue, and availability varies by country. Several of these venues and TradingView also offer practice in a web app.
What paper results can and cannot tell you
Paper results are a software test: they show that orders, errors and restarts behave as written, not what the rules would earn.
This page shows no paper returns. Decide before the run what a pass means: orders accepted or rejected as expected, each error path exercised, a restart that reconciles state first. The full sequence is in how to test trading bots. For integration work in general, see the algorithmic trading page; naming these venues here does not mean Fincode integrates them or has built on them.
Frequently asked questions
Is there a free paper trading API for crypto?
Alpaca states its paper trading is free and simulates crypto, and no fee appeared on the other test pages read on 5 November 2026.
Do I need a separate paper trading API key?
Usually. Binance, Bybit, OKX and Alpaca issue test keys separately from production keys, and the Coinbase sandbox needs none.
Does Binance have a paper trading API?
For spot, Binance has two: the Spot Testnet at testnet.binance.vision and Demo Mode at demo-api.binance.com. The Testnet's prices are independent of live, while Demo Mode's are similar to live.
Can paper trading show whether a bot will make money?
No. It shows how the software behaves. Fills there do not reflect your own market impact, and simulated results do not predict future ones.
Sources
- Binance: Spot Test Network (resets, virtual funds, /api only) (opens in a new tab)
- Binance Spot API documentation: Demo Mode general info (compared with the Testnet) (opens in a new tab)
- Bybit V5 API: Demo Trading Service (opens in a new tab)
- Bybit V5 API: Integration guidance (testnet and mainnet hosts) (opens in a new tab)
- OKX API v5 documentation: Demo Trading Services (opens in a new tab)
- Kraken Developers: Exchange overview (Spot UAT, derivatives demo) (opens in a new tab)
- Kraken Developers: Quickstart (test environments) (opens in a new tab)
- Kraken Support: API testing environment, derivatives (updated 29 October 2026) (opens in a new tab)
- Coinbase Developer Platform: Advanced Trade API sandbox (opens in a new tab)
- Alpaca: Paper Trading (opens in a new tab)
- TradingView Help Center: Paper Trading main functionality (opens in a new tab)
- TradingView: MCP Server documentation (beta, tool list) (opens in a new tab)
- TradingView: REST API Specification for Brokers (opens in a new tab)
- TradingView: Terms of Use (section 3, read 5 November 2026) (opens in a new tab)
- Capital Markets Law No. 6362, consolidated text, Article 99/A (Turkish) (opens in a new tab)
This guide is general information about software and markets, not investment, legal or tax advice. Automated trading can lose money, past or backtested performance does not guarantee future results, and the rules that apply depend on your jurisdiction and your exchange's terms. Sources, checks and corrections: see the editorial policy.