API Response Validator

Runs in browser API Testing

Define expectations (status code, headers, content type, JSON Schema or simple field rules) and validate a pasted or fetched response, producing a pass/fail checklist.

Privacy: This tool runs entirely in your browser. Your input never leaves your device.
Loading tool…

How to use API Response Validator

  1. Paste the response (from curl -i, a proxy or DevTools) or only its JSON body.
  2. Enter the expected status and headers, one field rule per line, and optionally a schema.
  3. Validate. Each expectation becomes a row with PASS, FAIL or ERROR (for rules that could not be parsed).
  4. Copy the checklist into your test report.

API Response Validator features

  • Accepts a raw HTTP response (status line + headers + body) or just the JSON body
  • Expected status (200, 2xx, 200,201 or 200-204) and header expectations (contains / exists)
  • JSONPath field rules: exists, ==, !=, comparisons, type, length, matches, contains, in, empty, null
  • Optional JSON Schema validation with a violation table
  • Pass/fail checklist with the actual values, downloadable as CSV

API Response Validator example

Validate a user response

Input:

HTTP/1.1 200 OK
Content-Type: application/json

{ "status": "ok", "data": { "id": "usr_1029", "email": "layla@example.com" } }

Rules: $.data.id exists · $.data.email matches ^\S+@\S+$ · $.data.password not exists

Output:

PASS · 5 checks
status 2xx — Status 200 is 2xx.
Content-Type: application/json — contains "application/json".
$.data.id exists — exists.
$.data.email matches … — matches.
$.data.password not exists — absent.

Frequently asked questions about API Response Validator

What can I paste?

Either the raw HTTP response (status line, headers, blank line, body — as printed by curl -i) or only the JSON body. Status and header checks need the raw response.

What field rules are supported?

JSONPath followed by a condition: exists, not exists, == value, != value, > < >= <= n, type string|number|integer|boolean|array|object|null, length >= n, matches <regex>, contains <x>, in [a, b], empty, not empty, null, not null.

Can I use a JSON Schema too?

Yes. Paste a schema (draft-07 / 2019-09 / 2020-12 keywords) and the body is validated against it; violations are listed with paths.

Does the tool fetch the URL for me?

No — it validates what you paste. Use the REST API Tester to send the request and assert live.

Technical notes

Rules are evaluated against the first JSONPath match. Comparison literals are parsed as JSON (so 42, true and "text" behave as expected); non-numeric operands fail numeric comparisons with a clear message instead of silently passing.