Markit On Demand - Data APIs Version 2

Introduction

As part of its custom web hosting business, Markit On Demand, Inc sometimes provides web service APIs for it clients to use. The details of each service vary depending on the needs of each client and project, but they generally follow a similar format. The services can return data in either XML or JSON format, with an optional JSON-P wrapper. The data returned will be the same regardless of the format requested.

The following is a list of the service methods provided by this API.

General Format

Markit On Demand web services typically follow the "REST" model for web services. In simple terms, REST is a formal description of the HTTP protocol. Accessing a "REST" web service, therefore is merely a matter of making a standard HTTP request to a defined resource.

In some cases a SOAP Web Service API will be provided in addition to or instead of the REST API. In these cases, this document may not exactly reflect the method names and parameters expected by the SOAP API. In case of a discrepancy, please refer to the supplied WSDL file for the correct interface.

Except where otherwise specified, all of the web services described in this document are accessed by an HTTP GET request. HTTP POST requests are reserved for methods that change data on the server, e.g. updating a user's profile. Each request consists of a URI, and a list of parameters. The URI consists of a hostname and base path, a method name, and an optional format specifier. The parameters are appended to the URI on the query string.

Below is a sample request to a web service named "SampleRequest" in XML format.

http://example.markit.com/TestApi/SampleRequest/xml?count=3&echo=example

The "/xml" format specifier in the above request could be safely omitted, as XML is the default format. Other formats supported at the current time are JSON ("JavaScript Object Notation"), and JSONP. JSONP requests all require an additional parameter, named "jsoncallback". A sample response to the request shown above has the following type:

SampleResponse

Field Type Description
Echo String
SampleList SampleItem[]

SampleItem

Field Type Description
ItemNumber Int32

The XML response format consists of a sequence of elements representing Type names and Property names. Type names are used for the root node, and to identify individual items in a collection. An example XML representation of the SampleResponse object is shown below:

<SampleResponse> <Echo>example</Echo> <SampleList> <SampleItem> <ItemNumber>1</ItemNumber> </SampleItem> <SampleItem> <ItemNumber>2</ItemNumber> </SampleItem> <SampleItem> <ItemNumber>3</ItemNumber> </SampleItem> </SampleList> </SampleResponse>

The JSON response format does not include type information. A description of the JSON format can be found at http://json.org. It will not be described in this document. A sample JSON response is shown below (with white space added for readability):

{ "Echo": "example", "SampleList": [ { "ItemNumber": 1 }, { "ItemNumber": 2 }, { "ItemNumber": 3 } ] }

The JSONP response format is similar, with the addition of a callback method name.

mySampleCallbackName({ "Echo": "example", "SampleList": [ { "ItemNumber": 1 }, { "ItemNumber": 2 }, { "ItemNumber": 3 } ] })

Some API Methods require a User ID, whether to retrieve user specific information (e.g. Portfolio, Watchlist), or for permissions or accounting purposes (e.g. Real Time Quotes). These methods are denoted by an input of user_id, and optionally user_password or user_tier. Depending on the hosting arrangements and usage of the API, these parameters may need to be encrypted. If encryption is required, you will be supplied with an encryption spec document, sample code, and an encryption key from Markit On Demand.

API Functions

This section describes the API functions available through the API, their input and output parameters, and the possible errors. A "?" indicates a value is optional (for the request) or may be null (in the response). A "[ ]" indicates that the value is an array containing 0 or more instances of the specified type.

Lookup

http://dev.markitondemand.com/Api/v2/Lookup

The Lookup method requires the following input parameters

Field Type Description
input String A part of a company name or company symbol. The API will attempt to match a symbol, a partial symbol, and a partial name, in that order. The input string must be at the beginning of the symbol or one of the words in the name.

When successful, the Lookup method returns a serialized array of LookupResult objects.

LookupResult

Field Type Description
Symbol String The Symbol for this security in the ExchangeSymbol symbol set.
Name String The Name of the security.
Exchange String The Exchange code that the security trades on.

If an error occurs, the Lookup method returns a serialized Error object.

Error

Field Type Description
Message String If the inputs are not valid, the Message will contain a description of why the request could not proceed.

Quote

http://dev.markitondemand.com/Api/v2/Quote

The Quote method requires the following input parameters

Field Type Description
symbol String Ticker symbol

When successful, the Quote method returns a serialized StockQuote object.

StockQuote

