Market Data

The Market Data API provides real-time quotes, stock information, and market hours for equities. Access current prices, bid/ask spreads, and trading session information to power your trading applications.

Overview

The Paper Market Data API delivers real-time market data with low latency. All endpoints require authentication and are subject to rate limiting to ensure optimal performance for all users.

API Endpoints Overview

EndpointMethodDescription
/v1/market-data/quote/:symbol
GETGet real-time quote for a single symbol
/v1/market-data/quotes/batch
POSTGet batch quotes for multiple symbols
/v1/market-data/market-hours
GETGet market hours for default exchange (NYSE)

Get Quote

Get real-time quote data for a single symbol. This endpoint has a high rate limit (1000 requests per window) to support real-time applications.

Path Parameters

NameTypeDescription
symbol
StringThe ticker symbol (e.g., AAPL, MSFT, TSLA)

Request

GET
/v1/market-data/quote/:symbol
curl -X GET https://api.paperinvest.io/v1/market-data/quote/AAPL \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"

Response

200 OK
{
  "symbol": "AAPL",
  "price": 175.25,
  "bid": 175.20,
  "ask": 175.30,
  "bidSize": 300,
  "askSize": 200,
  "last": 175.25,
  "lastSize": 100,
  "timestamp": 1715743859000
}

Response Fields

FieldTypeDescription
symbol
StringThe ticker symbol
price
NumberCurrent price (last trade or mid-point)
bid
NumberBest bid price
ask
NumberBest ask price
bidSize
NumberSize available at bid price
askSize
NumberSize available at ask price
last
NumberLast trade price
lastSize
NumberLast trade size
timestamp
NumberUnix timestamp in milliseconds

Get Batch Quotes

Get quotes for multiple symbols in a single request. Optimized for portfolio views and watchlists. No rate limiting applied to batch requests.

Request Body

NameTypeDescription
symbols
ArrayArray of ticker symbols (min: 1, max: 50)

Request

POST
/v1/market-data/quotes/batch
curl -X POST https://api.paperinvest.io/v1/market-data/quotes/batch \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "symbols": ["AAPL", "MSFT", "GOOGL", "AMZN"]
  }'

Response

200 OK
{
  "quotes": {
    "AAPL": {
      "symbol": "AAPL",
      "price": 175.25,
      "bid": 175.20,
      "ask": 175.30,
      "bidSize": 300,
      "askSize": 200,
      "last": 175.25,
      "lastSize": 100,
      "timestamp": 1715743859000
    },
    "MSFT": {
      "symbol": "MSFT",
      "price": 425.50,
      "bid": 425.45,
      "ask": 425.55,
      "bidSize": 150,
      "askSize": 175,
      "last": 425.50,
      "lastSize": 50,
      "timestamp": 1715743859000
    }
  },
  "errors": {
    "INVALID": "Symbol not found"
  }
}

Get Market Hours

Get current market hours and trading session status for the default exchange (NYSE).

Request

GET
/v1/market-data/market-hours
curl -X GET https://api.paperinvest.io/v1/market-data/market-hours \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"

Response

200 OK
{
  "isOpen": true,
  "openTime": "2025-01-15T14:30:00.000Z",
  "closeTime": "2025-01-15T21:00:00.000Z",
  "preMarket": {
    "isOpen": false,
    "openTime": "2025-01-15T09:00:00.000Z",
    "closeTime": "2025-01-15T14:30:00.000Z"
  },
  "afterHours": {
    "isOpen": false,
    "openTime": "2025-01-15T21:00:00.000Z",
    "closeTime": "2025-01-16T01:00:00.000Z"
  },
  "timestamp": 1715743859000,
  "holiday": null
}

Trading Sessions

Regular Market Hours

  • NYSE & NASDAQ: 9:30 AM - 4:00 PM ET
  • Trading Days: Monday through Friday
  • Holidays: Market closed on major US holidays

Extended Hours Trading

  • Pre-Market: 4:00 AM - 9:30 AM ET
  • After-Hours: 4:00 PM - 8:00 PM ET
  • Availability: Based on subscription tier

Error Handling

Service Unavailable

503 Service Unavailable
{
  "statusCode": 503,
  "message": "Market data service temporarily unavailable",
  "error": "Service Unavailable"
}

Symbol Not Found

503 Service Unavailable
{
  "statusCode": 503,
  "message": "Unable to fetch quote for symbol: INVALID",
  "error": "Service Unavailable"
}

See Also