getFuturesOptions API

The getFuturesOptionsExpiration API provides last trade dates for options on futures contracts.

All APIs

Contact Us to Get Access

Inputs

root optional

A symbol or code that identifies an option root.

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

contract optional

A symbol or code that identifies an options contract.

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

symbols optional

A symbol or code that identifies an option. Multiple symbols separated by a comma may be used.

Type
list (A comma or semi-colon delimited string.) 
Example
ZCK210C,ZCK210P 

exchange optional

Exchange code for the marketplace where the financial instruments are listed.

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

type optional

The type of option desired, Call or Put.

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

expirationMonth optional

The numeric representation of the expiration month.

Type
int (A numeric type defining a whole number. (example: 2)) 
Example
11 

expirationDay optional

The numeric date for of the expiration day.

Type
int (A numeric type defining a whole number. (example: 2)) 
Example
17 

fields optional

Additional fields requested.

Type
list (A comma or semi-colon delimited string.) 
Example
premium,openInterest 

Outputs

Name / Requirement
Description
Type
symbol
always returned
A symbol or code that identifies the futures contract.
string
A sequence of characters. (example: GOOG)
root
always returned
The root symbol for the future.
string
A sequence of characters. (example: GOOG)
contract
always returned
The symbol for the futures contract.
string
A sequence of characters. (example: GOOG)
contractName
always returned
The name of the futures contract.
string
A sequence of characters. (example: GOOG)
contractMonth
always returned
The month code for this option's contract.
string
A sequence of characters. (example: GOOG)
exchange
always returned
The name of the exchange the instrument belongs to.
string
A sequence of characters. (example: GOOG)
type
always returned
Either Call or Put.
string
A sequence of characters. (example: GOOG)
strike
always returned
The option's strike price.
double
A numeric type defining a number with fractional parts. (example: 2.14)
expirationDate
always returned
The expiration date.
date
A date in the format of YYYY-MM-DD.
date
always returned
The price date.
date
A date in the format of YYYY-MM-DD.
impliedVolatility
always returned
The estimated volatility of a security's price.
double
A numeric type defining a number with fractional parts. (example: 2.14)
delta
always returned
The option's delta value.
double
A numeric type defining a number with fractional parts. (example: 2.14)
gamma
always returned
The option's gamma value.
double
A numeric type defining a number with fractional parts. (example: 2.14)
theta
always returned
The option's theta value.
double
A numeric type defining a number with fractional parts. (example: 2.14)
vega
always returned
The option's vega value.
double
A numeric type defining a number with fractional parts. (example: 2.14)
open
always returned
The opening (first) price for the session.
double
A numeric type defining a number with fractional parts. (example: 2.14)
high
always returned
The highest traded price for the session.
double
A numeric type defining a number with fractional parts. (example: 2.14)
low
always returned
The lowest traded price for the session.
double
A numeric type defining a number with fractional parts. (example: 2.14)
last
always returned
The last price the instrument traded.
double
A numeric type defining a number with fractional parts. (example: 2.14)
previousClose
always returned
The last price the instrument traded.
double
A numeric type defining a number with fractional parts. (example: 2.14)
change
always returned
The difference between the last traded price and the previous close.
double
A numeric type defining a number with fractional parts. (example: 2.14)
percentChange
always returned
The percent difference between the last traded price and the previous close.
double
A numeric type defining a number with fractional parts. (example: 2.14)
premium
as requested
The option's premium.
double
A numeric type defining a number with fractional parts. (example: 2.14)
flag
as requested
The option's settled flag.
string
A sequence of characters. (example: GOOG)
volume
always returned
The trade volume of the option.
integer
A numeric type defining a whole number. (example: 2)
openInterest
as requested
Open interest of the option
int
A numeric type defining a whole number. (example: 2)

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/getFuturesOptions.json?apikey=YOUR_API_KEY&root=ZC&contract=ZCN18&symbols=ZCK210C%2CZCK210P&exchange=CME&type=Call&fields=premium%2CopenInterest
Host: ondemand.websol.barchart.com

POST

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

apikey=YOUR_API_KEY&root=ZC&contract=ZCN18&symbols=ZCK210C%2CZCK210P&exchange=CME&type=Call&fields=premium%2CopenInterest

Response

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

XML

GET

GET https://ondemand.websol.barchart.com/getFuturesOptions.xml?apikey=YOUR_API_KEY&root=ZC&contract=ZCN18&symbols=ZCK210C%2CZCK210P&exchange=CME&type=Call&fields=premium%2CopenInterest
Host: ondemand.websol.barchart.com

POST

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

apikey=YOUR_API_KEY&root=ZC&contract=ZCN18&symbols=ZCK210C%2CZCK210P&exchange=CME&type=Call&fields=premium%2CopenInterest

Response


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

CSV

GET

GET https://ondemand.websol.barchart.com/getFuturesOptions.csv?apikey=YOUR_API_KEY&root=ZC&contract=ZCN18&symbols=ZCK210C%2CZCK210P&exchange=CME&type=Call&fields=premium%2CopenInterest
Host: ondemand.websol.barchart.com

POST

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

apikey=YOUR_API_KEY&root=ZC&contract=ZCN18&symbols=ZCK210C%2CZCK210P&exchange=CME&type=Call&fields=premium%2CopenInterest

Response




PHP

<?php

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

$params = [
    'apikey' => 'YOUR_API_KEY',
    'root' => 'ZC',
    'contract' => 'ZCN18',
    'symbols' => 'ZCK210C,ZCK210P',
    'exchange' => 'CME',
    'type' => 'Call',
    'fields' => 'premium,openInterest',
];

$result = $ondemand->getFuturesOptions($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.getFuturesOptions("YOUR_API_KEY", "ZC", "ZCN18", "ZCK210C,ZCK210P", "CME", "Call", "premium,openInterest")

Perl

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

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

my $result = $ondemand->getFuturesOptions('YOUR_API_KEY', 'ZC', 'ZCN18', 'ZCK210C,ZCK210P', 'CME', 'Call', 'premium,openInterest');

print $result;

Python

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

result = client.service.getFuturesOptions('YOUR_API_KEY', 'ZC', 'ZCN18', 'ZCK210C,ZCK210P', 'CME', 'Call', 'premium,openInterest')

print result

Ruby

require 'savon'

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

response = ondemand.call(
    :getFuturesOptions,
    message: {
        apikey: 'YOUR_API_KEY',
        root: 'ZC',
        contract: 'ZCN18',
        symbols: 'ZCK210C,ZCK210P',
        exchange: 'CME',
        type: 'Call',
        fields: 'premium,openInterest',
    }
)

response.body