curl --request GET \
--url https://api.example.com/api/graph/v1/options/contracts/{contract_symbol}/barsimport requests
url = "https://api.example.com/api/graph/v1/options/contracts/{contract_symbol}/bars"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/api/graph/v1/options/contracts/{contract_symbol}/bars', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/graph/v1/options/contracts/{contract_symbol}/bars",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/graph/v1/options/contracts/{contract_symbol}/bars"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/api/graph/v1/options/contracts/{contract_symbol}/bars")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/graph/v1/options/contracts/{contract_symbol}/bars")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"symbol": "<string>",
"interval": "1m",
"period": "1d",
"candles": [
{
"time": "2023-11-07T05:31:56Z",
"open": 123,
"high": 123,
"low": 123,
"close": 123,
"volume": 123,
"id": "<string>",
"revision": 2,
"interval": "1m",
"finality": "forming",
"source_start": "2023-11-07T05:31:56Z",
"source_end": "2023-11-07T05:31:56Z",
"expected_minutes": 3,
"observed_minutes": 3,
"completeness": "complete",
"missing_minutes": [
"2023-11-07T05:31:56Z"
],
"source_revision": 2,
"ema9": 123,
"ema20": 123,
"sma50": 123,
"sma200": 123,
"vwap": 123,
"vw": 123
}
],
"warmup_count": 0,
"is_lookback": false,
"last_bar_time": "<string>",
"last_source_bar_time": "<string>",
"staleness_seconds": 123,
"data_status": "ok",
"source": "realtime_sip"
}Get one session of 1-minute option contract bars
Return real Alpaca 1-minute premium bars for one OCC contract.
curl --request GET \
--url https://api.example.com/api/graph/v1/options/contracts/{contract_symbol}/barsimport requests
url = "https://api.example.com/api/graph/v1/options/contracts/{contract_symbol}/bars"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/api/graph/v1/options/contracts/{contract_symbol}/bars', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/graph/v1/options/contracts/{contract_symbol}/bars",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/graph/v1/options/contracts/{contract_symbol}/bars"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/api/graph/v1/options/contracts/{contract_symbol}/bars")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/graph/v1/options/contracts/{contract_symbol}/bars")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"symbol": "<string>",
"interval": "1m",
"period": "1d",
"candles": [
{
"time": "2023-11-07T05:31:56Z",
"open": 123,
"high": 123,
"low": 123,
"close": 123,
"volume": 123,
"id": "<string>",
"revision": 2,
"interval": "1m",
"finality": "forming",
"source_start": "2023-11-07T05:31:56Z",
"source_end": "2023-11-07T05:31:56Z",
"expected_minutes": 3,
"observed_minutes": 3,
"completeness": "complete",
"missing_minutes": [
"2023-11-07T05:31:56Z"
],
"source_revision": 2,
"ema9": 123,
"ema20": 123,
"sma50": 123,
"sma200": 123,
"vwap": 123,
"vw": 123
}
],
"warmup_count": 0,
"is_lookback": false,
"last_bar_time": "<string>",
"last_source_bar_time": "<string>",
"staleness_seconds": 123,
"data_status": "ok",
"source": "realtime_sip"
}Path Parameters
Response
Option premium bars or an explicit no-data response
Response model for chart data.
Stock symbol
Candle interval
1m, 2m, 5m, 15m, 30m, 1h, 1d Time period
1d, 5d, 1m, 3m, 6m, 1y, 5y OHLCV candle data
Show child attributes
Show child attributes
Number of leading bars that are warmup data for indicator computation
True when the requested window contained no fresh data. When True with an empty candles array, the underlying data is stale (see staleness_seconds) and was intentionally withheld rather than silently served.
ISO timestamp of the most recent bar available for the symbol
ISO timestamp of the latest source minute included in the final returned candle. For rolled intraday candles this differs from bucket-start last_bar_time.
Seconds between now and the most recent bar available for the symbol. Populated whenever is_lookback is True; None for fresh responses.
High-level data status. 'ok' = fresh bars returned. 'stale' = no fresh bars in the requested window, refused on fail-closed policy (see staleness_seconds). 'no_data' = no bars available for this symbol at all.
ok, stale, no_data Market-data feed source label (entitlement layer). 'realtime_sip' = real-time SIP bars (entitled caller). 'delayed' = upper time bound clamped to now - 15m for non-entitled callers per SIP redistribution policy. 'byok' = served under the user's own Alpaca data entitlement.