openapi: 3.0.0 info: title: Market Data API description: 'Access Alpaca’s historical and real-time US stock market and crypto data through REST API and WebSocket. There are APIs for Stock Pricing, Crypto Pricing, and News.' version: 2.0.0 contact: name: Alpaca Support email: support@alpaca.markets url: 'https://alpaca.markets/support' termsOfService: 'https://s3.amazonaws.com/files.alpaca.markets/disclosures/library/TermsAndConditions.pdf' servers: - url: 'https://data.alpaca.markets' description: Production - description: Sandbox url: 'https://data.sandbox.alpaca.markets' tags: - name: Stock Pricing Data API - name: Crypto Pricing Data API - name: News - name: Logo - name: Screener - name: Forex paths: /v2/stocks/bars: get: tags: - Stock Pricing Data API summary: Get Bar data for multiple stock symbols parameters: - $ref: '#/components/parameters/stock-symbols' - $ref: '#/components/parameters/start' - $ref: '#/components/parameters/end' - $ref: '#/components/parameters/timeframe' - $ref: '#/components/parameters/limit' - $ref: '#/components/parameters/page_token' - $ref: '#/components/parameters/adjustment' - $ref: '#/components/parameters/feed' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/MultiBarsResponse' examples: example-1: value: bars: AAPL: - t: '2022-02-28T05:00:00Z' o: 163.02 h: 165.42 l: 162.43 c: 165.12 v: 90552883 'n': 743379 vw: 164.274348 TSLA: - t: '2022-02-28T05:00:00Z' o: 815.72 h: 876.86 l: 814.7075 c: 870.43 v: 32122773 'n': 848700 vw: 855.748243 next_page_token: null operationId: getBarsForMultipleStockSymbols description: |- The Multi Bars API returns aggregate historical data for multiple given ticker symbols over a specified time period. Returned results are sorted by symbol first then by Bar timestamp. This means that you are likely to see only one symbol in your first response if there are enough Bars for that symbol to hit the limit you requested on that request. In these situations if you keep requesting again with the next_page_token you will eventually reach the next symbols if any Bars were found for them. /v2/stocks/bars/latest: get: summary: Get Latest Bar data for multiple stock symbols tags: - Stock Pricing Data API responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/LatestMultiBarsResponse' examples: example-1: value: bars: AAPL: t: '2022-03-10T20:01:00Z' o: 158.715 h: 158.73 l: 158.61 c: 158.615 v: 1211 'n': 21 vw: 158.680756 TSLA: t: '2022-03-10T20:01:00Z' o: 834.27 h: 834.27 l: 832.46 c: 832.46 v: 1257 'n': 48 vw: 833.55574 operationId: getLatestBarsForMultipleStockSymbols description: The Bars API returns aggregate historical data for the requested security. Returns the latest bar data for the queried stock symbols. parameters: - $ref: '#/components/parameters/stock-symbols' - $ref: '#/components/parameters/feed' '/v2/stocks/{symbol}/bars': get: tags: - Stock Pricing Data API summary: Bars parameters: - $ref: '#/components/parameters/start' - $ref: '#/components/parameters/end' - $ref: '#/components/parameters/timeframe' - $ref: '#/components/parameters/limit' - $ref: '#/components/parameters/page_token' - $ref: '#/components/parameters/feed' - $ref: '#/components/parameters/adjustment' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/BarsResponse' examples: getBarsStocks-example-1: value: bars: - t: '2021-02-01T16:01:00Z' o: 133.32 h: 133.74 l: 133.31 c: 133.5 v: 9876 - t: '2021-02-01T16:02:00Z' o: 133.5 h: 133.58 l: 133.44 c: 133.58 v: 3567 symbol: AAPL next_page_token: MjAyMS0wMi0wMVQxNDowMjowMFo7MQ== operationId: getBarsForStockSymbol description: The Bars API returns aggregate historical data for the requested security. Returns bars for the queried stock symbol. parameters: - $ref: '#/components/parameters/stock-symbol' '/v2/stocks/{symbol}/bars/latest': get: tags: - Stock Pricing Data API summary: Get Latest Bars for Symbol operationId: getLatestBarForStockSymbol description: The Bars API returns aggregate historical data for the requested security. Returns the latest bar data for the queried stock symbol. responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/LatestBarResponse' examples: example-1: value: symbol: AAPL bar: t: '2022-03-10T19:26:00Z' o: 158.035 h: 158.21 l: 158.035 c: 158.21 v: 800 'n': 15 vw: 158.113144 parameters: - $ref: '#/components/parameters/feed' parameters: - $ref: '#/components/parameters/stock-symbol' /v2/stocks/trades: get: tags: - Stock Pricing Data API summary: Get Trade data for multiple stock symbols parameters: - $ref: '#/components/parameters/stock-symbols' - $ref: '#/components/parameters/start' - $ref: '#/components/parameters/end' - $ref: '#/components/parameters/limit' - $ref: '#/components/parameters/page_token' - $ref: '#/components/parameters/feed' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/MultiTradesResponse' examples: geMultiTradesStocks-example-1: value: trades: SPY: - t: '2021-02-06T13:04:56.334320128Z' x: C p: 387.62 s: 100 c: - ' ' - T i: 52983525029461 z: B - t: '2021-02-06T13:09:42.325484032Z' x: C p: 387.69 s: 100 c: - ' ' - T i: 52983525033813 z: B next_page_token: MjAyMS0wMi0wNlQxMzowOTo0Mlo7MQ== operationId: getTradesForMultipleStockSymbols description: |- The Multi Trades API provides historical trade data for multiple given ticker symbols over a specified time period. Returned results are sorted by symbol first then by Trade timestamp. This means that you are likely to see only one symbol in your first response if there are enough Trades for that symbol to hit the limit you requested on that request. In these situations if you keep requesting again with the next_page_token you will eventually reach the next symbols if any Trades were found for them. /v2/stocks/trades/latest: get: summary: Get Latest Trades data for multiple stock symbols tags: - Stock Pricing Data API responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/LatestMultiTradesResponse' examples: example-1: value: trades: TSLA: t: '2022-03-11T17:24:55.143671726Z' x: V p: 801.83 s: 100 c: - '@' i: 9924 z: C AAPL: t: '2022-03-11T17:24:56.321817175Z' x: V p: 155.105 s: 300 c: - '@' i: 7741 z: C operationId: getLatestTradesForMultipleStockSymbols description: Returns the latest trades data for the queried stock symbols. parameters: - $ref: '#/components/parameters/stock-symbols' - $ref: '#/components/parameters/feed' '/v2/stocks/{symbol}/trades': get: tags: - Stock Pricing Data API summary: Trades parameters: - $ref: '#/components/parameters/start' - $ref: '#/components/parameters/end' - name: symbol in: path schema: type: string required: true description: The symbol to query for example: AAPL - $ref: '#/components/parameters/limit' - $ref: '#/components/parameters/page_token' - $ref: '#/components/parameters/feed' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/TradesResponse' examples: getTradeStocks-example-1: value: trades: - t: '2021-02-06T13:04:56.334320128Z' x: C p: 387.62 s: 100 c: - ' ' - T i: 52983525029461 z: B - t: '2021-02-06T13:09:42.325484032Z' x: C p: 387.69 s: 100 c: - ' ' - T i: 52983525033813 z: B symbol: SPY next_page_token: MjAyMS0wMi0wNlQxMzowOTo0Mlo7MQ== operationId: getTradesForStockSymbol description: The Trades API provides historical trade data for a given ticker symbol on a specified date. Returns trades for the queried stock signal. parameters: - $ref: '#/components/parameters/stock-symbol' '/v2/stocks/{symbol}/trades/latest': get: tags: - Stock Pricing Data API summary: Latest Trade parameters: - name: symbol in: path schema: type: string required: true description: The symbol to query for example: AAPL - $ref: '#/components/parameters/feed' responses: '200': description: Successful response content: application/json: examples: example-1: value: symbol: AAPL trade: t: '2022-02-01T17:46:51.111055251Z' x: V p: 173.06 s: 100 c: - '@' i: 6519 z: C schema: $ref: '#/components/schemas/LatestTradeResponse' operationId: getLatestTradeForStockSymbol description: The Latest Trade API provides the latest trade data for a given ticker symbol. parameters: - $ref: '#/components/parameters/stock-symbol' /v2/stocks/quotes: get: tags: - Stock Pricing Data API summary: Get Quotes for multiple stock symbols parameters: - $ref: '#/components/parameters/stock-symbols' - $ref: '#/components/parameters/start' - $ref: '#/components/parameters/end' - $ref: '#/components/parameters/limit' - $ref: '#/components/parameters/page_token' - $ref: '#/components/parameters/feed' responses: '200': description: | Successful response content: application/json: schema: $ref: '#/components/schemas/MultiQuotesReponse' examples: example-1: value: quotes: AAPL: - t: '2022-03-11T13:13:49.975594385Z' ax: V ap: 159.97 as: 1 bx: V bp: 0 bs: 0 c: - R z: C next_page_token: QUFQTHwyMDIyLTAzLTExVDEzOjEzOjQ5Ljk3NTU5NDM4NVp8MDFEQzVERDY= operationId: getQuotesForMultipleStockSymbols description: |- The Multi Quotes API provides NBBO quotes for multiple given ticker symbols over a specified time period. Returned results are sorted by symbol first then by Quote timestamp. This means that you are likely to see only one symbol in your first response if there are enough Quotes for that symbol to hit the limit you requested on that request. In these situations if you keep requesting again with the next_page_token you will eventually reach the next symbols if any Quotes were found for them. /v2/stocks/quotes/latest: get: summary: Get Latest Quotes for multiple stock symbols tags: - Stock Pricing Data API responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/LatestMultiQuotesResponse' examples: example-1: value: quotes: AAPL: t: '2022-03-11T18:40:13.514830169Z' ax: V ap: 156.47 as: 3 bx: V bp: 156.45 bs: 1 c: - R z: C TSLA: t: '2022-03-11T18:40:12.416216587Z' ax: V ap: 850 as: 1 bx: V bp: 798 bs: 2 c: - R z: C operationId: getLatestQuotesForMultipleStockSymbols description: Returns the latest quotes data for the queried stock symbols. parameters: - $ref: '#/components/parameters/stock-symbols' - $ref: '#/components/parameters/feed' '/v2/stocks/{symbol}/quotes': get: tags: - Stock Pricing Data API summary: Get Quotes for stock symbol parameters: - $ref: '#/components/parameters/start' - $ref: '#/components/parameters/end' - name: symbol in: path schema: type: string required: true description: The symbol to query for example: AAPL - $ref: '#/components/parameters/limit' - $ref: '#/components/parameters/page_token' - $ref: '#/components/parameters/feed' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/QuotesResponse' examples: getQuotesStocks-example-1: value: quotes: - t: '2022-02-01T09:00:00.000448Z' ax: K ap: 175 as: 1 bx: Q bp: 174.96 bs: 4 c: - R z: C - t: '2022-02-01T09:00:00.000448Z' ax: K ap: 175 as: 12 bx: Q bp: 174.96 bs: 4 c: - R z: C symbol: AAPL next_page_token: null operationId: getQuotesForStockSymbol description: The Quotes API provides NBBO quotes for a single given ticker symbol at a specified date. Returns quotes (NBBOs) for the querried stock symbol. parameters: - $ref: '#/components/parameters/stock-symbol' '/v2/stocks/{symbol}/quotes/latest': get: tags: - Stock Pricing Data API summary: Get Latest Quote for stock symbol parameters: - name: symbol in: path schema: type: string required: true description: The symbol to query for example: AAPL - $ref: '#/components/parameters/feed' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/LatestQuoteResponse' examples: example-1: value: symbol: AAPL quote: t: '2022-02-01T17:51:03.204726425Z' ax: V ap: 173.24 as: 4 bx: V bp: 173.21 bs: 4 c: - R z: C operationId: getLatestQuoteForStockSymbol description: The Latest Quote API provides the latest quote data for a given ticker symbol. parameters: - $ref: '#/components/parameters/stock-symbol' /v2/stocks/snapshots: get: tags: - Stock Pricing Data API summary: Get Snapshots for multiple stock symbols parameters: - $ref: '#/components/parameters/stock-symbols' - $ref: '#/components/parameters/feed' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/MultiSnapshotResponse' examples: example-1: value: AAPL: latestTrade: t: '2022-03-11T19:08:43.947998695Z' x: V p: 156.055 s: 100 c: - '@' i: 10593 z: C latestQuote: t: '2022-03-11T19:09:06.125564144Z' ax: V ap: 157.2 as: 5 bx: V bp: 156.08 bs: 1 c: - R z: C minuteBar: t: '2022-03-11T19:08:00Z' o: 156.02 h: 156.1 l: 156.02 c: 156.055 v: 4483 'n': 26 vw: 156.055956 dailyBar: t: '2022-03-11T05:00:00Z' o: 158.94 h: 159.25 l: 154.76 c: 156.055 v: 1180799 'n': 10408 vw: 156.545239 prevDailyBar: t: '2022-03-10T05:00:00Z' o: 160.23 h: 160.38 l: 155.98 c: 158.52 v: 1889292 'n': 17072 vw: 157.845202 TSLA: latestTrade: t: '2022-03-11T19:08:59.479520429Z' x: V p: 796.95 s: 100 c: - '@' i: 13647 z: C latestQuote: t: '2022-03-11T19:09:06.159593323Z' ax: V ap: 850 as: 1 bx: V bp: 796.49 bs: 1 c: - R z: C minuteBar: t: '2022-03-11T19:08:00Z' o: 796.78 h: 797.4 l: 796.78 c: 796.95 v: 2139 'n': 46 vw: 797.116889 dailyBar: t: '2022-03-11T05:00:00Z' o: 840.38 h: 843.055 l: 795.33 c: 796.95 v: 466980 'n': 13232 vw: 811.369454 prevDailyBar: t: '2022-03-10T05:00:00Z' o: 851.5 h: 853.355 l: 810.76 c: 838.21 v: 578475 'n': 16118 vw: 828.766436 operationId: getSnapshotsForMultipleStockSymbols description: 'The Snapshot API for multiple tickers provides the latest trade, latest quote, minute bar daily bar and previous daily bar data for the given ticker symbols.' '/v2/stocks/{symbol}/snapshot': get: tags: - Stock Pricing Data API summary: Get a Snapshot for a stock symbol parameters: - name: symbol in: path schema: type: string required: true description: The symbol to query for example: AAPL - $ref: '#/components/parameters/feed' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/Snapshot' examples: getSnapshotStocks-example-1: value: symbol: AAPL latestTrade: t: '2021-05-11T20:00:00.435997104Z' x: Q p: 125.91 s: 5589631 c: - '@' - M i: 179430 z: C latestQuote: t: '2021-05-11T22:05:02.307304704Z' ax: P ap: 125.68 as: 12 bx: P bp: 125.6 bs: 4 c: - R minuteBar: t: '2021-05-11T22:02:00Z' o: 125.66 h: 125.66 l: 125.66 c: 125.66 v: 396 dailyBar: t: '2021-05-11T04:00:00Z' o: 123.5 h: 126.27 l: 122.77 c: 125.91 v: 125863164 prevDailyBar: t: '2021-05-10T04:00:00Z' o: 129.41 h: 129.54 l: 126.81 c: 126.85 v: 79569305 operationId: getSnapshotForStockSymbol description: 'The Snapshot API for one ticker provides the latest trade, latest quote, minute bar daily bar and previous daily bar data for a given ticker symbol. This endpoint returns the snapshot for the requested security.' parameters: - $ref: '#/components/parameters/stock-symbol' /v1beta1/crypto/trades: get: tags: - Crypto Pricing Data API summary: Get Trade data for multiple crypto symbols parameters: - $ref: '#/components/parameters/start' - $ref: '#/components/parameters/end' - $ref: '#/components/parameters/crypto-exchanges' - $ref: '#/components/parameters/limit' - $ref: '#/components/parameters/page_token' - $ref: '#/components/parameters/crypto-symbols' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/MultiTradesResponse' examples: example-1: value: trades: BTCUSD: - t: '2022-03-02T06:00:00.028455Z' x: CBSE p: 44299.16 s: 0.001 tks: B i: 289852921 - t: '2022-03-02T06:00:00.028455Z' x: CBSE p: 44299.15 s: 0.001 tks: B i: 289852922 next_page_token: QlRDVVNEfDIwMjItMDMtMDJUMDY6MDA6MDAuMDI4NDU1MDAwWnxDQlNFfDA5MjIzMzcyMDM3MTQ0NjI4NzMw operationId: getTradesForMultipleCryptoSymbols description: |- The Multi Trades API provides historical trade data for a list of given crypto symbols on a specified date. Returns trades for the queried crypto symbols. Returned results are sorted by symbol first then by Trade timestamp. This means that you are likely to see only one symbol in your first response if there are enough Trades for that symbol to hit the limit you requested on that request. In these situations if you keep requesting again with the next_page_token you will eventually reach the next symbols if any Trades were found for them. /v1beta1/crypto/trades/latest: get: summary: Get Latest Trade data for multiple Crypto symbols tags: - Crypto Pricing Data API responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/LatestMultiTradesResponse' examples: example-1: value: trades: ETHUSD: t: '2022-03-08T22:13:55.777631Z' x: FTXU p: 2562.8 s: 0.881 tks: S i: 26271234 BTCUSD: t: '2022-03-08T22:14:47.379901Z' x: FTXU p: 38510 s: 0.05 tks: B i: 26271277 operationId: getLatestTradesForMultipleCryptoSymbols description: 'Provides latest trade data for a list of given crypto symbols. ' parameters: - $ref: '#/components/parameters/crypto-symbols' - $ref: '#/components/parameters/crypto-exchange' '/v1beta1/crypto/{symbol}/trades': get: tags: - Crypto Pricing Data API summary: Get Trade data for a crypto symbol parameters: - $ref: '#/components/parameters/start' - $ref: '#/components/parameters/end' - $ref: '#/components/parameters/crypto-exchanges' - $ref: '#/components/parameters/limit' - $ref: '#/components/parameters/page_token' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/TradesResponse' examples: example-1: value: trades: - t: '2022-02-27T11:04:55.82622Z' x: FTXU p: 39330 s: 0.0003 tks: B i: 25783365 symbol: BTCUSD next_page_token: QlRDVVNEfDIwMjItMDItMjdUMTE6MDQ6NTUuODI2MjIwMDAwWnxGVFhVfDA5MjIzMzcyMDM2ODgwNTU5MTcz operationId: getTradesForCryptoSymbol description: The Trades API provides historical trade data for a given crypto symbol on a specified date. Returns trades for the queried crypto symbol parameters: - $ref: '#/components/parameters/crypto-symbol' '/v1beta1/crypto/{symbol}/trades/latest': get: tags: - Crypto Pricing Data API summary: Latest Trades parameters: - $ref: '#/components/parameters/crypto-exchange' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/LatestTradeResponse' examples: example-1: value: symbol: BTCUSD trade: t: '2022-03-08T22:27:26.573044Z' x: FTXU p: 38614 s: 0.0019 tks: S i: 26271424 operationId: getLatestTradesForCryptoSymbol description: The Latest Trades API provides the latest historical trade data for a given crypto symbol. Returns trades for the queried crypto symbol. parameters: - $ref: '#/components/parameters/crypto-symbol' /v1beta1/crypto/bars: get: tags: - Crypto Pricing Data API summary: Get Bars for multiple Crypto symbols description: |- returns aggregate historical data for the requested crypto symbols. Returned results are sorted by symbol first then by Bar timestamp. This means that you are likely to see only one symbol in your first response if there are enough Bars for that symbol to hit the limit you requested on that request. In these situations if you keep requesting again with the next_page_token you will eventually reach the next symbols if any Bars were found for them. parameters: - $ref: '#/components/parameters/crypto-symbols' - $ref: '#/components/parameters/start' - $ref: '#/components/parameters/end' - $ref: '#/components/parameters/timeframe' - $ref: '#/components/parameters/page_token' - $ref: '#/components/parameters/limit' - $ref: '#/components/parameters/crypto-exchanges' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/MultiBarsResponse' examples: example-1: value: bars: BTCUSD: - t: '2022-02-28T06:00:00Z' x: FTXU o: 37866 h: 44340 l: 37494 c: 43241 v: 2817.008 'n': 10116 vw: 40876.4518611946 next_page_token: QlRDVVNEfER8MjAyMi0wMi0yOFQwNjowMDowMC4wMDAwMDAwMDBafEZUWFU= operationId: getBarsForMultipleCryptoSymbols /v1beta1/crypto/bars/latest: get: summary: Get Latest Bars for multiple Crypto symbols tags: - Crypto Pricing Data API responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/LatestMultiBarsResponse' examples: example-1: value: bars: LINKUSD: t: '2022-03-08T17:33:00Z' x: FTXU o: 13.3565 h: 13.3565 l: 13.3565 c: 13.3565 v: 41.4 'n': 1 vw: 13.3565 BTCUSD: t: '2022-03-08T17:40:00Z' x: FTXU o: 39055 h: 39055 l: 39055 c: 39055 v: 0.1 'n': 1 vw: 39055 operationId: getLatestBarsForMultipleCryptoSymbols description: returns latest historical data for the requested crypto symbols for a specific exchange parameters: - $ref: '#/components/parameters/crypto-symbols' - $ref: '#/components/parameters/crypto-exchange' '/v1beta1/crypto/{symbol}/bars': get: tags: - Crypto Pricing Data API summary: Get Bar data for a crypto symbol parameters: - $ref: '#/components/parameters/start' - $ref: '#/components/parameters/end' - $ref: '#/components/parameters/timeframe' - $ref: '#/components/parameters/crypto-exchanges' - $ref: '#/components/parameters/limit' - $ref: '#/components/parameters/page_token' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/BarsResponse' examples: example-1: value: bars: - t: '2022-02-01T09:04:00Z' x: CBSE o: 38702.54 h: 39013.58 l: 38702.54 c: 39013.58 v: 201.67087877 'n': 2965 vw: 38889.6517051631 symbol: BTCUSD next_page_token: QlRDVVNEfE18MjAyMi0wMi0wMVQwOTowNDowMC4wMDAwMDAwMDBafENCU0U= operationId: getBarsForCryptoSymbol description: The Bars API returns aggregate historical data for the requested securities.. Returns bars for the queried crypto symbol parameters: - $ref: '#/components/parameters/crypto-symbol' '/v1beta1/crypto/{symbol}/bars/latest': parameters: - $ref: '#/components/parameters/crypto-symbol' get: summary: Get Latest Bar data for a Crypto symbol responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/LatestBarResponse' examples: example-1: value: symbol: BTCUSD bar: t: '2022-03-08T21:05:00Z' x: FTXU o: 38576 h: 38576 l: 38576 c: 38576 v: 0.063 'n': 1 vw: 38576 operationId: getLatestBarsForCryptoSymbol description: Gets latest historical bar data for the requested crypto symbol for a specific exchange tags: - Crypto Pricing Data API parameters: - $ref: '#/components/parameters/crypto-exchange' /v1beta1/crypto/quotes: get: tags: - Crypto Pricing Data API summary: Get Quotes for multiple crypto symbols parameters: - $ref: '#/components/parameters/start' - $ref: '#/components/parameters/end' - $ref: '#/components/parameters/crypto-exchanges' - $ref: '#/components/parameters/limit' - $ref: '#/components/parameters/page_token' - $ref: '#/components/parameters/crypto-symbols' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/MultiQuotesReponse' examples: example-1: value: quotes: BTCUSD: - t: '2022-03-02T06:00:00.057935872Z' x: FTXU bp: 44154.14 bs: 0.1048 ap: 44427.88 as: 2.3321 - t: '2022-03-02T06:00:00.132880896Z' x: FTXU bp: 44154.14 bs: 0.1048 ap: 44427.88 as: 2.3321 next_page_token: QlRDVVNEfDIwMjItMDMtMDJUMDY6MDA6MDAuMTMyODgwODk2WnxGVFhVfEM3QkQ4QjI5 operationId: getQuotesForMultipleCryptoSymbols description: |- The Multi Quotes API provides quotes for a list of given crypto symbols at a specified date. Returns quotes for each of the queried crypto symbols. Returned results are sorted by symbol first then by Quote timestamp. This means that you are likely to see only one symbol in your first response if there are enough Quotes for that symbol to hit the limit you requested on that request. In these situations if you keep requesting again with the next_page_token you will eventually reach the next symbols if any Quotes were found for them. /v1beta1/crypto/quotes/latest: get: summary: Get Latest Quotes for multiple Crypto symbols tags: - Crypto Pricing Data API responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/LatestMultiQuotesResponse' examples: example-1: value: quotes: ETHUSD: t: '2022-03-08T22:40:52.536436224Z' x: FTXU bp: 2562.99 bs: 23.798 ap: 2579.11 as: 22.155 BTCUSD: t: '2022-03-08T22:40:52.662990848Z' x: FTXU bp: 38465.26 bs: 2.641 ap: 38698.75 as: 1.3746 operationId: getLatestQuotesForMultipleCryptoSymbols description: Provides latest quotes for a list of given crypto symbols. parameters: - $ref: '#/components/parameters/crypto-symbols' - $ref: '#/components/parameters/crypto-exchange' '/v1beta1/crypto/{symbol}/quotes': get: tags: - Crypto Pricing Data API summary: Get Quotes for crypto symbol parameters: - $ref: '#/components/parameters/start' - $ref: '#/components/parameters/end' - $ref: '#/components/parameters/crypto-exchanges' - $ref: '#/components/parameters/limit' - $ref: '#/components/parameters/page_token' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/QuotesResponse' examples: example-1: value: quotes: - t: '2022-02-01T06:00:00.009249124Z' x: ERSX bp: 38422.64 bs: 1.56 ap: 38515.48 as: 1.5 - t: '2022-02-01T06:00:00.009249124Z' x: ERSX bp: 38419.54 bs: 3 ap: 38515.48 as: 1.5 symbol: BTCUSD next_page_token: null operationId: getQuotesForCryptoSymbol description: The Quotes API provides quotes for a given crypto symbol at a specified date. Returns quotes for the queried crypto symbol parameters: - $ref: '#/components/parameters/crypto-symbol' '/v1beta1/crypto/{symbol}/quotes/latest': get: tags: - Crypto Pricing Data API summary: Latest Quote parameters: - $ref: '#/components/parameters/crypto-exchange' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/LatestQuoteResponse' examples: example-1: value: symbol: BTCUSD quote: t: '2022-02-01T20:14:52.486171758Z' x: ERSX bp: 38511.45 bs: 1.5 ap: 38598.06 as: 1.556 operationId: getLatestQuoteForCryptoSymbol description: Returns latest quote for the queried crypto symbol parameters: - $ref: '#/components/parameters/crypto-symbol' /v1beta1/crypto/snapshots: get: tags: - Crypto Pricing Data API summary: Get Snapshots for multiple crypto symbols parameters: - $ref: '#/components/parameters/crypto-exchange' - $ref: '#/components/parameters/crypto-symbols' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/MultiSnapshotResponse' examples: {} application/xml: schema: type: object properties: {} multipart/form-data: schema: type: object properties: {} operationId: getSnapshotsForMultipleCryptoSymbols description: 'The Multi Snapshot API returns the latest trade, latest quote, minute bar daily bar, and previous daily bar data for list of given crypto symbols.' parameters: [] '/v1beta1/crypto/{symbol}/snapshot': get: tags: - Crypto Pricing Data API summary: Get a Snapshot for a crypto symbol parameters: - $ref: '#/components/parameters/crypto-exchange' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/Snapshot' examples: {} application/xml: schema: type: object properties: {} operationId: getSnapshotForCryptoSymbol description: 'The Snapshot API returns the latest trade, latest quote, minute bar daily bar, and previous daily bar data for a given crypto symbol.' parameters: - $ref: '#/components/parameters/crypto-symbol' /v1beta1/crypto/xbbos/latest: get: summary: Get Latest XBBO for multiple crypto symbols tags: - Crypto Pricing Data API responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/LatestMultiXBBOResponse' examples: example-1: value: xbbos: BTCUSD: t: '2022-03-08T22:59:49.514811056Z' ax: ERSX ap: 38556.7 as: 1.556151 bx: FTXU bp: 38562 bs: 2.5781 operationId: getLatestXBBOForMultipleCryptoSymbols description: Returns the latest XBBO for a given list crypto symbols that calculates the Best Bid and Offer across multiple exchanges. If exchanges is not specified then only the exchanges that can be traded on Alpaca are included in the calculation. parameters: - $ref: '#/components/parameters/crypto-symbols' - $ref: '#/components/parameters/crypto-exchanges' parameters: [] '/v1beta1/crypto/{symbol}/xbbo/latest': get: tags: - Crypto Pricing Data API summary: Get Latest XBBO for a single crypto symbol parameters: - $ref: '#/components/parameters/crypto-exchanges' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/LatestXBBOResponse' examples: example-1: value: symbol: BTCUSD xbbo: t: '2022-02-01T20:21:03.323000342Z' ax: FTXU ap: 38529 as: 0.0688 bx: ERSX bp: 38534 bs: 1.5 operationId: getLatestXBBOForCryptoSymbol description: Returns the XBBO for a crypto symbol that calculates the Best Bid and Offer across multiple exchanges. If exchanges is not specified then only the exchanges that can be traded on Alpaca are included in the calculation. parameters: - $ref: '#/components/parameters/crypto-symbol' /v1beta1/crypto/meta/spreads: get: summary: Get list of crypto spreads per exchange responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/CryptoSpreadsResponse' examples: example-1: value: spreads: ERSX: 30 FTXU: 30 operationId: getCryptoMetaSpreads description: Get list of crypto spreads for the different exchanges Alpaca supports in basis points. tags: - Crypto Pricing Data API parameters: [] /v1beta1/news: get: summary: News API parameters: - $ref: '#/components/parameters/start' - $ref: '#/components/parameters/end' - $ref: '#/components/parameters/crypto-symbols' - $ref: '#/components/parameters/limit' - name: sort in: query schema: type: string enum: - DESC - ASC description: 'Sort articles by updated date. Options: DESC, ASC' example: DESC - name: include_content in: query schema: type: boolean description: Boolean indicator to include content for news articles (if available) - name: exclude_contentless in: query schema: type: boolean description: 'Boolean indicator to exclude news articles that do not contain content ' - $ref: '#/components/parameters/page_token' responses: '200': description: Successful response content: application/json: examples: news-response-example: value: news: - id: 24843171 headline: 'Apple Leader in Phone Sales in China for Second Straight Month in November With 23.6% Share, According to Market Research Data' author: Charles Gross created_at: '2021-12-31T11:08:42Z' updated_at: '2021-12-31T11:08:43Z' summary: 'This headline-only article is meant to show you why a stock is moving, the most difficult aspect of stock trading' content: '

