Available languages: [Python](https://databento.com/docs/api-historical/helpers/timeseries-get-range-to-file-params.python.md) · [C++](https://databento.com/docs/api-historical/helpers/timeseries-get-range-to-file-params.cpp.md) · [Rust](https://databento.com/docs/api-historical/helpers/timeseries-get-range-to-file-params.rust.md) · [HTTP](https://databento.com/docs/api-historical/helpers/timeseries-get-range-to-file-params.http.md)

Source: https://databento.com/docs/api-historical/helpers/timeseries-get-range-to-file-params


### GetRangeToFileParams

The parameter struct and builder for [HistoricalClient::timeseries::get_range_to_file](https://databento.com/docs/api-historical/timeseries/timeseries-get-range-to-file.md).

The builder can be instantiated with the associated function `builder()`, and the struct is created from the builder with the `build()` method.
For every field, there is an identically named setter method on the builder.

This struct can also be created from a [GetRangeParams](https://databento.com/docs/api-historical/helpers/timeseries-get-range-params.md) struct via the `GetRangeParams::with_path()` method.

#### API method

```rust
pub struct GetRangeToFileParams {
    pub dataset: String,
    pub symbols: Symbols,
    pub schema: Schema,
    pub date_time_range: DateTimeRange,
    pub stype_in: SType,
    pub stype_out: SType,
    pub limit: Option<NonZeroU64>,
    pub path: PathBuf,
}
```

#### Fields

| Parameter | Type | Description |
| `dataset` | String | The [dataset](https://databento.com/docs/api-historical/basics/datasets.md) code (string identifier). Must be one of the values from [list_datasets](https://databento.com/docs/api-historical/metadata/metadata-list-datasets.md). |
| `symbols` | Symbols | The product symbols to filter for. Takes up to 2,000 symbols per request. If `Symbols::All` then will select **all** symbols. |
| `schema` | Schema | The data record [schema](https://databento.com/docs/schemas/whats-a-schema.md). Must be one of the values from [list_schemas](https://databento.com/docs/api-historical/metadata/metadata-list-schemas.md). |
| `date_time_range` | DateTimeRange | The request range with an inclusive start and an exclusive end. Filters on `ts_recv` if it exists in the schema, otherwise `ts_event`. |
| `stype_in` | SType | The [symbology type](https://databento.com/docs/api-historical/basics/symbology.md) of input `symbols`. Defaults to `RawSymbol`. |
| `stype_out` | SType | The [symbology type](https://databento.com/docs/api-historical/basics/symbology.md) of output symbols. Defaults to `InstrumentId`. Must be a valid symbology combination with `stype_in`. See [symbology combinations](https://databento.com/docs/conventions/symbology.md#supported-symbology-combinations). |
| `limit` | Option\ | The maximum number of records to return. If `None` then no limit. Defaults to `None`. |
| `path` | PathBuf | The file path to persist the stream data to. |

#### Example usage

```rust
use std::path::PathBuf;

use databento::{
    dbn::{Dataset, SType, Schema, VersionUpgradePolicy},
    historical::timeseries::GetRangeToFileParams,
};
use time::macros::datetime;

assert_eq!(
    GetRangeToFileParams {
        dataset: Dataset::IfeuImpact.to_string(),
        date_time_range: (datetime!(2024-05-17 00:00 UTC)
            ..datetime!(2024-05-20 00:00 UTC))
            .into(),
        symbols: "BRN.OPT".into(),
        schema: Schema::Statistics,
        stype_in: SType::Parent,
        stype_out: SType::InstrumentId,
        limit: None,
        #[expect(deprecated)]
        upgrade_policy: None,
        path: PathBuf::from(
            "ifeu-impact.statistics.20240517.dbn.zst"
        ),
    },
    GetRangeToFileParams::builder()
        .dataset(Dataset::IfeuImpact)
        .symbols("BRN.OPT")
        .stype_in(SType::Parent)
        .date_time_range(
            datetime!(2024-05-17 00:00 UTC)
                ..datetime!(2024-05-20 00:00 UTC)
        )
        .schema(Schema::Statistics)
        .path("ifeu-impact.statistics.20240517.dbn.zst")
        .build()
);
```
