Reference Guide - Product filters

From SRP API Docs

Revision as of 15:21, 2 February 2015 by Lee (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Product filters

To customize your product search results you can use filters.

Filters are a key/value pairs in the request URL where the key is the filter name and the value is the filter value.

Free value filters

Free value filters allow you to do an exact search by selected property. If filter allows multiple values then they must be comma (",") separated.

Available filters are:

Name Description Multi-value Type
id Unique product number yes string, 9 bytes, starting with ID prefix. E.g. ID0024721

Predefined value filters

Predefined value filters allow you to do an exact search by selected property where the value is equal to selected from predefined values.

All predefined values are specified in Product properties section.

Predefined value filters can have single or multiple values. Multiple values must be comma (",") separated.

Filter format:

?filter1Name=filter1Value&filter2Name=filter2Value1,filter2Value2

Available predefined value filters are:

Name Description Multi-value Possible values
class Specify the type of products yes, max 2 flow/non_flow/leverage
live Specify if a product is live or has expired no yes/no
provider Specify which company is issuing the product yes, max 15 Providers
provider_group Specify which group the provider belongs to yes, max 10 Provider groups
market Markets the product is linked to yes, max 10 Markets
wrapper Wrapper yes, max 20 Wrappers
category Product Category yes, max 3 Categories
style Product Style no tranche/continuous
payoff Payoff yes, max 20 Payoffs
distribution_channel Distribution Channel yes, max 3 Distribution channels
asset_class Asset class yes, max 5 Asset classes
wrapper_group Wrapper group yes, max 10 Wrapper groups
underlying Underlying yes, max 50 Underlyings
section Product section no current/continuous/leverage/flow/recent/maturing

Range value filters

Range value filters allow you to search by selected property where the value is in the selected range.

There are 4 scenarios where range filters can be used. Syntax differs depending on filter selected, as below:

  • Range From-To - when both lower limit and upper limit are specified. Returns products where property value is equal or greater than lower_limit and property value is equal or less than upper_limit:
filter_name=lower_limit,upper_limit
  • Range From - when only lower limit is specified. Returns products where property value is equal or greater than lower_limit:
filter_name=lower_limit,null
  • Range To - when only upper limit is specified. Returns products where property value is equal or less than upper_limit:
filter_name=null,upper_limit
  • Range Exact - when lower limit is equal to upper limit. Returns products where property value is equal to exact_value:
filter_name=exact_value

Date filters

Date property filters are Range filters.

All dates must be in ISO 8610 format (YYYY-MM-DD).

Available date filters are:

Name Description
initial_strike Initial strike Date
maturity Maturity Date
offer_close Offer Close date
offer_open Offer Open date
submitted Date the product has been added
updated Date the product has been updated last time

Sample date filters:

  • Products which mature in February 2012
maturity=2012-02-01,2012-02-29
  • Products which mature on 1st of February 2012 or later
maturity=2012-02-01,null
  • Products which mature on 1st of February 2012 or earlier
maturity=null,2012-02-01
  • Products which mature on 1st of February 2012
maturity=2012-02-01

Note for "updated" filter. Because internally this property is a datetime, filters should be applied the following way:

  • Products which were updated on the 1st of May 2013
updated=2013-05-01,2013-05-02
  • Products which were updated on the 1st of May 2013 or later
updated=2013-05-01,null
  • Products which were updated on the 1st of May 2013 or earlier
updated=null,2013-05-02
  • Products which were updated before the 1st of May 2013
updated=null,2013-05-01

Number range filters

Number range filters:

Name Description Type
minimum_return Minimum Return, a percentage float

Sample number filters:

  • Products with minimum return between 75 and 100 percents inclusive
minimum_return=75,100
  • Products with minimum return equal to 100 percents or greater
minimum_return=100,null
  • Products with minimum return equal to 50 percents or less
minimum_return=null,50
  • Products with minimum return equal to 100 percents
minimum_return=100