This headline-only article is meant to show you why a stock is moving, the most difficult aspect of stock trading....

' url: 'https://www.benzinga.com/news/21/12/24843171/apple-leader-in-phone-sales-in-china-for-second-straight-month-in-november-with-23-6-share-according' images: [] symbols: - AAPL source: benzinga next_page_token: MTY0MDk0ODkyMzAwMDAwMDAwMHwyNDg0MzE3MQ== schema: $ref: '#/components/schemas/GetNewsResponse' operationId: getNews description: Returns latest news articles across stocks and crypto. By default returns latest 10 news articles. tags: - News '/v1beta1/screener/{market_type}/movers': parameters: - schema: type: string enum: - stocks - crypto name: market_type in: path description: Screen specific market (stocks or crypto) required: true get: summary: Get Top Market Movers by Market type tags: - Screener responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/MarketMoversResponse' examples: example-1: value: gainers: - symbol: AGRI percent_change: 145.56 change: 2.46 price: 4.15 - symbol: GRCYW percent_change: 85.63 change: 0.03 price: 0.0594 losers: - symbol: MTACW percent_change: -63.07 change: -0.26 price: 0.1502 - symbol: TIG percent_change: -51.21 change: -3.61 price: 3.435 market_type: stocks last_updated: '2022-03-10T17:53:30.088309839Z' operationId: getTopMoversByMarketType x-internal: true description: Returns top market movers for stocks. By default will return top 5 market gainers and losers. parameters: - schema: type: integer default: 10 maximum: 50 in: query name: top description: Number of top market movers to fetch (gainers and losers). Will return number top for each. By default 10 gainers and 10 losers. '/v1beta1/logos/{crypto_or_stock_symbol}': get: summary: Get Logo for symbol tags: - Logo responses: '200': description: Returns the requested logo as an image. content: image/*: schema: type: string format: binary description: the requested logo '404': description: No Logo was found for this symbol. This code will only be returned if you set `placeholder` to false. Otherwise we will generate a placeholder image for this symbol operationId: getLogoForSymbol description: Returns logo image resource for provided symbol. parameters: - schema: type: boolean default: true in: query name: placeholder description: If true then the api will generate a placeholder image if no logo was found. Defaults to true parameters: - schema: type: string name: crypto_or_stock_symbol in: path required: true description: 'The crypto or stock symbol to query for. Note, currently all crypto symbols must be appended with "USD", ie "BTCUSD" would be how you query for BTC.' /v2/stocks/meta/exchanges: get: summary: Get List of supported exchanges responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/ExchangesResponse' examples: example-1: value: Z: Cboe BZ I: International Securities Exchange M: Chicago Stock Exchange U: Members Exchange L: Long Term Stock Exchange W: CBOE X: NASDAQ OMX PSX B: NASDAQ OMX BX D: FINRA ADF J: Cboe EDGA P: NYSE Arca Q: NASDAQ OMX S: NASDAQ Small Cap V: IEX A: NYSE American (AMEX) E: Market Independent 'N': New York Stock Exchange T: NASDAQ Int 'Y': Cboe BYX C: National Stock Exchange H: MIAX K: Cboe EDGX operationId: getExchanges description: Returns a json object representing the exchanges we support. The keys are the short form codes you will see in our responses and the values are their respective full names. tags: - Stock Pricing Data API '/v2/stocks/meta/conditions/{type}': parameters: - schema: type: string enum: - trade - quote example: trade name: type in: path required: true description: either "trade" or "quote" get: summary: Get list of Conditions responses: '200': description: |- OK Response is a JSON object mapping a condition to a plain text description content: application/json: schema: type: object additionalProperties: true examples: example-trading-A: value: '4': Derivatively Priced '5': Market Center Reopening Trade '6': Market Center Closing Trade '7': Qualified Contingent Trade '8': Reserved '9': Corrected Consolidated Close Price as per Listing Market F: Inter-market Sweep Order O: Market Center Opening Trade ' ': Regular Sale B: Average Price Trade C: Cash Trade (Same Day Clearing) E: Automatic Execution M: Market Center Official Close T: Extended Hours Trade U: Extended Hours Sold (Out Of Sequence) I: Odd Lot Trade K: Rule 127 (NYSE only) or Rule 155 (NYSE MKT only) R: Seller X: Cross Trade Z: Sold (Out Of Sequence) 'N': Next Day Trade (Next Day Clearing) P: Prior Reference Price Q: Market Center Official Open V: Contingent Trade H: Price Variation Trade L: Sold Last (Late Reporting) example-quote-C: value: '4': On Demand Intra Day Auction U: Manual Bid And Ask Non Firm B: Manual Bid Automated Ask R: Regular Two Sided Open A: Manual Ask Automated Bid F: Fast Trading H: Manual Bid And Ask L: Closed Quote 'N': Non Firm Quote I: Order Imbalance O: Opening Quote Automated 'Y': No Offer No Bid One Sided Open X: Order Influx Z: No Open No Resume operationId: getConditions description: |- Each feed/exchange uses its own set of codes to identify trade and quote conditions, so the same condition may have a different code depending on the originator of the data. See [Our documentation](https://alpaca.markets/docs/market-data/#conditions) for more information parameters: - schema: type: string enum: - A - B - C example: A in: query name: tape required: true description: 'What kind of conditions to retrieve, "A" and "B" return CTS, where "C" will give you UTP ' tags: - Stock Pricing Data API components: securitySchemes: API_Key: name: APCA-API-KEY-ID type: apiKey in: header API_Secret: name: APCA-API-SECRET-KEY type: apiKey in: header schemas: Trade: title: Trade type: object description: A model representing a trade x-examples: trade-example-1: t: '2021-02-06T13:04:56.334320128Z' x: C p: 387.62 s: 100 c: - ' ' - T i: 52983525029461 z: B example-crypto: t: '2022-02-27T11:04:55.82622Z' x: FTXU p: 39330 s: 0.0003 tks: B i: 25783365 properties: t: type: string description: Timestamp in RFC-3339 format with nanosecond precision format: date-time x: type: string description: Exchange where the trade happened. p: type: number description: Trade price. s: type: number description: Trade Size. c: type: array description: Trade conditions (Stock trade only) items: type: string i: type: integer description: Trade ID format: int64 z: type: string description: Tape (Stock trade only) tks: type: string description: Taker's side (crypto trade only) required: - x - i TradesResponse: title: TradesResponse type: object description: |- A model representing the result of hitting the Trades api. Represents multiple Trades for a single symbol with support for paging. x-examples: trades-example-1: trades: - t: '2021-02-06T13:04:56.334320128Z' x: C p: 387.62 s: 100 c: - ' ' - T i: 52983525029461 z: B - t: '2021-02-06T13:09:42.325484032Z' x: C p: 387.69 s: 100 c: - ' ' - T i: 52983525033813 z: B symbol: SPY next_page_token: MjAyMS0wMi0wNlQxMzowOTo0Mlo7MQ== properties: trades: type: array description: Array of trades items: $ref: '#/components/schemas/Trade' symbol: type: string description: Symbol that was queried example: AAPL minLength: 1 next_page_token: type: string description: Token that can be used to query the next page nullable: true required: - trades - symbol LatestTradeResponse: title: LatestTradeResponse type: object description: |- A model representing the result of hitting the Latest Trade api. Represents a single Trade that should be the latest trade data for a given ticker symbol x-examples: latestTradesResponse-example-1: symbol: AAPL trade: t: '2022-02-01T17:46:51.111055251Z' x: V p: 173.06 s: 100 c: - '@' i: 6519 z: C crypto-example-1: symbol: BTCUSD trade: t: '2022-03-08T22:27:26.573044Z' x: FTXU p: 38614 s: 0.0019 tks: S i: 26271424 properties: trade: $ref: '#/components/schemas/Trade' symbol: type: string description: Symbol that was queried example: AAPL minLength: 1 required: - symbol MultiTradesResponse: title: MultiTradesResponse type: object description: | A model representing the result of hitting the Multi Trades api; represents multiple trades for multiple symbols. Returned results are sorted by symbol first then by Trade timestamp. This means that you are likely to see only one symbol in your first response if there are enough Trades for that symbol to hit the limit you requested on that request. In these situations if you keep requesting again with the next_page_token you will eventually reach the next symbols if any Trades were found for them. x-examples: multiTradesResponse-example-1: trades: SPY: - t: '2021-02-06T13:04:56.334320128Z' x: C p: 387.62 s: 100 c: - ' ' - T i: 52983525029461 z: B - t: '2021-02-06T13:09:42.325484032Z' x: C p: 387.69 s: 100 c: - ' ' - T i: 52983525033813 z: B next_page_token: MjAyMS0wMi0wNlQxMzowOTo0Mlo7MQ== multiTradesResponse-with-multiple-symbols-at-once-example-1: trades: AAPL: - t: '2021-02-06T13:04:56.334320128Z' x: C p: 387.62 s: 100 c: - ' ' - T i: 52983525029461 z: B - t: '2021-02-06T13:09:42.325484032Z' x: C p: 387.69 s: 100 c: - ' ' - T i: 52983525033813 z: B SPY: - t: '2021-02-06T05:09:42.325484032Z' x: C p: 400.55 s: 100 c: - ' ' - T i: 52983525033954 z: B next_page_token: MjAyMS0wMi0wNlQxMzowOTo0Mlo7MQ== properties: trades: type: object additionalProperties: type: array items: $ref: '#/components/schemas/Trade' next_page_token: type: string nullable: true required: - trades LatestMultiTradesResponse: description: '' type: object x-examples: example-crypto-1: trades: ETHUSD: t: '2022-03-08T22:13:55.777631Z' x: FTXU p: 2562.8 s: 0.881 tks: S i: 26271234 BTCUSD: t: '2022-03-08T22:14:47.379901Z' x: FTXU p: 38510 s: 0.05 tks: B i: 26271277 example-1: trades: TSLA: t: '2022-03-11T17:24:55.143671726Z' x: V p: 801.83 s: 100 c: - '@' i: 9924 z: C AAPL: t: '2022-03-11T17:24:56.321817175Z' x: V p: 155.105 s: 300 c: - '@' i: 7741 z: C properties: trades: type: object additionalProperties: $ref: '#/components/schemas/Trade' required: - trades Snapshot: title: Snapshot type: object description: | The Snapshot API for one ticker provides the latest trade, latest quote, minute bar daily bar and previous daily bar data for a given ticker symbol. x-examples: snapshot-example-1: symbol: AAPL latestTrade: t: '2021-05-11T20:00:00.435997104Z' x: Q p: 125.91 s: 5589631 c: - '@' - M i: 179430 z: C latestQuote: t: '2021-05-11T22:05:02.307304704Z' ax: P ap: 125.68 as: 12 bx: P bp: 125.6 bs: 4 c: - R minuteBar: t: '2021-05-11T22:02:00Z' o: 125.66 h: 125.66 l: 125.66 c: 125.66 v: 396 dailyBar: t: '2021-05-11T04:00:00Z' o: 123.5 h: 126.27 l: 122.77 c: 125.91 v: 125863164 prevDailyBar: t: '2021-05-10T04:00:00Z' o: 129.41 h: 129.54 l: 126.81 c: 126.85 v: 79569305 properties: latestTrade: $ref: '#/components/schemas/Trade' latestQuote: $ref: '#/components/schemas/Quote' minuteBar: $ref: '#/components/schemas/Bar' dailyBar: $ref: '#/components/schemas/Bar' prevDailyBar: $ref: '#/components/schemas/Bar' MultiSnapshotResponse: title: MultiSnapshotResponse type: object description: | A model representing the result of hitting the Multi Snapshots api; represents Snapshots for multiple symbols. The result is an object whose keys are the requested symbols and values are their respecitve Snapshot additionalProperties: $ref: '#/components/schemas/Snapshot' x-examples: example-1: AAPL: latestTrade: t: '2022-03-11T19:08:43.947998695Z' x: V p: 156.055 s: 100 c: - '@' i: 10593 z: C latestQuote: t: '2022-03-11T19:09:06.125564144Z' ax: V ap: 157.2 as: 5 bx: V bp: 156.08 bs: 1 c: - R z: C minuteBar: t: '2022-03-11T19:08:00Z' o: 156.02 h: 156.1 l: 156.02 c: 156.055 v: 4483 'n': 26 vw: 156.055956 dailyBar: t: '2022-03-11T05:00:00Z' o: 158.94 h: 159.25 l: 154.76 c: 156.055 v: 1180799 'n': 10408 vw: 156.545239 prevDailyBar: t: '2022-03-10T05:00:00Z' o: 160.23 h: 160.38 l: 155.98 c: 158.52 v: 1889292 'n': 17072 vw: 157.845202 TSLA: latestTrade: t: '2022-03-11T19:08:59.479520429Z' x: V p: 796.95 s: 100 c: - '@' i: 13647 z: C latestQuote: t: '2022-03-11T19:09:06.159593323Z' ax: V ap: 850 as: 1 bx: V bp: 796.49 bs: 1 c: - R z: C minuteBar: t: '2022-03-11T19:08:00Z' o: 796.78 h: 797.4 l: 796.78 c: 796.95 v: 2139 'n': 46 vw: 797.116889 dailyBar: t: '2022-03-11T05:00:00Z' o: 840.38 h: 843.055 l: 795.33 c: 796.95 v: 466980 'n': 13232 vw: 811.369454 prevDailyBar: t: '2022-03-10T05:00:00Z' o: 851.5 h: 853.355 l: 810.76 c: 838.21 v: 578475 'n': 16118 vw: 828.766436 Quote: title: Quote type: object description: | The Quotes API provides NBBO quotes for a given ticker symbol at a specified date. x-examples: example-1: t: '2022-03-11T13:13:49.975594385Z' ax: V ap: 18696.3338 as: 1 bx: V bp: 0 bs: 0 c: - R z: C example-crypto: t: '2022-03-21T05:00:00.011543552Z' x: FTXU bp: 40761.35 bs: 0.465 ap: 41007.66 as: 2.8675 properties: t: type: string description: Timestamp in RFC-3339 format with nanosecond precision format: date-time ax: type: string description: ask exchange (Stock quote only) ap: type: number description: | ask price as: type: number description: | ask size bx: type: string description: bid exchange (Stock quote only) bp: type: number description: | bid price bs: description: bid size type: number c: type: array description: quote conditions (Stock quotes only) items: type: string x: type: string description: Exchange (Crypto quote Only) z: type: string description: Tape (Stock quote only) required: - t QuotesResponse: description: | The Quotes API provides NBBO quotes for a given ticker symbol at a specified date. type: object x-examples: quotesResponse-example-1: quotes: - t: '2022-02-01T09:00:00.000448Z' ax: K ap: 175 as: 1 bx: Q bp: 174.96 bs: 4 c: - R z: C - t: '2022-02-01T09:00:00.000448Z' ax: K ap: 175 as: 12 bx: Q bp: 174.96 bs: 4 c: - R z: C symbol: AAPL next_page_token: QUFQTHwyMDIyLTAyLTAxVDA5OjAwOjAwLjAwMDQ0ODAwMFp8MzFDODgxNkY= no-data-found-example: quotes: null symbol: AAPL next_page_token: null title: QuotesResponse properties: quotes: type: array uniqueItems: true minItems: 1 nullable: true items: $ref: '#/components/schemas/Quote' symbol: type: string minLength: 1 example: AAPL next_page_token: type: string minLength: 1 nullable: true required: - quotes - symbol LatestQuoteResponse: description: |- A model representing the result of hitting the Latest Quote api. Represents a single Quote that should be the latest quote data for a given ticker symbol type: object x-examples: quotesResponse-example-1: symbol: AAPL quote: t: '2022-02-01T17:51:03.204726425Z' ax: V ap: 173.24 as: 4 bx: V bp: 173.21 bs: 4 c: - R z: C title: LatestQuotesResponse properties: quote: $ref: '#/components/schemas/Quote' symbol: type: string minLength: 1 example: AAPL required: - quote - symbol MultiQuotesReponse: title: MultiQuotesReponse type: object description: | A model representing the result of hitting the Multi Quotes api; represents multiple Quotes for multiple symbols. Returned results are sorted by symbol first then by Quote timestamp. This means that you are likely to see only one symbol in your first response if there are enough Quotes for that symbol to hit the limit you requested on that request. In these situations if you keep requesting again with the next_page_token you will eventually reach the next symbols if any Quotes were found for them. x-examples: multiQuotesResponse-example-1: quotes: AAPL: - t: '2022-02-01T09:00:00.000448Z' ax: K ap: 175 as: 1 bx: Q bp: 174.96 bs: 4 c: - R z: C next_page_token: QUFQTHwyMDIyLTAyLTAxVDA5OjAwOjAwLjAwMDQ0ODAwMFp8MjIzMEUxOUM= multiTradesResponse-with-multiple-symbols-at-once-example-1: quotes: AAPL: - t: '2022-02-01T09:00:00.000448Z' ax: K ap: 175 as: 1 bx: Q bp: 174.96 bs: 4 c: - R z: C GOOGL: - t: '2022-02-01T09:00:00.000448Z' ax: K ap: 175 as: 1 bx: Q bp: 175 bs: 4 c: - R z: C next_page_token: QUFQTHwyMDIyLTAyLTAxVDA5OjAwOjAwLjAwMDQ0ODAwMFp8MjIzMEUxOUM= properties: quotes: type: object additionalProperties: type: array items: $ref: '#/components/schemas/Quote' next_page_token: type: string description: pass this token with your request again to get the next page of results nullable: true required: - quotes LatestMultiQuotesResponse: description: '' type: object x-examples: example-crypto: quotes: ETHUSD: t: '2022-03-08T22:40:52.536436224Z' x: FTXU bp: 2562.99 bs: 23.798 ap: 2579.11 as: 22.155 BTCUSD: t: '2022-03-08T22:40:52.662990848Z' x: FTXU bp: 38465.26 bs: 2.641 ap: 38698.75 as: 1.3746 example-1: quotes: AAPL: t: '2022-03-11T18:40:13.514830169Z' ax: V ap: 156.47 as: 3 bx: V bp: 156.45 bs: 1 c: - R z: C TSLA: t: '2022-03-11T18:40:12.416216587Z' ax: V ap: 850 as: 1 bx: V bp: 798 bs: 2 c: - R z: C properties: quotes: type: object additionalProperties: $ref: '#/components/schemas/Quote' required: - quotes Bar: title: Bar type: object description: | The bars API returns aggregate historical data for the requested securities. x-examples: stock-example-1: t: '2022-03-10T19:26:00Z' o: 158.035 h: 158.21 l: 158.035 c: 158.21 v: 800 'n': 15 vw: 158.113144 crypto-example-1: t: '2022-03-10T19:30:00Z' x: FTXU o: 39284 h: 39284 l: 39200 c: 39200 v: 1.1271 'n': 9 vw: 39233.9329252063 properties: t: type: string description: Timestamp in RFC-3339 format with nanosecond precision. format: date-time x: type: string description: Exchange. Only present on Bars for Crypto symbols enum: - FTXU - ERSX - CBSE o: type: number description: Open price h: type: number description: High price. l: type: number description: | Low price. c: type: number description: Close price. v: description: Volume. type: number 'n': type: integer description: Number of trades. format: int64 vw: description: Volume weighted average price. type: number required: - t - o - h - l - c - v BarsResponse: description: '' type: object x-examples: barsResponse-stock-example-1: bars: - t: '2021-02-01T16:01:00Z' o: 133.32 h: 133.74 l: 133.31 c: 133.5 v: 9876 - t: '2021-02-01T16:02:00Z' o: 133.5 h: 133.58 l: 133.44 c: 133.58 v: 3567 symbol: AAPL next_page_token: MjAyMS0wMi0wMVQxNDowMjowMFo7MQ== barsResponse-crypto-example-1: bars: - t: '2022-03-10T06:00:00Z' x: CBSE o: 39230.55 h: 40302.06 l: 38560.85 c: 39259.91 v: 11328.17046589 'n': 353132 vw: 39208.3129673941 - t: '2022-03-10T06:00:00Z' x: ERSX o: 39246.4 h: 40151 l: 38791 c: 39270 v: 153.254034 'n': 230 vw: 39255.8594375793 - t: '2022-03-10T06:00:00Z' x: FTXU o: 39170 h: 40290 l: 38560 c: 39200 v: 1511.2828 'n': 5248 vw: 39214.2388224758 symbol: BTCUSD next_page_token: null title: BarsResponse properties: bars: type: array uniqueItems: true minItems: 1 description: The array of Bar data items: $ref: '#/components/schemas/Bar' symbol: type: string minLength: 1 example: AAPL description: the stock ticker or crypto symbol this set of bar data is for next_page_token: type: string minLength: 1 nullable: true required: - bars - symbol - next_page_token LatestBarResponse: description: |- A model representing the result of hitting one of the Latest Bar api endpoints. Represents a single Bar that should be the latest Bar data for a given ticker symbol type: object x-examples: crypto-example-1: symbol: BTCUSD bar: t: '2022-03-08T21:05:00Z' x: FTXU o: 38576 h: 38576 l: 38576 c: 38576 v: 0.063 'n': 1 vw: 38576 stock-example-1: symbol: AAPL bar: t: '2022-03-10T19:26:00Z' o: 158.035 h: 158.21 l: 158.035 c: 158.21 v: 800 'n': 15 vw: 158.113144 properties: symbol: type: string minLength: 1 bar: $ref: '#/components/schemas/Bar' required: - symbol - bar MultiBarsResponse: description: | A model representing the result of hitting the Multi Bars api; represents multiple Bars for multiple symbols. Returned results are sorted by symbol first then by Bar timestamp. This means that you are likely to see only one symbol in your first response if there are enough Bars in the duration you specified for that symbol to hit the limit you requested on that request. In these situations if you keep requesting again with the next_page_token you will eventually reach the next symbols if any Bars were found for them in the timeframe. type: object x-examples: multiBarsResponse-with-multiple-symbols-at-once-example-1: bars: AAPL: - t: '2022-02-01T09:04:00Z' o: 175.14 h: 175.16 l: 175.12 c: 175.16 v: 1395 'n': 61 vw: 175.174624 - t: '2022-02-01T09:05:00Z' o: 175.21 h: 175.21 l: 175.1 c: 175.13 v: 1821 'n': 61 vw: 175.143635 TSLA: - t: '2022-02-01T09:05:00Z' o: 944.99 h: 944.99 l: 944.99 c: 944.99 v: 2520 'n': 207 vw: 944.437393 next_page_token: null multiBarsResponse-with-page-token-example-1: bars: BTCUSD: - t: '2022-02-28T06:00:00Z' x: FTXU o: 37866 h: 44340 l: 37494 c: 43241 v: 2817.008 'n': 10116 vw: 40876.4518611946 next_page_token: QlRDVVNEfER8MjAyMi0wMi0yOFQwNjowMDowMC4wMDAwMDAwMDBafEZUWFU= title: MultiBarsResponse properties: bars: type: object additionalProperties: type: array items: $ref: '#/components/schemas/Bar' next_page_token: type: string nullable: true required: - bars LatestMultiBarsResponse: title: LatestMultiBarsResponse type: object x-examples: example-1: bars: LINKUSD: t: '2022-03-08T17:33:00Z' x: FTXU o: 13.3565 h: 13.3565 l: 13.3565 c: 13.3565 v: 41.4 'n': 1 vw: 13.3565 BTCUSD: t: '2022-03-08T17:40:00Z' x: FTXU o: 39055 h: 39055 l: 39055 c: 39055 v: 0.1 'n': 1 vw: 39055 description: | A model representing the result of hitting the Latest Multi Bars api; represents the latest Bars for multiple symbols. properties: bars: type: object additionalProperties: $ref: '#/components/schemas/Bar' required: - bars News: description: Model representing a news article from the Alpaca Market Data API type: object x-examples: news-example-1: id: 24803233 headline: Benzinga's Top 5 Articles For 2021 — Or 'Who Let The Dog Out?' author: Sue Strachan created_at: '2021-12-29T15:11:03Z' updated_at: '2021-12-30T20:37:41Z' summary: '2021 may have been the Year of the Ox in the Chinese calendar, but for Benzinga, it was the Year of the Dog, or should we say, Year of the Dogecoin (CRYPTO: DOGE).' content: "

