> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-fix-nav-issues.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# How to import JSON into ClickHouse?

> This page shows you how to import JSON into ClickHouse

ClickHouse supports a wide range of [data formats for input and output](/reference/formats/index). There are multiple JSON variations among them, but the most commonly used for data ingestion is [JSONEachRow](/reference/formats/JSON/JSONEachRow). It expects one JSON object per row, each object separated by a newline.

<h2 id="examples">
  Examples
</h2>

Using [HTTP interface](/concepts/features/interfaces/http):

```bash theme={null}
$ echo '{"foo":"bar"}' | curl 'http://localhost:8123/?query=INSERT%20INTO%20test%20FORMAT%20JSONEachRow' --data-binary @-
```

Using [CLI interface](/concepts/features/interfaces/cli):

```bash theme={null}
$ echo '{"foo":"bar"}'  | clickhouse-client --query="INSERT INTO test FORMAT JSONEachRow"
```

Instead of inserting data manually, you might consider to use an [integration tool](/integrations/home) instead.

<h2 id="useful-settings">
  Useful settings
</h2>

* `input_format_skip_unknown_fields` allows to insert JSON even if there were additional fields not present in table schema (by discarding them).
* `input_format_import_nested_json` allows to insert nested JSON objects into columns of [Nested](/reference/data-types/nested-data-structures/index) type.

<Note>
  Settings are specified as `GET` parameters for the HTTP interface or as additional command-line arguments prefixed with `--` for the `CLI` interface.
</Note>
