menu
Data

Map Symbology with Security Master

error

Warning

Security Master is a Beta service and APIs are subject to change. Please contact GS Data Services if you are interested in finding out more.

A Security Master provides financial product reference data and is a foundational building block of any quantitative financial analytics engine. The core component of Goldman Sachs' Security Master is symbology, the data necessary to map from one identifier to another. Clients can retrieve this data via the GS Quant SDK.

info

Note

A subscription is needed to use the Security Master referenced in this guide. For further information, please contact GS Data Services.

Compatibility

Before running the examples in this guide, set source to be Security Master Service (defaults to Asset Service):

from gs_quant.markets.securities import SecurityMaster, SecurityMasterSource

SecurityMaster.set_source(SecurityMasterSource.SECURITY_MASTER)

Method availability varies by source:

MethodAsset ServiceSecurity Master
get_assetXX
get_identifiersX
get_all_identifiersX
map_identifiersXX

Querying

You can look up a security using any of the identifier types in Security Master (e.g. ric, bbid, cusip, sedol). Identifiers that refer to the same security will be returned, subject to licensing.

Milestoning

Identifiers are milestoned, such that the history of each identifier for a given security can be viewed. By default, data that is currently valid will be retrieved. However, users can specify an "as of" date to see identifier values that were in effect on a past date. (Other fields such as asset type and descriptive tags are not milestoned.)

info

Note

Examples require an initialized GsSession. Please refer to Sessions for details.

Get By Identifier

import datetime
from gs_quant.markets.securities import SecurityIdentifier, SecurityMaster

security = SecurityMaster.get_asset('GS UN', SecurityIdentifier.BBID, as_of=datetime.date(2021, 1, 5))
print(security)
print(security.get_identifiers())

Output:

{
    "name": "GOLDMAN SACHS GROUP INC (New York Stock)",
    "type": "Single Stock",
    "currency": "USD",
    "tags": [],
    "id": "GSPD901026E154",
    "assetClass": "Equity",
    "company": {
        "name": "Goldman Sachs Group Inc/The",
        "identifiers": {
            "gsCompanyId": 25998
        }
    },
    "product": {
        "name": "GOLDMAN SACHS GROUP INC",
        "identifiers": {
            "gsid": 901026
        }
    },
    "exchange": {
        "name": "New York Stock",
        "identifiers": {
            "gsExchangeId": 154
        }
    }
}

Output for identifiers at point in time (specified by the as_of parameter):

{
    "cusip": "38141G10",
    "ric": "GS",
    "isin": "US38141G1040",
    "ticker": "GS",
    "sedol": "2407966",
    "bbid": "GS UN"
}

Field Selection

If you want to ensure the response only contains the fields that you are interested in, you can use the fields parameter. Example:

import datetime
from gs_quant.markets.securities import SecurityIdentifier, SecurityMaster

fields = ['id', 'name', 'type', 'assetClass']
security = SecurityMaster.get_asset('GS UN', SecurityIdentifier.BBID, as_of=datetime.date(2021, 1, 5), fields=fields)
print(security)

Output:

{
    "name": "GOLDMAN SACHS GROUP INC (New York Stock)",
    "type": "Single Stock",
    "id": "GSPD901026E154",
    "assetClass": "Equity"
}

Bulk Identifier Queries

You can retrieve identifier history for multiple assets at a time. For example:

import datetime
from gs_quant.markets.securities import SecurityIdentifier, SecurityMaster

ids = ['CTLP UW', 'TSLA UW', 'FB UW']
as_of = datetime.datetime(2021, 6, 5)  # as-of-date used to map input IDs to assets
start = datetime.datetime(2000, 1, 5)  # get identifier entries with update time after this time
end = as_of  # get identifier entries with update time before this time
identifiers = SecurityMaster.get_identifiers(ids, SecurityIdentifier.BBID, as_of=as_of, start=start, end=end)
print(identifiers['CTLP UW'])

Output (note the ric and ticker changes for this asset):