Field Type Description
Status String Status of quote request
Name String Name of the company
Symbol String The company's ticker symbol
LastPrice Double The last price of the company's stock
Change Double The change in price of the company's stock since the previous trading day's close
ChangePercent Double The change percent in price of the company's stock since the previous trading day's close
Timestamp String The last time the company's stock was traded in exchange-local timezone. Represented as ddd MMM d HH:mm:ss UTCzzzzz yyyy
MSDate Double The last time the company's stock was traded in exchange-local timezone. Represented as an OLE Automation date
MarketCap Double The company's market cap
Volume Int32 The trade volume of the company's stock
ChangeYTD Double The change in price of the company's stock since the start of the year
ChangePercentYTD Double The change percent in price of the company's stock since the start of the year
High Double The high price of the company's stock in the trading session
Low Double The low price of the company's stock in the trading session
Open Double The opening price of the company's stock at the start of the trading session

If an error occurs, the Quote method returns a serialized Error object.

Error

Field Type Description
Message String If the inputs are not valid, the Message will contain a description of why the request could not proceed.

InteractiveChart

http://dev.markitondemand.com/Api/v2/InteractiveChart

The InteractiveChart method requires the following input parameters

Field Type Description
parameters String A JSON encoded InteractiveChartDataInput object

InteractiveChartDataInput

Field Type Description
Normalized Boolean Show data in price units (false) or percentages (true)
StartDate String Start date timestamp (formatted like 2011-03-01T00:00:00-00). Only valid for interday requests.
EndDate String End date timestamp (formatted like 2011-06-01T00:00:00-00). Only valid for interday requests.
EndOffsetDays Int32 Number of days back that chart should end. Defaults to 0 if not specified. May be used instead of EndDate for interday requests.
NumberOfDays Int32 Number of days that should be shown on the chart. Required for intraday requests. May be used instead of StartDate for interday requests. When dealing with intraday data, NumberOfDays represents the number of trading days shown. When dealing with interday requests, it represents the number of calendar days.
DataPeriod TimePeriod The type of data requested. Minute, Hour, Day, Week, Month, Quarter, Year
DataInterval Int32? For intraday data, specifies the number of periods between data points. e.g. if DataPeriod is Minute and DataInterval is 5, you will get a chart with five minute intervals. Must be 0 or null for interday charts
LabelPeriod TimePeriod The TimePeriod over which to create labels. Control how often you want labels by setting LabelInterval. Minute, Hour, Day, Week, Month, Quarter, Year
LabelInterval Int32? How many LabelPeriods to skip between labels. 1 is usually a safe default.
Elements Element[] An Array of 1 or more Elements.

Element

Field Type Description
Symbol String Symbol
Type ElementType Type of data requested. Options are "price", "volume", "sma" (Simple Moving Average).
Params Object[] Params vary for each Type. The following Types accept Params. For the other types, Params should be null or an empty array. "sma": [period], "price": ["ohlc"] for open/high/low/close, ["c"] for close only.

When successful, the InteractiveChart method returns a serialized InteractiveChartData object.

InteractiveChartData

Field Type Description
Labels Object X Axis label position, text, and dates. The "dates" are in Microsoft "OA Date" format. The "text" is an ISO timestamp.
Positions Object List of X coordinate positions for each data point returned, between 0 and 1.
Dates Object Dates corresponding to each position represented as ISO8601
Elements ElementData[] Chart coordinates and other data for each Element specified in the input "Elements" array.

ElementData

Field Type Description
Currency String
TimeStamp DateTime?
Symbol String
Type ElementType
DataSeries Object Y Axis Values of the specified Element, corresponding with the X Axis coordinates in the list of "Positions".

The InteractiveChart method does not define any error conditions.

Datatype Schemas

SampleResponse

<?xml version="1.0" encoding="utf-16"?> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <xsd:element name="SampleResponse"> <xsd:complexType> <xsd:sequence> <xsd:element name="Echo" type="xsd:string" /> <xsd:element name="SampleList"> <xsd:complexType> <xsd:choice minOccurs="0" maxOccurs="unbounded"> <xsd:element name="SampleItem"> <xsd:complexType> <xsd:sequence> <xsd:element name="ItemNumber" type="xsd:int" /> </xsd:sequence> </xsd:complexType> </xsd:element> </xsd:choice> </xsd:complexType> </xsd:element> </xsd:sequence> </xsd:complexType> </xsd:element> </xsd:schema>

LookupResult

