---
title: "writeJSON(to:options:)"
framework: tabulardata
role: symbol
role_heading: Instance Method
path: "tabulardata/dataframeprotocol/writejson(to:options:)"
---

# writeJSON(to:options:)

Creates a JSON file with the contents of the data frame.

## Declaration

```swift
func writeJSON(to url: URL, options: JSONWritingOptions = .init()) throws
```

## Parameters

- `url`: A location URL in the file system where the method saves the JSON file.
- `options`: A doc://com.apple.TabularData/documentation/TabularData/JSONWritingOptions instance.