[
  {
    "startDate": "2021-01-01",
    "endDate": "2021-04-18",
    "value": "USAT",
    "updateTime": "2021-04-18T18:36:18.443Z",
    "type": "ticker"
  },
  {
    "startDate": "2021-04-19",
    "endDate": "9999-99-99",
    "value": "CTLP",
    "updateTime": "2021-04-18T18:36:18.443Z",
    "type": "ticker"
  },
  {
    "startDate": "2021-01-01",
    "endDate": "2021-04-17",
    "type": "ric",
    "value": "USAT.OQ",
    "updateTime": "2021-04-18T14:54:47.406Z"
  },
  {
    "startDate": "2021-04-19",
    "endDate": "9999-99-99",
    "type": "ric",
    "value": "CTLP.OQ",
    "updateTime": "2021-04-19T00:20:57.3Z"
  }
]

To get identifiers for all stocks that you are subscribed to:

import datetime
from gs_quant.markets.securities import AssetType, SecurityMaster
from gs_quant.target.common import AssetClass

as_of = datetime.datetime(2021, 5, 1)
identifiers = SecurityMaster.get_all_identifiers(AssetClass.Equity, [AssetType.STOCK], as_of=as_of)

Mapping Between Identifiers

To map from one ID to other IDs for the same security, use the map_identifiers function. For example, if we have a security "GS UN" and want to find its CUSIP over a certain date range:

import datetime
from gs_quant.markets.securities import SecurityIdentifier, SecurityMaster

start = datetime.date(2021, 10, 11)
end = datetime.date(2021, 10, 15)
SecurityMaster.map_identifiers(SecurityIdentifier.BBID, ["GS UN"], [SecurityIdentifier.CUSIP], start, end)

Output:

{'2021-10-11': {'GS UN': {'cusip': '38141G104'}},
 '2021-10-12': {'GS UN': {'cusip': '38141G104'}},
 '2021-10-13': {'GS UN': {'cusip': '38141G104'}},
 '2021-10-14': {'GS UN': {'cusip': '38141G104'}},
 '2021-10-15': {'GS UN': {'cusip': '38141G104'}}}

This site is for informational purposes only and does not constitute an offer to sell, or the solicitation of an offer to buy, any security. The Goldman Sachs Marquee® platform is for institutional and professional clients only. Some of the services and products described on this site may not be available in certain jurisdictions or to certain types of client. Please contact your Goldman Sachs sales representative with any questions. Nothing on this site constitutes an offer, or an invitation to make an offer from Goldman Sachs to purchase or sell a product. This site is given for purely indicative purposes and does not create any contractual relationship between you and Goldman Sachs. Any market information contained on the site (including but not limited to pricing levels) is based on data available to Goldman Sachs at a given moment and may change from time to time. There is no representation that any transaction can or could have been effected on such terms or at such prices. Please see https://www.goldmansachs.com/disclaimer/sec-div-disclaimers-for-electronic-comms.html for additional information. © 2023 Goldman Sachs. All rights reserved.
Transaction Banking services are offered by Goldman Sachs Bank USA (“GS Bank”). GS Bank is a New York State chartered bank, a member of the Federal Reserve System and a Member FDIC. © 2023 Goldman Sachs. All rights reserved.
Not all products and functionality mentioned on this website are currently available through our API platform.
All loans and deposit products are provided by Goldman Sachs Bank USA, Salt Lake City Branch. Member FDIC.
Brokerage and investment advisory services offered by our investment products are provided by Goldman Sachs & Co. LLC (`‘GS&CO.`’), which is an SEC registered broker-dealer and investment adviser, and member FINRA/SIPC. Research our firm at FINRA's BrokerCheck. Custody and clearing services are provided by Apex Clearing Corporation, a registered broker-dealer and member FINRA/SIPC. Please consider your objectives before investing. A diversified portfolio does not ensure a profit or protect against a loss. Past performance does not guarantee future results. Investment outcomes and projections are forward-looking statements and hypothetical in nature. Neither this website nor any of its contents shall constitute an offer, solicitation, or advice to buy or sell securities in any jurisdictions where GS&Co. is not registered. Any information provided prior to opening an investment account is on the basis that it will not constitute investment advice and that GS&Co. is not a fiduciary to any person by reason of providing such information. For more information about our investment offerings, visit our Full Disclosures.
Investment products are: NOT FDIC INSURED ∙ NOT A DEPOSIT OR OTHER OBLIGATION OF, OR GUARANTEED BY, GOLDMAN SACHS BANK USA ∙ SUBJECT TO INVESTMENT RISKS, INCLUDING POSSIBLE LOSS OF THE PRINCIPAL AMOUNT INVESTED