getEquityOptionsHistory API

Get historical prices for equity option.

All APIs

Contact Us to Get Access

Inputs

symbol required

Any valid equity options symbol.

Type
string (A sequence of characters. (example: GOOG)) 
Example
AAPL 

country optional

The country in which the options exchange is located. To help distinguish when requesting a dually listed instrument.

Type
string (A sequence of characters. (example: GOOG)) 
Example
US 
Default
US 

askbid optional

Boolean flag field to include ask and bid data in the result.

Type
boolean (A logical type representing the truth of a value as 'true' or 'false'.) 
Default

fields optional

Additional fields requested.

Type
list (A comma or semi-colon delimited string.) 
Example
settlement 

Outputs

Name / Requirement
Description
Type
symbol
always returned
A symbol or code that identifies a equities option.
string
A sequence of characters. (example: GOOG)
date
always returned
Price date
date
A date in the format of YYYY-MM-DD.
open
always returned
Opening price of the option
double
A numeric type defining a number with fractional parts. (example: 2.14)
high
always returned
High price of the option
double
A numeric type defining a number with fractional parts. (example: 2.14)
low
always returned
Low price of the option
double
A numeric type defining a number with fractional parts. (example: 2.14)
close
always returned
Closing price of the option
double
A numeric type defining a number with fractional parts. (example: 2.14)
volume
always returned
Volume of the equity option
double
A numeric type defining a number with fractional parts. (example: 2.14)
openInterest
always returned
Open Interest of the option
double
A numeric type defining a number with fractional parts. (example: 2.14)
trades
always returned
Number of trades for the option
double
A numeric type defining a number with fractional parts. (example: 2.14)
ask
always returned
Ask value for the option
double
A numeric type defining a number with fractional parts. (example: 2.14)
askSize
always returned
Ask size for the option
double
A numeric type defining a number with fractional parts. (example: 2.14)
bid
always returned
Bid value for the option
double
A numeric type defining a number with fractional parts. (example: 2.14)
bidSize
always returned
Bid size for the option
double
A numeric type defining a number with fractional parts. (example: 2.14)
settlement
as requested
The settlement price
double
A numeric type defining a number with fractional parts. (example: 2.14)

Status Code Responses

200
OK
Success
400
Bad Request
The request was invalid, please see the message for more information.
500
Internal Server Error
Something is not working correctly, please contact support.


JSON

GET

GET https://ondemand.websol.barchart.com/getEquityOptionsHistory.json?apikey=<YOUR API KEY>&symbol=AAPL&country=US&askbid=&fields=settlement
Host: ondemand.websol.barchart.com

POST

POST https://ondemand.websol.barchart.com/getEquityOptionsHistory.json
Host: ondemand.websol.barchart.com
Content-Type: application/x-www-form-urlencoded
Content-Length: length

apikey=<YOUR API KEY>&symbol=AAPL&country=US&askbid=&fields=settlement

Response

{
    "status": {
        "code": 204,
        "message": "Success, but no content to return."
    },
    "results": null
}

XML

GET

GET https://ondemand.websol.barchart.com/getEquityOptionsHistory.xml?apikey=<YOUR API KEY>&symbol=AAPL&country=US&askbid=&fields=settlement
Host: ondemand.websol.barchart.com

POST

POST https://ondemand.websol.barchart.com/getEquityOptionsHistory.xml
Host: ondemand.websol.barchart.com
Content-Type: application/x-www-form-urlencoded
Content-Length: length

apikey=<YOUR API KEY>&symbol=AAPL&country=US&askbid=&fields=settlement

Response


<?xml version="1.0" encoding="utf-8"?>
 <getEquityOptionsHistory>
  <status>
   <code>204</code>
   <message>Success, but no content to return.</message>
  </status>
 </getEquityOptionsHistory>

CSV

GET

GET https://ondemand.websol.barchart.com/getEquityOptionsHistory.csv?apikey=<YOUR API KEY>&symbol=AAPL&country=US&askbid=&fields=settlement
Host: ondemand.websol.barchart.com

POST

POST https://ondemand.websol.barchart.com/getEquityOptionsHistory.csv
Host: ondemand.websol.barchart.com
Content-Type: application/x-www-form-urlencoded
Content-Length: length

apikey=<YOUR API KEY>&symbol=AAPL&country=US&askbid=&fields=settlement

Response




PHP

<?php

$ondemand = new SoapClient('https://ondemand.websol.barchart.com/service?wsdl');

$params = [
    'symbol' => 'AAPL',
    'country' => 'US',
    'askbid' => '',
    'fields' => 'settlement',
];

$result = $ondemand->getEquityOptionsHistory($params);
var_dump($result);

Classic ASP

Dim ondemand
Dim result

Set ondemand = Server.CreateObject("MSSOAP.SoapClient30")
ondemand.ClientProperty("ServerHTTPRequest") = True
ondemand.MSSoapInit("https://ondemand.websol.barchart.com/service?wsdl")

Set result = ondemand.getEquityOptionsHistory("AAPL", "US", "", "settlement")

Perl

use SOAP::Lite;
use SOAP::WSDL;

my $ondemand = SOAP::Lite
    -> service('https://ondemand.websol.barchart.com/service?wsdl');

my $result = $ondemand->getEquityOptionsHistory('AAPL', 'US', '', 'settlement');

print $result;

Python

from suds.client import Client
ondemand = Client('https://ondemand.websol.barchart.com/service?wsdl')

result = client.service.getEquityOptionsHistory('AAPL', 'US', '', 'settlement')

print result

Ruby

require 'savon'

ondemand = Savon.client(wsdl: 'https://ondemand.websol.barchart.com/service?wsdl')

response = ondemand.call(
    :getEquityOptionsHistory,
    message: {
        symbol: 'AAPL',
        country: 'US',
        askbid: '',
        fields: 'settlement',
    }
)

response.body