> ## Documentation Index
> Fetch the complete documentation index at: https://kb.talostrading.com/llms.txt
> Use this file to discover all available pages before exploring further.

# ParallelDataCollection.exporttojsonfiles

```python theme={null}
coinmetrics._data_collection.ParallelDataCollection.export_to_json_files(
    data_directory=None,
    compress=False,
)
```

Export the parallelized request to a directory of JSON files, one file
per combination of the `parallelize_on` attribute of the parent
[`ParallelDataCollection`](https://kb.talostrading.com/coinmetrics/python-api-client/reference/parallel-data-collection).

Examples:

```default theme={null}
client.get_market_trades(
    "coinbase-eth-btc-spot,coinbase-eth-usdc-spot",
).parallel("markets").export_to_json_files()
```

produces:

```default theme={null}
./market-trades/coinbase-eth-btc-spot.json
./market-trades/coinbase-eth-usdc-spot.json
```

Layering a `time_increment` on top:

```default theme={null}
client.get_asset_metrics(
    "btc,eth", "ReferenceRateUSD",
    start_time="2024-01-01", limit_per_asset=1,
).parallel(
    "assets,metrics",
    time_increment=timedelta(days=1),
).export_to_json_files()
```

produces:

```default theme={null}
./asset-metrics/btc/ReferenceRateUSD/start_time=2024-01-01T00-00-00Z.json
./asset-metrics/eth/ReferenceRateUSD/start_time=2024-01-01T00-00-00Z.json
```

* **Parameters:**
  * **data\_directory** (*Optional* *\[*[*str*](https://docs.python.org/3/library/stdtypes.html#str) *]*) -- Path to the directory where files should be
    written. Defaults to the current working directory.
  * **compress** ([*bool*](https://docs.python.org/3/library/functions.html#bool)) -- Whether to gzip the resulting files.

**Returns:**

* None
