> For the complete documentation index, see [llms.txt](https://php-etl.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://php-etl.gitbook.io/docs/extractors/json.md).

# JSON

Extracts data from a JavaScript Object Notation file.

```php
$etl->extract('json', 'path/to/file.json', $options);
```

## Options

### Columns

Columns that will be extracted. If `null`, the first level key/value pairs of the object in each iteration will be used.

| Type  | Default value |
| ----- | ------------- |
| array | `null`        |

For more control over the columns, you may use JSON path:

```php
$options = ['columns' => [
    'id' => '$..bindings[*].id.value',
    'name' => '$..bindings[*].name.value',
]];
```
