security

get one or more metrics for one or more securities

get one or more metrics for one or more securities

get/security/{type}

Request

Query parameters

namestring
Example:MQUSTB20

Taken as an Exact name to find a resource by

namesstring
Example:MQUSTB20,MQUSTRAV

Taken as a comma delimited list of Exact names to find a list if resources by

idstring

single id to pull

idsstring
Example:abcd1234,wxyz4567

Taken as a comma delimited list of ids to pull. ignored if ?names is specified.

metricsstring

comma delimited list of metrics

securityfilterstring

a tiny query language that allows filtering securities by their metric values. For example, 'get all futures contracts with expiry < x and root == Y'.

This is not a row-level filter. This is intended for 'metadata' like metrics and not for metrics with many values, as the results could be surprising. For example, 'get me prices for this week for all stocks that have ever closed above 1000' will contain this weeks results, and those prices may be < 1000; however, given this filter, those stocks at one point closed > 1000.

Parenthesis and logicl ors between clauses are not currently supported. An arbitrary number of and clauses is supported, and or within a clause is supported, IE 'root = X or Y'

The supported value oeprators are '!=', '==', '>=', '<=', '<', '>'

The first parsed operator in each ^ seperated clause is used as the operator - no additional checking is performed, so something like ==<= will be parsed as "is equal to <=" which is probably not what you want (and is likely to return an empty result set).

The supported logical operators are '^' (and, since & conflicts with URL query args) and ',' (or)

When the target value is a list (contains ','), the only two valid operators are != and ==. IE you cannot use <=X,Y etc.

When the operator is '==' and the value is '*', it means "the security has this metric defined at least once" (ie, we don't care about the value, just that the row exists)

Examples -

futures_contract...&securityfilter=root==BTC,B6 - all contracts with root euql to BTC or B6

futures_contract...&securityfilter=root==BTC^expiry.merq>=2022-01-01T00:00:00 - all contracts with BTC root expiring in 2022 or later

futures_root...&securityfilter=cme_limit_scaling_factor!=1.0 - all roots with a special/custom scaling factor such as cents

It can also replace the names= parameter, e.g.,

futures_root...&securityfilter=name==A6,B6 - get the roots named either A6 or B6 (returns 2 records)

namespacestring

only return securities in this namespace

string date-time
OR
string date
OR
string

Start date for the results/computation

string date-time
OR
string date
OR
string

End date for the results/computation

format'csv'

choose csv (Default json)

as_ofstring

should be a date-time as a string; YYYY-mm-dd HH-mm-ss

view the database as_of a certain timestamp; data corrections that were backdated but inserted after this timestamp are ignored

sincestring

should be a date-time as a string; YYYY-mm-dd HH-mm-ss

view only data that was received since this timestamp. Note that because data could be corrected for previous days (eff_ts), this does not necessarily mean that eff_ts >= the since date. This will obtain data that was known about on or after the since date, but that data could be a correction for previous days.

rawboolean

only applies when format!=csv. Includes additional information about the raw security api records, such as the provider timestamp and the source of the data. This is an employee only feature.

show_full_historyboolean

Shows the full history of records including corrected records (that is, no max(prov_ts))). This is an employee only feature. Also implies raw=true automatically. NOTE, this breaks the typical unique index of id/eff_ts/metric because if there were corrections, the metric may have changed multiple times - the new unique index includes prov_ts in this case.

debug'true'

turns on debugging information by injecting a debug section at the top level

validated_onlyboolean

Only return records that have been validated by internal data quality system. Defaults to false

prefer_read_replicaboolean

Opt into replica/cache-tolerant reads. Defaults to false, which keeps DB reads on the writer and bypasses SecAPI full-query caches for stronger read-after-write consistency.

Response

ok

Example response

{
  "results": [
    {
      "id": "0000699a-fcd7-45d4-8ce4-064a4ffeced0",
      "metric": "Level",
      "source": "some_gcp_feed"
    }
  ]
}

Changes

No recorded changes to this operation across all 1 revision of this API.