API Response Validator

Validate API Responses
against JSON Schema

Paste your API JSON response and a JSON Schema, and instantly see if the response matches the expected structure. Perfect for testing REST APIs, debugging integration issues, and validating third-party responses.

Open API Response Validator

API validation in four steps

Paste your API response JSON Drop any JSON response from a REST API into the input panel.
Paste or generate the JSON Schema Provide your schema manually or click Generate Schema to infer one from the response.
Click Validate The validator checks every field, type, and constraint against the schema instantly.
See detailed error messages Each violation is reported with a JSON path and a human-readable explanation.

No account. No upload. No nonsense.

🔒

No Server

Your API responses and schemas never leave your device. There is no backend.

Draft-07 Support

Full JSON Schema Draft-07 including allOf, anyOf, oneOf, not, if/then/else, and $ref.

📡

Works Offline

Load once and use forever — even on a plane or without internet access.

Related JSON tools

JSON Schema Validator Validate JSON against a Draft-07 schema with detailed error messages.
JSON Formatter Pretty-print JSON with syntax highlighting and a collapsible tree view.
JSON to OpenAPI Generate OpenAPI schema definitions from a sample JSON response.
JSON Validator Check JSON syntax instantly and see exactly where errors occur.

Common questions answered

What is an API response validator?

An API response validator checks that a JSON response from an API matches an expected structure — verifying field names, types, required properties, and constraints defined in a JSON Schema.

What JSON Schema draft is supported?

The validator supports JSON Schema Draft-07, including allOf, anyOf, oneOf, not, if/then/else, and $ref.

Does my API data leave my browser?

No. All validation is 100% client-side — your API responses and schemas never leave your device.

Can I validate OpenAPI response schemas?

Yes. Copy the response schema from your OpenAPI specification and paste it into the Schema tab for validation.

How do I generate a schema from a sample API response?

Paste your sample response in the Schema tab and click 'Generate Schema' to automatically create a Draft-07 schema you can use for future validation.

What is API response validation?

API response validation checks that data returned by an HTTP endpoint matches the expected structure. This matters because APIs evolve: new fields appear, types change, optional fields become null, and nested objects gain new properties. Without validation, these silent changes propagate through your application and surface as confusing bugs far from their origin.

This tool lets you paste an API response and validate it against a JSON Schema or simply check that it is valid JSON. For APIs that return deeply nested data, the tree view lets you inspect every field and its type. Combined with the diff tool, you can compare two versions of an API response to see exactly which fields changed between releases.

Validate an API response
Input
{
  "status": 200,
  "data": {
    "users": [
      {"id": 1, "name": "Alice"},
      {"id": 2, "name": null}
    ]
  }
}
Output
✓ Valid JSON
  Type: object (2 keys)
  Depth: 4 levels
  Fields: status, data,
    data.users (array of 2)

Get the most out of this tool

Ready to validate your API responses?

Free forever. No signup. Instant results.

Open API Response Validator

How API response validation works

API response validation is the process of verifying that a response payload conforms to an expected schema — asserting that required fields are present, values have correct types, strings match expected patterns, and arrays contain properly structured elements. Unlike simple JSON syntax validation (which only checks that the JSON is parseable), schema validation checks semantic correctness: a parseable JSON response with the wrong field names or unexpected null values fails schema validation even though it passes syntax validation.

JSON Schema is the standard vocabulary for describing JSON data shapes. An API response validator uses JSON Schema to define contracts: "type": "object" asserts the response is an object, "required": ["id", "name"] asserts those fields must be present, "properties": {"id": {"type": "integer"}} asserts the type of each field. When the actual response is validated against this schema, any deviation — a missing field, a string where an integer is expected, or an extra undeclared field when additionalProperties: false is set — is reported as a validation error.

