Free tools

Free REST API Response Assertion Tester

Validate API responses with deterministic assertions using contains checks, JSONPath rules, and XPath expressions.

Copy-paste outputs

Win high-intent buyers from ChatGPT, Gemini, Claude, Perplexity, and AI Overviews before your competitors do.

One operating layer for monitoring, measurement, content action, and technical cleanup.

AI Visibility TrackingCompetitive RankingSentiment by ModelSource CitationsAI Overviews TrackingPrompt MonitoringAI Visibility TrackingCompetitive RankingSentiment by ModelSource CitationsAI Overviews TrackingPrompt Monitoring
Content GapsAI InsightsAdvanced AnalyticsData CopilotBlog GenerationUGC CampaignsLLM CouncilContent GapsAI InsightsAdvanced AnalyticsData CopilotBlog GenerationUGC CampaignsLLM Council
Shopping IntelligenceCrawler MonitoringGEO OptimizationMulti-Brand ManagementShopping IntelligenceCrawler MonitoringGEO OptimizationMulti-Brand Management

Tool 01

REST Response Assertion Tester

Validate API responses with string, JSONPath, and XPath assertions in one local workflow.

REST Response Assertion Tester
Validate API responses with deterministic string, JSONPath, and XPath assertion rules.
Assertion results
0 passed / 3 failed / 3 total

contains:success

Substring not found in response.

jsonpath:$.status==ok

Response is not valid JSON for JSONPath assertion.

xpath://status/text()==ok

DOMParser is not defined

[
  {
    "assertion": "contains:success",
    "pass": false,
    "details": "Substring not found in response."
  },
  {
    "assertion": "jsonpath:$.status==ok",
    "pass": false,
    "details": "Response is not valid JSON for JSONPath assertion."
  },
  {
    "assertion": "xpath://status/text()==ok",
    "pass": false,
    "details": "DOMParser is not defined"
  }
]

How it works

REST Response Assertion Tester: methodology and worked example

How this tool computes its result

Each assertion line is parsed as `type:expression==expected` (expected is optional). "contains"/"notContains" do plain substring checks against the raw response body text. "jsonpath" first attempts JSON.parse on the whole response body (guarded in a try/catch — if parsing fails, every jsonpath assertion automatically fails with "Response is not valid JSON") and then runs the jsonpath-plus library against the parsed object. "xpath" parses the response body as XML via DOMParser and runs doc.evaluate. When an expected value is given, matched values are compared with stringifyValue (JSON.stringify for non-strings) using strict string equality against the expected text.

Worked example

Response body `{"status":"ok","data":{"count":3}}` with assertions "contains:success" and "jsonpath:$.status==ok": the first fails ("Substring not found in response.") since the literal word "success" is not in the body; the second passes ("Expected value matched (ok).") since JSONPath `$.status` resolves to "ok", which stringifies to exactly "ok".

When not to use this tool

xpath assertions require the response body to parse as well-formed XML — running an xpath assertion against a JSON response body throws "Invalid XML input for XPath assertions." rather than gracefully skipping. The expected-value comparison is also plain string equality on stringified output, so a JSONPath match returning the number 3 must be compared against the literal text "3", not left ambiguous.

Common mistakes

  • - Writing `xpath:` assertions against a JSON API response — this always fails at the DOMParser stage regardless of whether the logical assertion would otherwise be true.
  • - Omitting `==expected` when an exact-value check was intended — without it, the assertion only checks "at least one match exists," not that the match equals a specific value.
  • - Assuming assertion type names are case-sensitive or exact — the parser lowercases only the `type` prefix before the first colon, so a stray space or unsupported keyword (e.g. "jsonPath" vs "jsonpath" with different casing works, but "json-path" would not) falls into the "Unknown assertion type" branch.

Ready to dominate AI search visibility?

Track where your brand shows up in AI answers, close the content gaps that cost conversions, and stay visible across ChatGPT, Claude, Gemini, Perplexity, and Grok.