JSON Validator & Formatter — Bulk Parse, Pretty-Print, Stats avatar

JSON Validator & Formatter — Bulk Parse, Pretty-Print, Stats

Pricing

Pay per usage

Go to Apify Store
JSON Validator & Formatter — Bulk Parse, Pretty-Print, Stats

JSON Validator & Formatter — Bulk Parse, Pretty-Print, Stats

Bulk JSON QA via Apify — paste strings or pass URLs. Output: isValid, formatted, minified, error, errorPosition, stats (objects/arrays/depth/sizes/compressionRatio), scrapedAt. Syntax check, pretty-print, minify. spinov001@gmail.com · blog.spinov.online · t.me/scraping_ai

Pricing

Pay per usage

Rating

0.0

(0)

Developer

Alex

Alex

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

3 hours ago

Last modified

Share

JSON Validator & Formatter — Validate, Prettify, Schema-Check at Scale

Validate JSON from URLs or direct input, catch syntax errors with exact line/position, optionally validate against a JSON Schema — all in one run. Bulk-validate thousands of API responses or data files in a single workflow.

Most JSON validation tools are one-payload-at-a-time UIs (jsonlint, jsonformatter.org). This actor is built for the other use case: validating hundreds of API responses at once, regressions in an ETL pipeline, or confirming every file in an S3 bucket is well-formed JSON before downstream processing.

Who uses this

  • QA / API testers running nightly validation across 50+ API endpoints.
  • ETL engineers gate-checking data between pipeline stages — bad JSON blocks before it corrupts a warehouse load.
  • Integration architects auditing third-party API contracts — has the vendor changed the response schema?
  • Security engineers fuzzing JSON endpoints and cataloging validation-error patterns.
  • Developers / technical writers who need a programmable JSON playground for tutorials.

What you get per input

FieldTypeExample
input_sourcestringURL or inline label
is_validbooleantrue
error_messagestring | null"Unexpected token ',' at position 142"
error_linenumber | null5
error_columnnumber | null17
parsed_size_bytesnumber4821
depthnumber4 (max nesting)
key_countnumber127
schema_validboolean | nulltrue (if JSON Schema supplied)
schema_errorsarray | null[{path, message, expected, got}]
formattedstringPretty-printed JSON
minifiedstringWhitespace-stripped JSON
http_statusnumber | null200 (if fetched from URL)
fetch_time_msnumber | null180

Input

{
"inputs": [
{ "type": "url", "value": "https://api.github.com/repos/vercel/next.js" },
{ "type": "url", "value": "https://httpbin.org/json" },
{ "type": "inline", "value": "{\"name\":\"test\",\"items\":[1,2,3]}" }
],
"schemaUrl": "https://example.com/schemas/github-repo.json",
"failOnSchemaMismatch": false,
"autoFix": true,
"requestTimeoutMs": 5000
}
  • inputs — list of {type: "url"|"inline", value}. Bulk tested up to 1,000 inputs per run.
  • schemaUrl — optional. If supplied, every parsed JSON is validated against this JSON Schema.
  • failOnSchemaMismatch — set true to fail the run (useful as a CI gate).
  • autoFix — attempt common fixes (trailing commas, unquoted keys, single quotes). Returns auto_fixed: true if applied.
  • requestTimeoutMs — per-URL fetch timeout.

Python usage example

from apify_client import ApifyClient
client = ApifyClient("YOUR_APIFY_TOKEN")
run_input = {
"inputs": [
{"type": "url", "value": "https://api.github.com/repos/vercel/next.js"},
{"type": "url", "value": "https://jsonplaceholder.typicode.com/todos"},
{"type": "inline", "value": '{"bad": "json",}'}, # trailing comma
],
"autoFix": True,
}
run = client.actor("knotless_cadence/json-validator-formatter").call(run_input=run_input)
results = list(client.dataset(run["defaultDatasetId"]).iterate_items())
for r in results:
status = "OK" if r["is_valid"] else "FAIL"
print(f"[{status}] {r['input_source']:70s} depth={r['depth']} keys={r['key_count']}")
if not r["is_valid"]:
print(f" ERROR: {r['error_message']} at line {r['error_line']}:{r['error_column']}")

CI gate pattern

Use as a pre-merge JSON-file validation gate:

curl -s "https://api.apify.com/v2/acts/knotless_cadence~json-validator-formatter/run-sync-get-dataset-items?token=$APIFY_TOKEN" \
-H "Content-Type: application/json" \
-d '{"inputs":[{"type":"url","value":"https://raw.githubusercontent.com/owner/repo/main/config.json"}],"failOnSchemaMismatch":true,"schemaUrl":"https://raw.githubusercontent.com/owner/repo/main/config.schema.json"}' \
| jq -e '.[0].is_valid and .[0].schema_valid' || {
echo "Invalid JSON — blocking PR"
exit 1
}

Common questions

Q: What JSON parser is used? Python's json module for strict RFC 8259 compliance, plus json5 as a fallback when autoFix=true (handles comments, trailing commas, unquoted keys common in config files).

Q: Does it support JSON Schema Draft 2020-12? Yes — Draft-07, Draft 2019-09, and Draft 2020-12 are all supported via the jsonschema Python library.

Q: Can I validate newline-delimited JSON (NDJSON / JSON Lines)? Yes — set inputFormat: "ndjson" in the input. Each line is validated independently and aggregated results returned.

Q: Is it safe to send sensitive payloads? The actor runs on Apify's infrastructure. Inline payloads are processed in-memory per run, not persisted beyond the standard Apify dataset (which you can delete programmatically). For secret-sensitive workflows, prefer URL inputs with short-lived signed URLs rather than inline payloads.

Q: How does the autoFix feature work? It applies a sequence: (1) strip JS-style comments, (2) fix trailing commas, (3) quote unquoted keys, (4) convert single quotes to double. Each transformation is logged so you can audit what was changed.

Q: Cost per run? Apify compute-unit pricing. A 1,000-input run (URL-fetched + schema-checked) typically costs $0.02-$0.05.

Export integrations

  • CSV / JSON / Excel / HTML (native Apify dataset download)
  • Google Sheets (via Apify integration)
  • Webhooks fired on invalid-JSON detection (great for Slack alerts)
  • S3 / GCS direct sync
  • Zapier / Make.com / n8n
SourceActorData
JSON Validator (this)Syntax + schemaData quality
Sitemap ScraperURLs from sitemap.xmlCrawl surface
Robots.txt AnalyzerCrawl rulesScrape compliance
Public APIs DirectoryFree API catalogAPI discovery
NPM PackagePackage metadataJS ecosystem

All free on Apify Store.

About the maintainer

Maintained by an active Apify developer (78 public actors covering scraping, MCP servers, data-validation tooling, and devops utilities). Technical articles on Hashnode, Telegraph, Write.as, and Mataroa covering JSON schema design, API-contract testing, and ETL data-quality patterns.

Need a custom data-validation pipeline (multi-schema validation, contract-testing harness, alert-on-drift)? Email spinov001@gmail.com or message t.me/scraping_ai.

Disclaimer

Designed for data-quality, API-testing, and development use. Respects URL-fetch rate limits and honors standard timeout behavior. Not affiliated with any specific JSON-Schema vendor or validator library.