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
Endpoint | Method | Description |
---|---|---|
/v1/market-data/quote/:symbol | GET | Get real-time quote for a single symbol |
/v1/market-data/quotes/batch | POST | Get batch quotes for multiple symbols |
/v1/market-data/market-hours | GET | Get 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
Name | Type | Description |
---|---|---|
symbol | String | The ticker symbol (e.g., AAPL, MSFT, TSLA) |
Request
curl -X GET https://api.paperinvest.io/v1/market-data/quote/AAPL \
-H "Authorization: Bearer YOUR_JWT_TOKEN"
Response
{
"symbol": "AAPL",
"price": 175.25,
"bid": 175.20,
"ask": 175.30,
"bidSize": 300,
"askSize": 200,
"last": 175.25,
"lastSize": 100,
"timestamp": 1715743859000
}
Response Fields
Field | Type | Description |
---|---|---|
symbol | String | The ticker symbol |
price | Number | Current price (last trade or mid-point) |
bid | Number | Best bid price |
ask | Number | Best ask price |
bidSize | Number | Size available at bid price |
askSize | Number | Size available at ask price |
last | Number | Last trade price |
lastSize | Number | Last trade size |
timestamp | Number | Unix 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
Name | Type | Description |
---|---|---|
symbols | Array | Array of ticker symbols (min: 1, max: 50) |
Request
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
{
"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
curl -X GET https://api.paperinvest.io/v1/market-data/market-hours \
-H "Authorization: Bearer YOUR_JWT_TOKEN"
Response
{
"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
{
"statusCode": 503,
"message": "Market data service temporarily unavailable",
"error": "Service Unavailable"
}
Symbol Not Found
{
"statusCode": 503,
"message": "Unable to fetch quote for symbol: INVALID",
"error": "Service Unavailable"
}
See Also
- Orders API - For placing trades with real-time prices
- Portfolio API - For portfolio valuation with market data