primate logo Primate Software, Inc.

 

Response Formats

last updated:  06/06/01

version: 1.0 

This is a description of the response formats available.

The response you receive will depend on the request that was made.  See the specific data request descriptions for exact examples.  In general, you will receive your <request_parameters> back in the format you choose.  There are three basic formats in which the requested data can be sent back to you - XML, Tab delimited, and comma separated values (CSV). 

  • In the request you send, you may specify which format you want the response to be in.  

  • You do this within the <response_format> tags by specifying either XML, Tab, or CSV (default is "XML" if not specified).

Response Compression

  • You can choose to have the responses sent to you as a zip file.  
  • You do this by specifying "zip" within the <resonse_compression> tags.  
  • The default compression selection is "none".

Example:
               <response_compression>zip</response_compression>

XML Format

With the XML format, the data will be sent with the same XML tags as specified in the <request_parameters>.

Example (Get Quotes):

  <?xml version="1.0" ?>
-             <primateresponse>
-                    <quotesresponse>
                             <symbol>IBM</symbol>
                             <quotedate>2001-06-04</quotedate>
                             <hi>120.125</hi>
                             <low>110.75</low>
                             <open>112.5</open>
                             <close>115.375</close>
                             <openinterest>1454595</openinterest>
                             <bid>112</bid>
                             < ask>121</ask>
                             <volume>365454</volume>
                             <client_marker>1</client_marker>
                 </quotesresponse>
          </primateresponse>

Important:  With the Tab and CSV formats, data will be returned with a carriage-return, line-feed (CRLF) at the end of each row.  You must factor that in when receiving responses.

Tab Format

  • The response format is returned with each data field being delimited by a Tab.  The end of each row has a CRLF (hard return).  

  • For example, the response for a GetQuotes request in the Tab format would be:

                Symbol(tab)QuoteDate(tab)Hi(tab)Lo(tab)Closing(tab)ClientMarker(crlf)

Example:

IBM 2001-06-04 110 99.75 105.125 1
T 2001-06-04 41.375 38.5 40.25 2
XON 2001-06-04 88 87.75 87.75

Comma Separated Values (CSV)

  • CSV, like Tab, will be returned with a CRLF.

  • Each field will be delimited by a comma (no spaces)

  • For example, the response for a GetQuotes request in CSV format would be:

                Symbol,QuoteDate,Hi,Lo,Closing,ClientMarker(crlf)

Example:

IBM,2001-06-04,110,99.75,105.125,1
T,2001-06-04,41.375,38.5,40.25,2
XON,2001-06-04,88,87.75,87.75,3