2021 may have been the Year of the Ox in the Chinese calendar, but for Benzinga, it was the Year of the Dog, or should we say, Year of the Dogecoin (CRYPTO: DOGE).

\r\n\r\n

The memecoin created in 2013...." url: 'https://www.benzinga.com/news/21/12/24843171/apple-leader-in-phone-sales-in-china-for-second-straight-month-in-november-with-23-6-share-according' images: - size: large url: 'https://cdn.benzinga.com/files/imagecache/2048x1536xUP/images/story/2012/doge_12.jpg' - size: small url: 'https://cdn.benzinga.com/files/imagecache/1024x768xUP/images/story/2012/doge_12.jpg' - size: thumb url: 'https://cdn.benzinga.com/files/imagecache/250x187xUP/images/story/2012/doge_12.jpg' symbols: - AMZN - BTCUSD - COIN - DOGEUSD - SPCE - TSLA - TWTR source: benzinga properties: id: type: integer format: int64 description: News article ID headline: type: string minLength: 1 description: Headline or title of the article author: type: string minLength: 1 description: Original author of news article created_at: type: string format: date-time description: Date article was created (RFC 3339) updated_at: type: string format: date-time description: Date article was updated (RFC 3339) summary: type: string minLength: 1 description: Summary text for the article (may be first sentence of content) content: type: string minLength: 1 description: Content of the news article (might contain HTML) url: type: string format: uri description: URL of article (if applicable) nullable: true images: type: array uniqueItems: true description: List of images (URLs) related to given article (may be empty) items: $ref: '#/components/schemas/NewsImage' symbols: type: array description: List of related or mentioned symbols items: type: string source: type: string minLength: 1 description: Source where the news originated from (e.g. Benzinga) required: - id - headline - author - created_at - updated_at - summary - content - images - symbols - source NewsImage: description: A model representing images for news article. simply a url to the image along with a size parameter suggesting the display size of the image type: object x-examples: newsimage-example-1: size: thumb url: 'https://cdn.benzinga.com/files/imagecache/250x187xUP/images/story/2012/doge_12.jpg' title: NewsImage properties: size: type: string minLength: 1 description: 'Possible values for size are thumb, small and large.' example: thumb enum: - thumb - small - large readOnly: true url: type: string minLength: 1 description: url to image from news article format: uri readOnly: true required: - size - url GetNewsResponse: title: GetNewsResponse type: object properties: news: type: array items: $ref: '#/components/schemas/News' next_page_token: type: string description: Pagination token for next page XBBO: description: XBBO or Cross Best Bid and Offer represents the Best Bid and Offer for an exchange type: object x-examples: example-1: t: '2022-02-01T20:21:03.323000342Z' ax: FTXU ap: 38529 as: 0.0688 bx: ERSX bp: 38534 bs: 1.5 properties: t: type: string format: date-time description: Timestamp in RFC-3339 format with nanosecond precision. ax: type: string minLength: 1 description: Ask exchange. ap: type: number description: Ask price. as: type: number description: Ask size. bx: type: string minLength: 1 description: Bid exchange. bp: type: number description: Bid price. bs: type: number description: Bid size. required: - t - ax - ap - as - bx - bp - bs title: XBBO LatestXBBOResponse: description: Represents the Latest XBBO for a crypto symbol that calculates the Best Bid and Offer across multiple exchanges. type: object x-examples: example-1: symbol: BTCUSD xbbo: t: '2022-02-01T20:21:03.323000342Z' ax: FTXU ap: 38529 as: 0.0688 bx: ERSX bp: 38534 bs: 1.5 properties: symbol: type: string minLength: 1 xbbo: $ref: '#/components/schemas/XBBO' required: - symbol - xbbo title: LatestXBBOResponse LatestMultiXBBOResponse: description: '' type: object x-examples: example-1: xbbos: BTCUSD: t: '2022-03-08T22:59:49.514811056Z' ax: ERSX ap: 38556.7 as: 1.556151 bx: FTXU bp: 38562 bs: 2.5781 properties: xbbos: type: object additionalProperties: $ref: '#/components/schemas/XBBO' required: - xbbos CryptoSpreadsResponse: description: '' type: object x-examples: example-1: spreads: ERSX: 30 FTXU: 30 properties: spreads: type: object additionalProperties: type: integer required: - spreads MarketMoversResponse: title: MarketMovers type: object description: 'Contains list of market movers ' x-internal: true x-examples: example-1: gainers: - symbol: AAPL percent_change: 10 change: 0.1 price: 150.23 losers: - symbol: TSLA percent_change: 15 change: 0.15 price: 220.24 market_type: stocks last_updated: '2022-01-14T20:46:00.392227' properties: gainers: type: array description: List of top N gainers items: $ref: '#/components/schemas/MarketMoverAsset' losers: description: List of top N losers type: array items: $ref: '#/components/schemas/MarketMoverAsset' market_type: type: string enum: - stocks - crypto description: Market type (stocks or crypto) last_updated: type: string description: Time the movers where last computed required: - gainers - losers - market_type - last_updated MarketMoverAsset: title: MarketMoverAsset type: object description: Name or source of given news article x-examples: example-1: symbol: AGRI percent_change: 145.56 change: 2.46 price: 4.15 x-internal: true properties: symbol: type: string description: Symbol of market moving asset percent_change: type: number description: Percentage difference change for the day change: type: number description: Difference in change for the day price: type: number description: Current price of market moving asset required: - symbol - percent_change - change - price ExchangesResponse: title: ExchangesResponse type: object additionalProperties: type: string x-examples: example-1: Z: Cboe BZ I: International Securities Exchange M: Chicago Stock Exchange U: Members Exchange L: Long Term Stock Exchange W: CBOE X: NASDAQ OMX PSX B: NASDAQ OMX BX D: FINRA ADF J: Cboe EDGA P: NYSE Arca Q: NASDAQ OMX S: NASDAQ Small Cap V: IEX A: NYSE American (AMEX) E: Market Independent 'N': New York Stock Exchange T: NASDAQ Int 'Y': Cboe BYX C: National Stock Exchange H: MIAX K: Cboe EDGX description: Returns an object representing the exchanges we support. The keys are the short form codes you will see in our responses and the values are their respective full names. parameters: crypto-exchanges: name: exchanges in: query required: false schema: type: string example: 'ERSX,CBSE' description: 'A comma separated list of which crypto exchanges to pull the data from. Alpaca currently supports `ERSX`, `CBSE`, and `FTXU`' crypto-exchange: name: exchange in: query required: true schema: type: string enum: - ERSX - CBSE - FTXU example: ERSX description: 'Which crypto exchange to pull the data from. Alpaca currently supports `ERSX`, `CBSE`, and `FTXU`' crypto-symbols: name: symbols in: query required: true schema: type: string example: 'BTCUSD,ETHUSD' description: 'The comma-separated list of crypto symbols to query for. Note, currently all crypto symbols must be appended with "USD", ie "BTCUSD,ETHUSD" would get both BTC and ETH' crypto-symbol: name: symbol in: path required: true schema: type: string example: BTCUSD description: 'The crypto symbol to query for. Note, currently all crypto symbols must be appended with "USD", ie "BTCUSD" would be how you query for BTC.' timeframe: name: timeframe in: query required: true schema: type: string description: 'Timeframe for the aggregation. Values are customizeable, frequently used examples: 1Min, 15Min, 1Hour, 1Day. Limits: 1Min-59Min, 1Hour-23Hour.' page_token: name: page_token in: query required: false schema: type: string description: Pagination token to continue from. The value to pass here is returned in specific requests when more data is available than the request limit allows. start: name: start in: query required: false schema: type: string format: date-time example: '2021-01-01T00:00:00Z' description: Filter data equal to or after this time in RFC-3339 format. Fractions of a second are not accepted. end: name: end in: query required: false schema: type: string format: date-time example: '2021-01-01T00:00:00Z' description: Filter data equal to or before this time in RFC-3339 format. Fractions of a second are not accepted. limit: name: limit in: query required: false schema: type: integer minimum: 1 maximum: 10000 description: 'Number of data points to return. Must be in range 1-10000, defaults to 1000.' stock-symbol: name: symbol in: path required: true schema: type: string example: AAPL description: The stock ticker symbol to query for. feed: name: feed in: query required: false schema: type: string enum: - iex - sip - otc example: sip description: 'Which feed to pull market data from. This is either `iex`, `otc`, or `sip`. `sip` and `otc` are only available to those with a subscription' adjustment: name: adjustment in: query required: false schema: type: string enum: - raw - split - dividend - all description: specifies the corporate action adjustment(s) for bars data stock-symbols: name: symbols in: query required: true schema: type: string example: 'AAPL,TSLA' description: The comma-separated list of stock ticker symbols to query for. security: - API_Key: [] API_Secret: []