Broker API HubMenu

Alpaca API GET /v2/stocks/quotes/latest

GET/v2/stocks/quotes/latestversion v2Market data (stocks)

The latest best bid and ask for a list of stock symbols: one quote per symbol.

Risk warning: CFDs and spread bets are complex instruments and come with a high risk of losing money rapidly due to leverage. You can lose money on these products, and each provider publishes its own loss figure under FCA rules. You should consider whether you understand how they work and whether you can afford to take the high risk of losing your money. Automated and API trading can amplify losses through bugs, connectivity failures and runaway orders.

Independent and unofficialdocs.alpaca.marketschecked

Market Data API: the host is https://data.alpaca.markets, not the trading host, so the base address in a generated sample must be changed to it. Authentication is the same two headers as the Trading API. The OpenAPI document gives 200 with X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset headers, and 400, 401, 403, 429 and 500. Quote fields: t, bx, bp, bs, ax, ap, as, c, z; a price of 0 means no active bid or ask. Recent SIP data needs Algo Trader Plus: without it the reply says the subscription does not permit querying recent SIP data.

Parameters

NameInTypeDescription
symbolsrequiredquerystringComma separated symbols, such as AAPL,TSLA.
feedquerystringsip, iex, delayed_sip, boats, overnight or otc. Default sip with a subscription that allows it, otherwise iex.
currencyquerystringThe currency of the prices, an ISO 4217 code. Default USD.

Authentication headers

NameTypeDescription
APCA-API-KEY-IDrequiredstringYour API key id. Placeholder only: never paste a real key into this site.
APCA-API-SECRET-KEYrequiredstringThe secret key that goes with the key id. Placeholder only: never paste a real secret into this site.

Request

Written from the method, path and parameters recorded on this page, against the demo host. Not executed against a live or demo account. Credentials are read from environment variables on your own machine and are never entered on this site. The request builder writes these same snippets, from the same record.

Python
# Set ALPACA_API_KEY_ID, ALPACA_API_SECRET_KEY as environment variables first. Never paste real values into code.
# Replace each {placeholder}, "..." and 0 with a real value before running.
# Optional and not shown: query parameters feed, currency.
import os
import requests

BASE_URL = "https://paper-api.alpaca.markets"  # the demo host
headers = {
    "APCA-API-KEY-ID": os.environ["ALPACA_API_KEY_ID"],
    "APCA-API-SECRET-KEY": os.environ["ALPACA_API_SECRET_KEY"],
}
params = {"symbols": "{symbols}"}
resp = requests.get(BASE_URL + "/v2/stocks/quotes/latest", headers=headers, params=params, timeout=10)
resp.raise_for_status()
print(resp.json())
JavaScript
// Set ALPACA_API_KEY_ID, ALPACA_API_SECRET_KEY as environment variables first. Never paste real values into code.
// Replace each {placeholder}, "..." and 0 with a real value before running.
// Optional and not shown: query parameters feed, currency.
// Run as a module, for example a .mjs file, on a Node version that has fetch built in.
const BASE_URL = "https://paper-api.alpaca.markets"; // the demo host
const res = await fetch(BASE_URL + "/v2/stocks/quotes/latest" + "?symbols={symbols}", {
  method: "GET",
  headers: {
    "APCA-API-KEY-ID": process.env.ALPACA_API_KEY_ID,
    "APCA-API-SECRET-KEY": process.env.ALPACA_API_SECRET_KEY,
  },
});
if (!res.ok) throw new Error(`HTTP ${res.status}`);
console.log(await res.json());
curl
# Set ALPACA_API_KEY_ID, ALPACA_API_SECRET_KEY as environment variables first. Never paste real values into code.
# Replace each {placeholder}, "..." and 0 with a real value before running.
# Optional and not shown: query parameters feed, currency.
curl -X GET "https://paper-api.alpaca.markets/v2/stocks/quotes/latest?symbols={symbols}" \
  -H "APCA-API-KEY-ID: $ALPACA_API_KEY_ID" \
  -H "APCA-API-SECRET-KEY: $ALPACA_API_SECRET_KEY"

Response

A mock response. The values are invented, so check field names against the official reference.

{
  "_mock": true,
  "quotes": {
    "MOCK": {
      "t": "2026-11-30T14:30:00.123456789Z",
      "bx": "V",
      "bp": 100.45,
      "bs": 3,
      "ax": "V",
      "ap": 100.5,
      "as": 2,
      "c": [
        "R"
      ],
      "z": "C"
    }
  },
  "currency": "USD"
}

Limits that apply at Alpaca

LimitValueScopeSource
client_order_id length128POST /v2/orders and PATCH /v2/orders/{order_id}docs.alpaca.marketschecked
Crypto order size200,000Crypto spot orders, buy or selldocs.alpaca.marketschecked
Market data historical API, Basic plan200Market Data API historical calls, Basic (free) plandocs.alpaca.marketschecked
Market data points per page10,000Market Data API historical bars, trades and quotes, counted across all symbolsdocs.alpaca.marketschecked
Market data historical API, Algo Trader Plus10,000Market Data API historical calls, Algo Trader Plus plan (99 US dollars a month)docs.alpaca.marketschecked
GTC order age90Orders with time in force gtcdocs.alpaca.marketschecked
Trading API request rateHTTP 429 above the limit, with X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset headers on replies; no figure on the pages openedTrading API, per accountdocs.alpaca.marketschecked
Market data WebSocket authentication timeout10Market data WebSocket, from connecting to the auth messagedocs.alpaca.marketschecked
Market data WebSocket connectionsDepends on the subscription; 1 for many subscriptions and with none. A second connection is answered with error 406 connection limit exceededMarket data WebSocket, per accountdocs.alpaca.marketschecked
Market data WebSocket symbols, Basic plan30Market data WebSocket, US equities, Basic (free) plan; Algo Trader Plus is unlimiteddocs.alpaca.marketschecked

Alpaca API errors you may meet

All Alpaca API error codes, including 20 more not listed here.