Quotes
Get a real-time price quote for a stock.
Endpoint
Method
GET
Request Example
- HTTP
- NodeJS
- Python
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/candles/D/AAPL?from=2020-01-01&to=2020-12-31"
response = requests.request("GET", url)
print(response.text)
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
string
The company's ticker symbol. If no exchange is specified, by default a US exchange will be assumed. You may embed the exchange in the ticker symbol using the Yahoo Finance or TradingView formats. A company or securities identifier can also be used instead of a ticker symbol.
Ticker Formats: (
TICKER
,TICKER.EX
,EXCHANGE:TICKER
)Company Identifiers: (
CIK
,LEI
)Securities Identifiers: (
CUSIP
,SEDOL
,ISIN
,FIGI
)
52week
boolean
Enable the output of 52-week high and 52-week low data in the quote output. By default this parameter is
false
if omitted.
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 dollars (or the security's currency if different from dollars) compared to the closing price of the previous day.
changepct
array[number]
The difference in price in percent compared to the closing price of the previous day.
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.