If you haven't check jsonschema library, it can be useful to validate data. JSON Schema is a way to describe the content of JSON. The library just uses the format to make validations based on the given schema.

I made a simple example from basic usage.

import json
from jsonschema import validate

# Describe what kind of json you expect.
schema = {
    "type" : "object",
    "properties" : {
        "description" : {"type" : "string"},
        "status" : {"type" : "boolean"},
        "value_a" : {"type" : "number"},
        "value_b" : {"type" : "number"},
    },
}

# Convert json to python object.
my_json = json.loads('{"description": "Hello world!", "status": true, "value_a": 1, "value_b": 3.14}')

# Validate will raise exception if given json is not
# what is described in schema.
validate(instance=my_json, schema=schema)

# print for debug
print(my_json)
Answer from T.Nylund on Stack Overflow
🌐
JSON Formatter
jsonformatter.curiousconcept.com
JSON Formatter & Validator
To learn more about JSON check out some of the following links. ... Install the JSON Formatter & Validator Bookmarklet to quickly and easily format and validate any public JSON URL with a single click.
🌐
JSON Formatter
jsonformatter.org
Best JSON Formatter and JSON Validator: Online JSON Formatter
Validate JSON using PHP · Python Load Json From File · Online JSON Formatter and Online JSON Validator provide JSON converter tools to convert JSON to XML, JSON to CSV, and JSON to YAML also JSON Editor, JSONLint, JSON Checker, and JSON Cleaner. Free JSON Formatting Online and JSON Validator work well in Windows, Mac, Linux, Chrome, Firefox, Safari, and Edge.
Discussions