API contract testing extends schema validation across API versions. By validating responses against a schema that reflects the published API contract, teams can detect breaking changes automatically. A field that was previously a string and is now a number, a required field that was removed, or a new required field added without a default — all are detected as schema violations. Consumer-driven contract testing (CDCT) using tools like Pact takes this further by capturing consumer expectations and verifying them against the provider.

OpenAPI 3.0 specifications include response schema definitions using JSON Schema-compatible syntax. API validators can use the response schemas from an OpenAPI spec directly, validating live responses against the specification. This "spec-first validation" approach ensures that the API implementation matches its documentation, preventing documentation drift where the spec and implementation diverge over time. Tools like Dredd and Prism perform this spec-to-implementation validation automatically.

Validation of paginated API responses requires validating both the envelope structure and the item structure. A paginated response typically has a top-level object with data, total, page, and pageSize fields, where data is an array of items. The JSON Schema for this response uses "items" to define the schema for each element in the data array, enabling validation of both the pagination envelope and each individual item independently.

Error response validation is as important as success response validation. A well-designed API returns consistent error shapes — typically an object with error, message, and code fields. Validating that 4xx and 5xx responses conform to the error schema ensures that error handling code in clients can rely on a consistent structure rather than defensively handling many possible error formats. Schema validation of error responses is often overlooked in API testing.

Auto-generating JSON Schema from sample API responses accelerates the validation setup. Rather than writing schema definitions from scratch — a tedious and error-prone process for complex responses — the schema generator analyzes a sample response and produces an initial schema that can be refined. Required fields must be added manually (the generator can only observe presence, not requirement), and optional fields must be marked appropriately, but the generated schema provides a 70-80% complete starting point that dramatically reduces manual work.

Real-world API response validation scenarios

CI/CD API contract testing Automated test suites validate API responses against JSON Schema definitions on every pull request. Breaking changes — removed fields, type changes, new required fields without defaults — are detected before deployment, preventing production incidents caused by undetected API contract violations.
Third-party API integration monitoring External APIs can change without notice. Validating responses from third-party APIs against a schema in production allows immediate detection of breaking changes — catching issues at the integration point rather than as mysterious application errors downstream in the processing pipeline.
Postman and API testing workflows API testers paste response payloads into the validator to quickly check that new endpoints match the expected schema during manual testing. Comparing responses across environments (dev, staging, production) reveals environment-specific inconsistencies before they affect users.
Webhook payload validation Webhook consumers validate incoming payloads against expected schemas to safely ignore or reject malformed events from third-party senders. Schema validation at the webhook entry point prevents malformed data from propagating through internal processing pipelines.

API response validation pitfalls

Additional frequently asked questions

What JSON Schema draft version does this validator support?

This validator supports JSON Schema Draft 7, which is the most widely used version and compatible with OpenAPI 3.0 schema objects. Draft 7 adds important features like if/then/else conditional validation, readOnly and writeOnly properties, and full support for $ref references. Later drafts (2019-09, 2020-12) introduce additional keywords but are less universally supported by validators.

Can I validate API responses automatically in my test suite?

Yes — use the Ajv library (JavaScript) or jsonschema library (Python) to validate API responses programmatically in test suites. Write a helper function that asserts responses against a schema and call it in every API test. For OpenAPI-based APIs, tools like Prism and Dredd can run schema validation automatically against a live server using the OpenAPI spec.

How do I generate a JSON Schema from an existing API response?

Use the Schema tab in this tool — paste an API response and click "Generate Schema" to produce an initial JSON Schema. The generator infers types, detects arrays, and creates nested object schemas automatically. Review and refine the generated schema to add required fields, mark nullable properties, and add format constraints that cannot be inferred from a single sample.

How do I validate responses that can have different shapes based on a type field?

Use JSON Schema's oneOf, anyOf, or discriminator (OpenAPI 3.0) to define schemas for polymorphic responses. For example, an event response with a type field that determines the payload structure uses oneOf where each variant schema includes a const constraint on the type field. This allows precise validation of each event type independently.