Quotes
Get a real-time quote for an index.
Endpoint
https://api.marketdata.app/v1/indices/quotes/{symbol}/
Method
GET
Request Example
- HTTP
- NodeJS
- Python
- Go
fetch("https://api.marketdata.app/v1/indices/quotes/VIX/")
.then((res) => {
console.log(res);
})
.catch((err) => {
console.log(err);
});
import requests
url = "https://api.marketdata.app/v1/indices/quotes/VIX/"
response = requests.request("GET", url)
print(response.text)
import (
"fmt"
api "github.com/MarketDataApp/sdk-go"
)
func ExampleIndexQuoteRequest() {
vix, err := IndexQuotes().Symbol("VIX").Get()
if err != nil {
fmt.Println("Error retrieving VIX index candles:", err)
return
}
for _, quote := range vix {
fmt.Println(quote)
}
}
Response Example
{
"s": "ok",
"symbol": ["VIX"],
"last": [29.92],
"updated": [1664224409]
}
Request Parameters
- Required
- Optional
-
symbol
string
The index symbol, without any leading or trailing index identifiers. For example, use DJI do not use $DJI, ^DJI, .DJI, DJI.X, etc.
-
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 index.
-
last
array[number]
The last price of the index.
-
change
array[number]
The difference in price in dollars (or the index's native currency if different from dollars) compared to the closing price of the previous day.
-
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 30% change will be represented as 0.30.
-
52weekHigh
array[number]
The 52-week high for the index.
-
52weekLow
array[number]
The 52-week low for the index.
-
updated
array[date]
The date/time of the 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.