Delayed Quotes
Retrieve the most recent available quote for a stock, based on the user's entitlements. This may include a 15-minute delayed quote or an end-of-day quote, depending on the plan or access level.
Endpoint
https://api.marketdata.app/v1/stocks/quotes/{symbol}/
Method
GET
Request Example
- HTTP
- NodeJS
- Python
- Go
fetch("https://api.marketdata.app/v1/stocks/quotes/AAPL/")
.then((res) => {
console.log(res);
})
.catch((err) => {
console.log(err);
});
import requests
url = "https://api.marketdata.app/v1/stocks/quotes/AAPL/"
response = requests.request("GET", url)
print(response.text)
import (
"fmt"
api "github.com/MarketDataApp/sdk-go"
)
func ExampleStockQuoteRequest() {
quotes, err := StockQuote().Symbol("AAPL").Get()
if err != nil {
fmt.Print(err)
return
}
for _, quote := range quotes {
fmt.Println(quote)
}
}
Response Example
{
"s": "ok",
"symbol": ["AAPL"],
"ask": [149.08],
"askSize": [200],
"bid": [149.07],
"bidSize": [600],
"mid": [149.07],
"last": [149.09],
"volume": [66959442],
"updated": [1663958092]
}
Request Parameters
- Required
- Optional
-
symbol
stringThe company's ticker symbol.
-
52week
booleanEnable the output of 52-week high and 52-week low data in the quote output. By default this parameter is
falseif omitted. -
extended
booleanControl the inclusion of extended hours data in the quote output. Defaults to
trueif 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
stringWill always be
okwhen 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 day. For example, a 3% change will be represented as 0.3.
- 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
extendedis omitted or set totrue. - When
extendedis 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
stringStatus will be
no_dataif no quote can be found for the symbol.
-
s
stringStatus will be
errorif the request produces an error response. -
errmsg
stringAn error message.