Data
Map Symbology
Warning
The instructions below are no longer recommended. Please refer to the Map Symbology with Security Master documentation.
Asset Service provides the information needed to map from one identifier to another. Clients can retrieve this data via the GS Quant SDK.
Compatibility
Before running examples in this guide, ensure that source is set to Asset Service.
from gs_quant.markets.securities import SecurityMaster, SecurityMasterSource
SecurityMaster.set_source(SecurityMasterSource.ASSET_SERVICE)
Method availability varies by source:
Method | Asset Service | Security Master |
---|---|---|
get_asset | X | X |
get_identifiers | X | |
get_all_identifiers | X | |
map_identifiers | X | X |
Querying
You can look up a security using any of the identifier types in Asset Service (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 class are not milestoned.)
Note
Examples require an initialized GsSession. Please refer to Sessions for details.
Get By Identifier
import datetime
from gs_quant.markets.securities import AssetIdentifier, SecurityMaster
asset = SecurityMaster.get_asset('GS UN', AssetIdentifier.BLOOMBERG_ID, as_of=datetime.date(2021, 1, 5))
asset.get_identifiers()
Output:
{
'GSID': '901026',
'CUSIP': '38141G104',
'ISIN': 'US38141G1040',
'BBID': 'GS UN',
'RIC': 'GS.N',
'SEDOL': '2407966',
'TICKER': 'GS',
'BCID': 'GS US'
}
To spot check a few properties:
print(asset.name)
print(asset.exchange)
Output:
The Goldman Sachs Group, Inc.
NYSE
Mapping Between Identifiers
To map from one identifier of an asset to another identifier for the same asset, use the map_identifiers function. For example, if we know the BBID of an asset is "GS UN" and want to find the corresponding CUSIP on a given date:
import datetime
from gs_quant.markets.securities import SecurityIdentifier, SecurityMaster
as_of = datetime.date(2021, 10, 15)
SecurityMaster.map_identifiers(SecurityIdentifier.BBID, ["GS UN"], [SecurityIdentifier.CUSIP], as_of_date=as_of)
Output:
{
'2021-10-15': {
'GS UN': {
'cusip': '38141G104'
}
}
}
Was this page useful?
Give feedback to help us improve developer.gs.com and serve you better.