# JSON Extractor Block

**Advanced/Experimental**\
[Contact us](https://glif.app/contact) or [join Discord](https://glif.app/discord) to report issues

Extract specific data value from JSON, for example from a WebFetcher or Text Generator block.

<figure><img src="https://3256383364-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEEfZP6ffo6mVPfK4pJ0a%2Fuploads%2FreHRGZ93oa1WiGlnNxLP%2Fjson-block-01.png?alt=media&#x26;token=20a63bd3-2180-4099-b777-47ebed4eb8fc" alt=""><figcaption></figcaption></figure>

### JSON Data

Paste your JSON into the "Value" input, or more usefully, use a variable to another block that returns JSON.

### Choose data to extract

You can use a simple dot-notation syntax to fetch a specific field from a JSON response.&#x20;

Here's an example using this JSON:

```json
[
  {
    "id": "clgh1vxtu0011mo081dplq3xs",
    "name": "Heavy Metal Covers",
    "imageUrl": null,
    "description": "A new glif that performs some truly magical stuff"
  }
]
```

#### Output name

This is the name of the variable that will hold the data. You can use the variable as `{blockname.outputname}` in other blocks.

#### JSON Path

Use the JSON Path `0.name` to extract the `name` property of the first object, "Heavy Metal Covers". Note that counting starts at 0 in arrays, so the first item is 0, the second is 1.

At the moment, only text can be extracted from JSON. Let us know in Discord if you have other use cases.

#### Fallback

If the data isn't found in the JSON, this value will be used. This can also be a variable, if you want to live dangerously.

### Using the variables

In another block, you can see the variables being available as `{json1.id}` and `{json1.name}`.

<figure><img src="https://3256383364-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEEfZP6ffo6mVPfK4pJ0a%2Fuploads%2F3XCC9XE2pgB8ARhhXuCp%2Fjson-block-02.png?alt=media&#x26;token=9259dbea-143d-4d0d-aab4-b46cec895fe3" alt=""><figcaption></figcaption></figure>
