Symbology

Historical.symbology.resolve

Resolve a list of symbols from an input symbology type, to an output symbology type.

Take, for example, a raw symbol to an instrument ID: ESM2 → 3403.

Parameters

Parameter
Type
Required
Description
dataset
Dataset or str
required
The dataset code (string identifier). Must be one of the values from list_datasets.
symbols
Iterable[str | int] or str or int
required
The symbols to resolve. Takes up to 2,000 symbols per request. Use 'ALL_SYMBOLS' to request all symbols (not available for every dataset).
stype_in
SType or str
required
The symbology type of input symbols. Must be one of 'raw_symbol', 'instrument_id', 'parent', or 'continuous'.
stype_out
SType or str
required
The symbology type of output symbols. Must be one of 'raw_symbol', 'instrument_id', 'parent', or 'continuous'. Must be a valid symbology combination with stype_in. See symbology combinations.
start_date
date or str
required
The inclusive UTC start date of the request range as a Python date or ISO 8601 date string.
end_date
date or str
optional
The exclusive UTC end date of the request range as a Python date or ISO 8601 date string. Defaults to the forward filled value of start based on the resolution provided.

Returns

dict[str, Any]

The results for the symbology resolution.

See also

For more information on symbology resolution, visit our symbology documentation.

Field
Type
Description
result
dict[str, list[dict[str, str]]
The symbology mapping result. For each requested symbol, a list of symbology mappings is provided.
symbols
list[str]
The requested symbols.
stype_in
str
The requested input symbology type.
stype_out
str
The requested output symbology type.
start_date
str
The requested symbology start date as an ISO 8601 date string.
end_date
str
The requested symbology end date as an ISO 8601 date string.
partial
list[str]
The list of symbols, if any, that partially resolved inside the start date and end date interval.
not_found
list[str]
The list of symbols, if any, that failed to resolve inside the start date and end date interval.
message
str
A short message indicating the overall symbology result. Can be one of: "OK", or "Partially resolved", or "Not found"
status
int
A numerical status field indicating the overall symbology result. Can be one of: 0 (OK), 1 (Partially resolved), or 2 (Not found).
API method
1
2
3
4
5
6
7
8
Historical.symbology.resolve(
    dataset: Dataset | str,
    symbols: Iterable[str | int] | str | int,
    stype_in: SType | str,
    stype_out: SType | str,
    start_date: date | str,
    end_date: date | str | None = None,
) -> dict[str, Any]
Example usage
1
2
3
4
5
6
7
8
9
10
11
12
13
import databento as db

client = db.Historical("$YOUR_API_KEY")

result = client.symbology.resolve(
    dataset="GLBX.MDP3",
    symbols=["ESM2"],
    stype_in="raw_symbol",
    stype_out="instrument_id",
    start_date="2022-06-01",
    end_date="2022-06-30",
)
print(result)
Example response
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
{
    "result": {
        "ESM2": [
            {
                "d0": "2022-06-01",
                "d1": "2022-06-26",
                "s": "3403"
            }
        ]
    },
    "symbols": [
        "ESM2"
    ],
    "stype_in": "raw_symbol",
    "stype_out": "instrument_id",
    "start_date": "2022-06-01",
    "end_date": "2022-06-30",
    "partial": [],
    "not_found": [],
    "message": "OK",
    "status": 0
}