Validate JSON data using python - Stack Overflow
I need to create a function that validates incoming json data and returns a python dict. It should check if all necessary fields are present in a json file and also validate the data types of those More on stackoverflow.com
🌐 stackoverflow.com
I wrote okjson - A fast, simple, and pythonic JSON Schema Validator
https://github.com/mufeedvh/okjson/blob/main/okjson/validator.py It's useful to use a formatter/linter and configure your text editor to be aligned with the linter. $> pylint okjson | grep 'Bad indentation' | wc -l 100 black is a popular formatter used by the community. https://github.com/psf/black pylint is a useful listing tool. https://pylint.pycqa.org/en/latest/ Best of luck to you on your project. More on reddit.com
🌐 r/Python
4
14
March 31, 2022
JSON deserializer and validator
You might like to be aware of "jsonpickle". I imagine you might want a more "language agnostic" json schema or one that is more reliable (though in practice I think the serialization will change any time soon. You should also be aware of json schemas in general https://json-schema.org/ and the similarity of this to some of WSDL/soap standards (though these use xml rather than json). I'm really not a fan of these and when I've been forced to play with them before they did not work that well. Things like this: https://github.com/Julian/jsonschema might be interesting It doesn't look like json schemata are designed for deserialization. More on reddit.com
🌐 r/Python
7
4
September 3, 2018
How to validate a json file
I wonder if you're getting a chunked response and only seeing the first chunk? If it were me, I'd put a breakpoint in and check what response.content was. Somewhere in your process you're losing data, or never receiving it to begin with - although, if the .json() method is not throwing an error, then the response should be complete json content I would have thought... You could also try just writing the response.content to file as is, and bypass the json() and dump() methods? More on reddit.com
🌐 r/learnpython
4
2
June 12, 2022
🌐
JSONLint
jsonlint.com
JSON Online Validator and Formatter - JSON Lint
It's an excellent way to correct errors without wasting hours finding a missing coma somewhere inside your code. JSONLint is an online editor, validator, and formatting tool for JSON, which allows you to directly type your code, copy and paste it, or input a URL containing your code.
🌐
Flexiple
flexiple.com › python › python-json-validator
Python JSON Validator - Flexiple
March 28, 2024 - The JSON Validator is straightforward to use. We will demonstrate how to validate JSON data step-by-step. To get started, import the JSON module into your Python script:
🌐
PyPI
pypi.org › project › json-checker
json-checker · PyPI
json_checker is a library for validating Python data structures, such as those obtained from JSON (or something else) to Python data-types.
      » pip install json-checker
    
Published   Aug 31, 2019
Version   2.0.0
🌐
jsonschema
python-jsonschema.readthedocs.io › en › latest › validate
Schema Validation - jsonschema 4.26.1.dev25+gad0a1b301 documentation
The Basics: The simplest way to validate an instance under a given schema is to use the validate function. The Validator Protocol: jsonschema defines a protocol that all validator classes adhere to...
Find elsewhere
🌐
PYnative
pynative.com › home › python › json › validate json data using python
Validate JSON data using Python
May 14, 2021 - Using jsonschema, we can create a schema of our choice, so every time we can validate the JSON document against this schema, if it passed, we could say that the JSON document is valid. ... First, install jsonschema using pip command. pip install jsonschema · Define Schema: Describe what kind of JSON you expect · Convert JSON to Python Object using json.load or json.loads methods.
🌐
jsonschema
python-jsonschema.readthedocs.io
jsonschema 4.26.0 documentation
>>> validate(instance={"name" : "Eggs", "price" : 34.99}, schema=schema) >>> validate( ... instance={"name" : "Eggs", "price" : "Invalid"}, schema=schema, ... ) Traceback (most recent call last): ... ValidationError: 'Invalid' is not of type 'number' It can also be used from the command line by installing check-jsonschema.
🌐
JSON Formatter
jsonformatter.org › c47f9c
python
JSON Validator Online checks the integrity/syntax of the JSON data based on JavaScript Object Notation (JSON) Data Interchange Format Specifications (RFC).
🌐
Code Beautify
codebeautify.org › jsonvalidator
JSON Validator - JSONLint tool to validate JSON data
JSON Validator will show the errors with line numbers, if any, with great details. Know more about JSON. How to Create JSON File? JSON Full Form · What is JSON? JSON Example with JSON Array · Pretty Print JSON using Python · Read JSON File Using Python · Validate JSON using PHP ·
🌐
Built In
builtin.com › software-engineering-perspectives › python-json-schema
How to Use JSON Schema to Validate JSON Documents in Python | Built In
In Python, we can use the jsonschema library to validate a JSON instance (also referred to as a JSON document as long as it’s unambiguous) against a schema.
🌐
GitHub
github.com › python-jsonschema › jsonschema
GitHub - python-jsonschema/jsonschema: An implementation of the JSON Schema specification for Python · GitHub
jsonschema is an implementation of the JSON Schema specification for Python. >>> from jsonschema import validate >>> # A sample schema, like what we'd get from json.load() >>> schema = { ... "type" : "object", ... "properties" : { ... "price" : {"type" : "number"}, ...
Starred by 4.9K users
Forked by 610 users
Languages   Python 99.8% | TypeScript 0.2%
🌐
Pydantic
docs.pydantic.dev › latest › concepts › json
JSON - Pydantic Validation
""" try: return handler(v) except ValidationError as exc: # there might be other types of errors resulting from partial JSON parsing # that you allow here, feel free to customize as needed if all(e['type'] == 'missing' for e in exc.errors()): raise pydantic_core.PydanticUseDefault() else: raise class NestedModel(BaseModel): x: int y: str class MyModel(BaseModel): foo: Optional[str] = None bar: Annotated[ Optional[tuple[str, int]], WrapValidator(default_on_error) ] = None nested: Annotated[ Optional[NestedModel], WrapValidator(default_on_error) ] = None m = MyModel.model_validate( pydantic_core
🌐
Couchbase
couchbase.com › home › validate json documents in python using pydantic
Validate JSON Documents in Python using Pydantic
June 14, 2025 - Find out how to validate JSON documents against a specified schema using the popular Python library pydantic. Get validation best practices at Couchbase.
🌐
Donofden
donofden.com › blog › 2020 › 03 › 15 › How-to-Validate-JSON-Schema-using-Python
How to Validate JSON Schema using Python
Currently the most complete and compliant JSON Schema validator available for python is Jsonschema.
🌐
PyPI
pypi.org › project › jsonschema
jsonschema - JSON Schema validation for Python
Programmatic querying of which properties or items failed validation. jsonschema is available on PyPI.
      » pip install jsonschema
    
Published   Jan 07, 2026
Version   4.26.0
🌐
GeeksforGeeks
geeksforgeeks.org › python › python-check-whether-a-string-is-valid-json-or-not
Python | Check whether a string is valid json or not - GeeksforGeeks
July 11, 2025 - In the below example, the string is an invalid JSON because, the string characters are enclosed in single quotes ('), but as per valid JSON schema, strings must be enclosed in double quotes ("). ... # Python code to demonstrate # checking whether string # is valid json or not import json ini_string = "{'akshat' : 1, 'nikhil' : 2}" # printing initial ini_string print ("initial string", ini_string) # checking for string try: json_object = json.loads(ini_string) print ("Is valid json?
🌐
GitHub
github.com › donofden › python-validate-json-schema
GitHub - donofden/python-validate-json-schema: Validate JSON Schema using Python
Currently the most complete and compliant JSON Schema validator available for python is Jsonschema.
Starred by 6 users
Forked by 2 users
Languages   Python 100.0% | Python 100.0%
🌐
Testcookbook
testcookbook.com › book › python › json-schema-validation.html
JSON Schema Validation - Test Cookbook
import json from jsonschema import validate def validate_json_syntax(d): try: return json.loads(d) except ValueError: print('DEBUG: JSON data contains an error') return False data = '{"firstName": "John", "lastName": "Doe"}' jsd = validate_json_syntax(data) schema = { "type": "object", "properties": { "firstName": { "type": "string"}, "lastName": { "type": "string"} } } #output will be None print(validate(jsd, schema))