Programming Interface

The Polstergeist extraction engine provides a simple mechanism whereby requests can be processed on behalf of external programs. The process involves dropping a request file into an input directory and then waiting for the results to appear in an output directory. Each service in our catalog (see the Request Tab), has an associated template that can be incorporated into your programs. You can view this template by clicking the right mouse button while positioned on a service item. A form is displayed showing the request template your program needs to generate, along with the corresponding response template that gets generated by the Polstergeist extraction engine.

We will walk through an example of creating and submitting a request from an external program  to get Stock Option quotes for American Express. The first step is to get the programming template from the service tree under the Request tab by right clicking the www.cboe.com (Options) service.

 

 

 

The request template can be copied to the clip board and then pasted into your program. Your program can then assign values for any input parameters required by the service; in this case we have added "AXP" as the Stock Symbol for which we wish to obtain option quotes.

<Request ServiceID="1cce8ce5-7f5e-41a0-af17-3fc00f4fdaa2">
   <Parameters>
      <Parameter Name="Stock Symbol" Value="AXP" />
   </Parameters>
</Request>

Your program might generate this template from inside a do loop and replace the Parameter Value attribute with a different Stock Symbol each time through the loop. To submit a request simply drop the generated xml into the polstergeist "C:\Program Files\Polstergeist\Data\Input\" directory under the filename of your choice. The extractor will process the request and place the resulting response file in the directory "C:\Program Files\Polstergeist\Data\Output\ and give it the same name as the corresponding input file. Your program can then poll the output directory at preset intervals to determine if the extraction job has completed. 

The following shows a partial view of the reponse file that was generated by the Data Extractor. The record element will be repeated multiple times for multi record responses. In this example there were actually eight records for various options expiring  in either June or July. 

- <Response>
- <Record>
  <Field Name="Calls" Value="08 Jun 40.00 (AXP FH-E)" />
  <Field Name="Call Bid" Value="4.80" />
  <Field Name="Call Ask" Value="5.10" />
  <Field Name="Call Volume" Value="0" />
  <Field Name="Call Open Interest" Value="39" />
  <Field Name="Puts" Value="08 Jun 40.00 (AXP RH-E)" />
  <Field Name="Put Bid" Value="0.25" />
  <Field Name="Put Ask" Value="0.30" />
  <Field Name="Put Volume" Value="238" />
  <Field Name="Put Open Interest" Value="7218" />
</Record> ...

NOTE: The extraction engine launches each external request on its own thread and then immediately begins scanning the input directory looking for additonal requests. This means you can drop several requests into the input directory at once and they will be processed in parallel.