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

# JSON Validate

You can check if a json is valid or not

Sometimes you may need to inspect and validate JSON strings coming from APIs or Front-end applications. Using the method isJson() will output if your string is a valid json.

```php
$movies = Http::get('https://api.tvmaze.com/search/people?q=lauren');
        
ds($movies->body())->isJson()
    ->label('Valid JSON');

ds('{"}')->isJson()
    ->label('Invalid JSON');
```

![JSON Validate](https://1925282274-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDBDrn5ZBe2jpKcdmPPrl%2Fuploads%2Fgit-blob-fc12c233aed4f44292fdf5adbe8ed599727ae66d%2Fjson.png?alt=media)
