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

# JsonExtractString - ComfyUI Built-in Node Documentation

> The JsonExtractString node scans a text string for the first valid JSON object and extracts the value associated with a specific key, converted to a string.

The JsonExtractString node scans a text string for the first valid JSON object and extracts the value associated with a specific key, converted to a string. Any text before or after the JSON object is ignored, so the node also works on Markdown code blocks and on model replies that wrap the JSON in extra prose. If no valid JSON object is found, the key is not found, or the value is null, the node returns an empty string.

## Inputs

| Parameter | Description | Data Type | Required | Range |
| - | - | - | - | - |
| `json_string` | The text to search for a JSON object. This field supports multiline input and may contain surrounding prose or Markdown code fences. | STRING | Yes | N/A |
| `key` | The specific key whose value you want to extract from the JSON object. This field supports single-line input only. | STRING | Yes | N/A |

**Note:** The node extracts values only from JSON objects (dictionaries). It tries each `{` in the input in order and decodes from the first position that yields a valid JSON object, so leading or trailing text is skipped. If no JSON object can be decoded or the specified key does not exist within it, the output is an empty string. If the value associated with the key is `null`, the node also returns an empty string. Values that are not strings are returned as their string representation.

## Outputs

| Output Name | Description | Data Type |
| - | - | - |
| `output` | The string value extracted from the JSON for the specified key, or an empty string if the extraction fails. | STRING |

> This documentation was AI-generated. If you find any errors or have suggestions for improvement, please feel free to contribute! [Edit on GitHub](https://github.com/Comfy-Org/embedded-docs/blob/main/comfyui_embedded_docs/docs/JsonExtractString/en.md)

***

**Source fingerprint (SHA-256):** `ca697fd3bd2d4de764372470ad1102b345d9d60f6df1c151fa0573e85fab2382`


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.