Developer API

The most realistic paper trading API
for developers

Build trading bots, test algorithms, and integrate paper trading into your platform. Experience real market conditions with slippage, partial fills, and accurate order matching.

Quick Start Example

Get JWT Token & Place Order

// First, get JWT token from API key
const tokenResponse = await fetch('https://api.paperinvest.io/v1/auth/token', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({ apiKey: 'your_api_key' })
});
const { access_token } = await tokenResponse.json();

// Place a market order
const response = await fetch('https://api.paperinvest.io/v1/orders', {
  method: 'POST',
  headers: {
    'Authorization': `Bearer ${access_token}`,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    accountId: 'your-account-id',
    portfolioId: 'your-portfolio-id',
    assetClass: 'EQUITY',
    symbol: 'AAPL',
    side: 'BUY_TO_OPEN',
    quantity: 100,
    type: 'MARKET',
    timeInForce: 'DAY'
  })
});

const order = await response.json();
console.log(`Order status: ${order.status}`);
console.log(`Filled at: $${order.avgFillPrice}`);

Get Real-Time Quotes

// Get real-time quote for a symbol
const quoteResponse = await fetch(
  'https://api.paperinvest.io/v1/market-data/quote/AAPL',
  {
    headers: {
      'Authorization': `Bearer ${access_token}`
    }
  }
);

const quote = await quoteResponse.json();
console.log(`Current price: $${quote.last}`);
console.log(`Bid: $${quote.bid} x ${quote.bidSize}`);
console.log(`Ask: $${quote.ask} x ${quote.askSize}`);

// Get batch quotes for multiple symbols
const batchResponse = await fetch(
  'https://api.paperinvest.io/v1/market-data/quotes/batch',
  {
    method: 'POST',
    headers: {
      'Authorization': `Bearer ${access_token}`,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      symbols: ['AAPL', 'GOOGL', 'MSFT']
    })
  }
);

Built for serious algorithmic trading

Every API endpoint designed to mirror real trading conditions and help you build better trading systems

Realistic Execution

NBBO matching, queue position simulation, partial fills, and slippage modeling. Test your algorithms with real market conditions.

  • Market microstructure simulation
  • 22 broker rule sets
  • Realistic latency profiles

Authentication & Security

Enterprise-grade security with API key authentication, JWT tokens, and comprehensive audit logging.

  • API key management
  • JWT token authentication
  • Activity audit logs

Production-Ready Infrastructure

Smart rate limiting, comprehensive error handling, and detailed documentation. Built for serious trading applications.

  • WebSocket & SSE streaming
  • Batch operations support
  • Comprehensive error codes

Complete trading API suite

Everything you need to build sophisticated trading systems

Order Management

POST /v1/ordersCreate Order

Submit market, limit, stop, and bracket orders

GET /v1/orders/{orderId}Get Order

Retrieve order details with fill information

PUT /v1/orders/{orderId}/cancelCancel Order

Cancel pending orders with realistic latency

POST /v1/orders/batchBatch Orders

Submit multiple orders in a single request

Portfolio & Market Data

GET /v1/accounts/portfolios/{id}Portfolio

Real-time portfolio value, positions, and P&L

GET /v1/market-data/quote/{symbol}Quote

Real-time NBBO quotes with bid/ask sizes

POST /v1/market-data/quotes/batchBatch Quotes

Get quotes for multiple symbols efficiently

GET /v1/activity-log/portfolio/{id}Activity Log

Track all trading activity and events

Paper vs Live

Key similarities and differences to set expectations while you validate strategies.

AspectPaper TradingLive Markets
ExecutionNBBO-based matching; marketable orders execute; partial fills possibleExchange microstructure, venue routing, queue position matter
SlippageModeled slippage under typical conditionsCan vary widely with liquidity and volatility
LatencyRetail → colocated-like profilesDepends on venue, network, and colocations
Fees & ActionsMay omit some regulatory fees and corporate actionsReal regulatory fees, dividends, adjustments apply

Rules and Assumptions

How the simulator behaves so you can interpret results correctly.

TopicBehavior
MatchingOrders matched against current NBBO; non-marketable limits fill on cross
FillsPartial fills occur with realistic probabilities based on liquidity
Cancel/ReplaceRespects matching engine timing semantics
PDT/MarginBuying power and PDT checks emulate retail profiles (varies by broker emulation)
HoursExtended hours behavior depends on selected broker profile
Corporate ActionsDividends and some actions may be simplified or omitted

Comparing Other Simulators

Why results differ across platforms and what Paper emulates.

Common DifferenceTypical SimulatorPaper
FillsOften instantaneous and fullPartial fills and queue-like behavior possible
NBBO/SpreadSimplified best-price matchingNBBO-based, considers bid/ask and spread
LatencyUniform/ignoredProfiles from retail → colocated-like
Fees/MarginOften omittedModeled broker rules and buying power assumptions

Perfect for every trading use case

Trading Bot Development

Test your trading bots with realistic market conditions before deploying real capital. Perfect for momentum, mean reversion, and arbitrage strategies.

Strategy Backtesting

Forward-test your strategies with live market data. See how your algorithms perform with real slippage and market impact.

Education Platforms

Integrate paper trading into your educational platform. Give students realistic trading experience without financial risk.

Start building with Paper Trading API

Get your free API key and start building in minutes. No credit card required.

Free tier includes 5 trades per day. View pricing for unlimited access.

API FAQ

Is the paper trading API free?

Yes. The free tier includes quote streaming and a limited number of simulated orders per day. Upgrade for higher limits.

Do you support WebSockets?

Yes. Use WebSockets for quotes and SSE for portfolio streams. See the WebSocket guide.

Which languages are supported?

Any language that can call HTTP and WS. See Python and Node.js quickstarts.

How realistic are fills?

Fills simulate NBBO, queue position, partials, and slippage. Latency profiles emulate retail to colocated environments.