Available languages: [Python](https://databento.com/docs/api-historical/helpers/dbn-store-iter.python.md) · [C++](https://databento.com/docs/api-historical/helpers/dbn-store-iter.cpp.md) · [Rust](https://databento.com/docs/api-historical/helpers/dbn-store-iter.rust.md) · [HTTP](https://databento.com/docs/api-historical/helpers/dbn-store-iter.http.md)

Source: https://databento.com/docs/api-historical/helpers/dbn-store-iter


### DBNStore.\_\_iter\_\_

Using [for](https://docs.python.org/3/reference/compound_stmts.html#the-for-statement); records will be iterated one at a time.
Iteration will stop when there are no more records in the `DBNStore` instance.

Refer to the [List of fields by schema](https://databento.com/docs/schemas/whats-a-schema.md) article for documentation on the fields contained with each record type.

#### API method

```python
DBNStore.__iter__() -> Iterator[DBNRecord]
```

#### Example usage

```python
import databento as db

client = db.Historical("$YOUR_API_KEY")

data = client.timeseries.get_range(
    dataset="GLBX.MDP3",
    symbols=["ESM2"],
    start="2022-06-06",
)

for trade in data:
    size = getattr(trade, "size", 0)
    if size >= 200:
        print(trade)
```
#### Example response

```plaintext
TradeMsg(ts_recv=1654524078342408839, pretty_ts_recv='2022-06-06T14:01:18.342408839Z', rtype=<RType.MBP_0: 0>, publisher_id=GLBX.MDP3.GLBX (1), instrument_id=3403, ts_event=1654524078339857609, pretty_ts_event='2022-06-06T14:01:18.339857609Z', action='T', side='B', depth=0, price=4164000000000, pretty_price=4164, size=291, flags=0, ts_in_delta=20352, sequence=3605032)
TradeMsg(ts_recv=1654524133737794739, pretty_ts_recv='2022-06-06T14:02:13.737794739Z', rtype=<RType.MBP_0: 0>, publisher_id=GLBX.MDP3.GLBX (1), instrument_id=3403, ts_event=1654524133736900455, pretty_ts_event='2022-06-06T14:02:13.736900455Z', action='T', side='B', depth=0, price=4160000000000, pretty_price=4160, size=216, flags=0, ts_in_delta=28024, sequence=3659203)
TradeMsg(ts_recv=1654538295589900967, pretty_ts_recv='2022-06-06T17:58:15.589900967Z', rtype=<RType.MBP_0: 0>, publisher_id=GLBX.MDP3.GLBX (1), instrument_id=3403, ts_event=1654538295588752739, pretty_ts_event='2022-06-06T17:58:15.588752739Z', action='T', side='B', depth=0, price=4140000000000, pretty_price=4140, size=200, flags=0, ts_in_delta=21708, sequence=10031624)
```
