Historical.metadata.list_fields

List all fields for a particular schema and encoding.

Parameters

Parameter
Type
Required
Description
schema
Schema or str
required
The data record schema. Must be one of the values from list_schemas.
encoding
Encoding or str
required
The data encoding. Must be one of 'dbn', 'csv', or 'json'. 'dbn' is recommended.
dataset
Dataset or str
optional
The dataset used to determine which fields are relevant. If None then the fields for the latest DBN encoding version are returned, which may differ from a specific dataset's schema.

Returns

list[dict[str, str]]

A list of field details objects.

Field
Type
Description
name
str
The field name.
type
str
The field data type.
API method
1
2
3
4
5
Historical.metadata.list_fields(
    schema: Schema | str,
    encoding: Encoding | str,
    dataset: Dataset | str | None = None,
) -> list[dict[str, str]]
Example usage
1
2
3
4
5
6
import databento as db

client = db.Historical("$YOUR_API_KEY")

fields = client.metadata.list_fields(schema="trades", encoding="dbn")
print(fields)
Example response
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
[
    {
        "name": "length",
        "type": "uint8_t"
    },
    {
        "name": "rtype",
        "type": "uint8_t"
    },
    {
        "name": "publisher_id",
        "type": "uint16_t"
    },
    {
        "name": "instrument_id",
        "type": "uint32_t"
    },
    {
        "name": "ts_event",
        "type": "uint64_t"
    },
    {
        "name": "price",
        "type": "int64_t"
    },
    {
        "name": "size",
        "type": "uint32_t"
    },
    {
        "name": "action",
        "type": "char"
    },
    {
        "name": "side",
        "type": "char"
    },
    {
        "name": "flags",
        "type": "uint8_t"
    },
    {
        "name": "depth",
        "type": "uint8_t"
    },
    {
        "name": "ts_recv",
        "type": "uint64_t"
    },
    {
        "name": "ts_in_delta",
        "type": "int32_t"
    },
    {
        "name": "sequence",
        "type": "uint32_t"
    }
]