Bulk Quotes
Get a real-time price quote for a multiple stocks in a single API request.
The bulkquotes endpoint is designed to return hundreds of symbols at once or full market snapshots. Response times for less than 50 symbols will be quicker using the standard quotes endpoint and sending your requests in parallel.
Endpoint
https://api.marketdata.app/v1/stocks/bulkquotes/
Method
GET
Request Example
- HTTP
- NodeJS
- Python
- Go
fetch("https://api.marketdata.app/v1/stocks/bulkquotes/?symbols=AAPL,META,MSFT")
.then((res) => {
console.log(res);
})
.catch((err) => {
console.log(err);
});
import requests
url = "https://api.marketdata.app/v1/stocks/bulkquotes/?symbols=AAPL,META,MSFT"
response = requests.request("GET", url)
print(response.text)
import (
"fmt"
api "github.com/MarketDataApp/sdk-go"
)
func ExampleBulkStockQuotesRequest() {
symbols := []string{"AAPL", "META", "MSFT"}
quotes, err := BulkStockQuotes().Symbols(symbols).Get()
if err != nil {
fmt.Print(err)
return
}
for _, quote := range quotes {
fmt.Println(quote)
}
}
Response Example
{
"s": "ok",
"symbol": ["AAPL", "META", "MSFT"],
"ask": [187.67, 396.9, 407.0],
"askSize": [1, 6, 1],
"bid": [187.65, 396.8, 406.97],
"bidSize": [1, 3, 3],
"mid": [187.66, 396.85, 406.985],
"last": [187.65, 396.85, 407.0],
"change": [-4.079999999999984, -4.169999999999959, -2.7200000000000273],
"changepct": [-0.021279924894382643, -0.010398483866141239, -0.006638680074197078],
"volume": [55299411, 18344385, 29269513],
"updated": [1706650085, 1706650085, 1706650085]
}
Request Parameters
- Required
- Optional
-
symbols
string
The ticker symbols to return in the response, separated by commas. The symbols parameter may be omitted if the
snapshot
parameter is set to true.
-
snapshot
boolean
Returns a full market snapshot with quotes for all symbols when set to
true
. Thesymbols
parameter may be omitted if thesnapshot
parameter is set. -
extended
boolean
Control the inclusion of extended hours data in the quote output. Defaults to
true
if omitted.- When set to
true
, the most recent quote is always returned, without regard to whether the market is open for primary trading or extended hours trading. - When set to
false
, only quotes from the primary trading session are returned. When the market is closed or in extended hours, a historical quote from the last closing bell of the primary trading session is returned instead of an extended hours quote.
- When set to
Response Attributes
- Success
- No Data
- Error
-
s
string
Will always be
ok
when there is data for the symbol requested. -
symbol
array[string]
The symbol of the stock.
-
ask
array[number]
The ask price of the stock.
-
askSize
array[number]
The number of shares offered at the ask price.
-
bid
array[number]
The bid price.
-
bidSize
array[number]
The number of shares that may be sold at the bid price.
-
mid
array[number]
The midpoint price between the ask and the bid.
-
last
array[number]
The last price the stock traded at.
-
change
array[number]
The difference in price in currency units compared to the closing price of the previous primary trading session.
-
changepct
array[number]
The difference in price in percent, expressed as a decimal, compared to the closing price of the previous primary trading session. For example, a 3% change will be represented as 0.03.
- When the market is open for primary trading, change and changepct are always calculated using the last traded price and the last primary session close. When the market is closed or in extended hours, this criteria is also used as long as
extended
is omitted or set totrue
. - When
extended
is set tofalse
, and the market is closed or in extended hours, quotes from extended hours are not considered. The values for change and changepct will be calculated using the last two closing prices instead.
-
52weekHigh
array[number]
The 52-week high for the stock. This parameter is omitted unless the optional 52week request parameter is set to true.
-
52weekLow
array[number]
The 52-week low for the stock. This parameter is omitted unless the optional 52week request parameter is set to true.
-
volume
array[number]
The number of shares traded during the current session.
-
updated
array[date]
The date/time of the current stock quote.
-
s
string
Status will be
no_data
if no quote can be found for the symbol.
-
s
string
Status will be
error
if the request produces an error response. -
errmsg
string
An error message.
Bulk Stock Quotes Endpoint Pricing
The cost of using the bulk stock quotes API endpoint depends on the type of data feed you choose and your usage pattern. Here's a breakdown of the pricing:
Data Feed Type | Cost Basis | Credits Required per Unit |
---|---|---|
Real-Time Feed | Per stock symbol | 1 credit |
Cached Feed | Per API call | 1 credit |
Examples
-
Real-Time Feed Usage
- If you query quotes for 500 different stock symbols using the Real-Time Feed, it will cost you 500 credits.
-
Cached Feed Usage
- A single API call to retrieve quotes for 500 different stock symbols using the Cached Feed will cost you 1 credit.