# JSON Extract Action

### JSON Extract Action (V2)

The **JSON Extract Action** node allows you to read and extract specific values from a JSON payload.\
It is typically used to process structured data returned by other nodes, such as [FFProbe as JSON Action](https://docs.helmut.de/helmut4-releases/helmut4-components/streamdesigner/nodes/actions/misc-21/ffprobe-as-json-action), [MediaInfo as JSON Action](https://docs.helmut.de/helmut4-releases/helmut4-components/streamdesigner/nodes/actions/file-and-folder-22/mediainfo-1/mediainfo-as-json-action), or any external REST API response.

Instead of handling the full JSON manually, this node lets you target a single value and reuse it later in the stream.

#### Input Parameters

**Payload**\
The complete JSON object from which the value should be extracted.

The payload can be provided:

* directly as JSON text
* via [{node.result.?}](https://docs.helmut.de/helmut4-releases/helmut4-components/streamdesigner/wildcards/result-or-return-wildcards-2/node-result)
* via [{stream.last\_result}](https://docs.helmut.de/helmut4-releases/helmut4-components/streamdesigner/wildcards/result-or-return-wildcards-2/stream-last_result)
* from a file using [{file.content.?}](https://docs.helmut.de/helmut4-releases/helmut4-components/streamdesigner/wildcards/file-related-wildcards-5/file-content)

> The payload must always be valid JSON.

<figure><img src="https://content.gitbook.com/content/cJYkTyk9qgh7aCR6dHIm/blobs/JkzeEHMJBHdXsRUAYCoP/image.png" alt="" width="350"><figcaption><p>JSON extract action</p></figcaption></figure>

<figure><img src="https://content.gitbook.com/content/cJYkTyk9qgh7aCR6dHIm/blobs/i7XlZFNmdIQh9YHhH5rh/image.png" alt="" width="375"><figcaption><p>JSON Extract Action node parameters</p></figcaption></figure>

**Key path**\
Defines which value inside the JSON structure should be read.

The path follows object navigation notation:

* Use `.` to access nested objects
* Use `[index]` to access array entries

Example:

```
audioTracks.numTracks
videoTracks.numTracks
markers.numMarkers
```

***

#### Output and Wildcards

The extracted value is returned as the node result and can be accessed using:

* [{stream.last\_result}](https://docs.helmut.de/helmut4-releases/helmut4-components/streamdesigner/wildcards/result-or-return-wildcards-2/stream-last_result)
* [{node.result.?}](https://docs.helmut.de/helmut4-releases/helmut4-components/streamdesigner/wildcards/result-or-return-wildcards-2/node-result)

***

#### Example

Given the following payload:

```json
{
  "frameSizeHorizontal": 1920,
  "frameSizeVertical": 1080,
  "audioTracks": {
    "numTracks": 8
  },
  "videoTracks": {
    "numTracks": 3
  }
}
```

If the **Key path** is:

```
frameSizeHorizontal
```

the node returns:

```
1920
```

If the **Key path** is:

```
audioTracks.numTracks
```

the node returns:

```
8
```

#### Using a JSON File

If the JSON exists only as a file, first reference its content as the payload:

```
{file.content./Volumes/myfiles/myfile.json}
```

The node will then parse the file and allow extraction using the defined key path.

#### Typical Use Cases

* reading resolution, duration, or codec data from FFProbe/MediaInfo output
* retrieving IDs returned by APIs
* extracting metadata from webhook responses
* obtaining track counts, frame rates, or markers from media analysis
* feeding extracted values into metadata fields or conditional logic

#### Practical Tip

This node becomes especially powerful when chained after an **HTTP Request Action**.\
A common workflow is:

API call → JSON Extract → Metadata / Rename / Routing

Instead of parsing the response manually in JavaScript, let this node do the structured extraction — it is faster, clearer, and far less error-prone.