<?xml version="1.0" encoding="utf-16"?> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <xsd:element name="LookupResult"> <xsd:complexType> <xsd:sequence> <xsd:element name="Symbol" type="xsd:string" /> <xsd:element name="Name" type="xsd:string" /> <xsd:element name="Exchange" type="xsd:string" /> </xsd:sequence> </xsd:complexType> </xsd:element> </xsd:schema>

Error

<?xml version="1.0" encoding="utf-16"?> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <xsd:element name="Error"> <xsd:complexType> <xsd:sequence> <xsd:element name="Message" type="xsd:string" /> </xsd:sequence> </xsd:complexType> </xsd:element> </xsd:schema>

StockQuote

<?xml version="1.0" encoding="utf-16"?> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <xsd:element name="StockQuote"> <xsd:complexType> <xsd:sequence> <xsd:element name="Status" type="xsd:string" /> <xsd:element name="Name" type="xsd:string" /> <xsd:element name="Symbol" type="xsd:string" /> <xsd:element name="LastPrice" type="xsd:double" /> <xsd:element name="Change" type="xsd:double" /> <xsd:element name="ChangePercent" type="xsd:double" /> <xsd:element name="Timestamp" type="xsd:string" /> <xsd:element name="MSDate" type="xsd:double" /> <xsd:element name="MarketCap" type="xsd:double" /> <xsd:element name="Volume" type="xsd:int" /> <xsd:element name="ChangeYTD" type="xsd:double" /> <xsd:element name="ChangePercentYTD" type="xsd:double" /> <xsd:element name="High" type="xsd:double" /> <xsd:element name="Low" type="xsd:double" /> <xsd:element name="Open" type="xsd:double" /> </xsd:sequence> </xsd:complexType> </xsd:element> </xsd:schema>

InteractiveChartDataInput

<?xml version="1.0" encoding="utf-16"?> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <xsd:element name="InteractiveChartDataInput"> <xsd:complexType> <xsd:sequence> <xsd:element name="Normalized" type="xsd:boolean" /> <xsd:element name="StartDate" type="xsd:string" /> <xsd:element name="EndDate" type="xsd:string" /> <xsd:element name="EndOffsetDays" type="xsd:int" /> <xsd:element name="NumberOfDays" type="xsd:int" /> <xsd:element name="DataPeriod" type="xsd:string" /> <xsd:element name="DataInterval" type="xsd:int" nillable="true" /> <xsd:element name="LabelPeriod" type="xsd:string" /> <xsd:element name="LabelInterval" type="xsd:int" nillable="true" /> <xsd:element name="Elements"> <xsd:complexType> <xsd:choice minOccurs="0" maxOccurs="unbounded"> <xsd:element name="Element"> <xsd:complexType> <xsd:sequence> <xsd:element name="Symbol" type="xsd:string" /> <xsd:element name="Type" type="xsd:string" /> <xsd:element name="Params"> <xsd:complexType> <xsd:choice minOccurs="0" maxOccurs="unbounded"> <xsd:element name="Object"> <xsd:complexType> <xsd:sequence /> </xsd:complexType> </xsd:element> </xsd:choice> </xsd:complexType> </xsd:element> </xsd:sequence> </xsd:complexType> </xsd:element> </xsd:choice> </xsd:complexType> </xsd:element> </xsd:sequence> </xsd:complexType> </xsd:element> </xsd:schema>

InteractiveChartData

<?xml version="1.0" encoding="utf-16"?> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <xsd:element name="InteractiveChartData"> <xsd:complexType> <xsd:sequence> <xsd:element name="Labels"> <xsd:complexType> <xsd:sequence /> </xsd:complexType> </xsd:element> <xsd:element name="Positions"> <xsd:complexType> <xsd:sequence /> </xsd:complexType> </xsd:element> <xsd:element name="Dates"> <xsd:complexType> <xsd:sequence /> </xsd:complexType> </xsd:element> <xsd:element name="Elements"> <xsd:complexType> <xsd:choice minOccurs="0" maxOccurs="unbounded"> <xsd:element name="ElementData"> <xsd:complexType> <xsd:sequence> <xsd:element name="Currency" type="xsd:string" /> <xsd:element name="TimeStamp" type="xsd:dateTime" nillable="true" /> <xsd:element name="Symbol" type="xsd:string" /> <xsd:element name="Type" type="xsd:string" /> <xsd:element name="DataSeries"> <xsd:complexType> <xsd:sequence /> </xsd:complexType> </xsd:element> </xsd:sequence> </xsd:complexType> </xsd:element> </xsd:choice> </xsd:complexType> </xsd:element> </xsd:sequence> </xsd:complexType> </xsd:element> </xsd:schema>