Available languages: [Python](https://databento.com/docs/api-live/helpers/metadata.python.md) · [C++](https://databento.com/docs/api-live/helpers/metadata.cpp.md) · [Rust](https://databento.com/docs/api-live/helpers/metadata.rust.md) · [Raw](https://databento.com/docs/api-live/helpers/metadata.raw.md)

Source: https://databento.com/docs/api-live/helpers/metadata


### Metadata

The contents of the [header of a DBN](https://databento.com/docs/conventions/databento-binary-encoding.md#metadata) stream.

#### API method

```cpp
struct MappingInterval {
  date::year_month_day start_date;
  date::year_month_day end_date;
  std::string symbol;
};

struct SymbolMapping {
  std::string raw_symbol;
  std::vector<MappingInterval> intervals;
};

struct Metadata {
  std::uint8_t version;
  std::string dataset;
  std::optional<Schema> schema;
  UnixNanos start;
  UnixNanos end;
  std::uint64_t limit;
  std::optional<SType> stype_in;
  SType stype_out;
  bool ts_out;
  std::size_t symbol_cstr_len;
  std::vector<std::string> symbols;
  std::vector<std::string> partial;
  std::vector<std::string> not_found;
  std::vector<SymbolMapping> mappings;
}
```

#### Fields

| Field | Type | Description |
| `version` | std::uint8_t | The DBN schema version. |
| `dataset` | std::string | The [dataset](https://databento.com/docs/api-historical/basics/datasets.md) code. |
| `schema` | std::optional\ | The data record [schema](https://databento.com/docs/schemas/whats-a-schema.md). Will be `nullopt` for live data which can mix schemas. |
| `start` | UnixNanos | The timestamp of the start of request time range (inclusive) expressed as the number nanoseconds since the [UNIX epoch](https://en.wikipedia.org/wiki/Unix_time). |
| `end` | UnixNanos | The timestamp of the end of request time range (exclusive) expressed as the number nanoseconds since the [UNIX epoch](https://en.wikipedia.org/wiki/Unix_time). |
| `limit` | std::uint64_t | The maximum number of records to return. |
| `stype_in` | std::optional\ | The [symbology type](https://databento.com/docs/api-historical/basics/symbology.md) of input `symbols`. Will be `nullopt` for live data. |
| `stype_out` | SType | The [symbology type](https://databento.com/docs/api-historical/basics/symbology.md) of output symbols. |
| `ts_out` | bool | Whether the stream contains live data with the send timestamps appended to every record. |
| `symbol_cstr_len` | std::size_t | The length of fixed-length symbol strings. |
| `symbols` | std::vector\ | The product symbols from the original request. |
| `partial` | std::vector\ | The symbols that did not resolve for _at least one day_ in the query time range. |
| `not_found` | std::vector\ | The symbols that did not resolve for _any_ day in the query time range. |
| `mappings` | std::vector\ | The symbol mappings for historical data. |
