JSON Schema Contract Validator avatar

JSON Schema Contract Validator

Pricing

from $0.30 / 1,000 record validateds

Go to Apify Store
JSON Schema Contract Validator

JSON Schema Contract Validator

Validate JSON/JSONL records against your JSON Schema, or infer a schema + TypeScript interface from a sample. Per-record errors and VALID/DEAD_LETTER files.

Pricing

from $0.30 / 1,000 record validateds

Rating

0.0

(0)

Developer

Colton Mcclain

Colton Mcclain

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

7 days ago

Last modified

Categories

Features

Limited permissions

Share

Enforce a data contract on scraped or exported data and see exactly which records break it.

What problem does it solve?

Pipelines break when a source quietly changes shape. You need a clear valid / dead-letter split and the reason for every rejected record.

What it does

  • Validates each record against your JSON Schema with the Python jsonschema library.
  • Reports up to 10 violations per record (JSON-pointer path, message, keyword) and exact error counts.
  • Writes VALID.jsonl and DEAD_LETTER.jsonl to the key-value store.
  • Or infers a schema and TypeScript interface from a sample (required = present in every row).

Pricing (pay per event)

EventPrice
Actor start (once per run, per GB of memory, minimum one)$0.0050
Record validated (per record validated)$0.0003

You pay only for the events above plus nothing else from ELYRAON; Apify platform usage is covered by the event prices. The start event is charged on every run, including a run rejected for invalid input (nothing else is charged in that case). If you set a maximum charge per run, the Actor stops when it is reached and reports PARTIAL_MAX_CHARGE in the OUTPUT record, so you are never silently billed beyond your cap and never told a partial result is complete.

Input

FieldTitleRequiredDescription
recordsRecordsnoRecords to process. Each item is a JSON object or a plain string.
file_urlFile URLnoPublic http(s) URL of a JSON array or JSONL file. Use instead of Records.
schemaJSON SchemanoYour JSON Schema (draft 4-2020-12; local $refs only). Use this OR Infer schema.
infer_schemaInfer schema from the recordsnoBuild a schema (and TypeScript interface) from your sample instead of validating against one.

Example input:

{
"records": [
{
"id": 1
}
],
"schema": {
"type": "object",
"required": [
"id",
"name"
]
}
}

Output

Results go to the run's default dataset (download as JSON, CSV or Excel). Each item:

FieldTypeDescription
record_indexinteger1-based position.
validbooleanPassed the schema.
error_countintegerTotal violations.
errorsarrayUp to 10 violations: path, message, keyword.

Example item:

{
"record_index": 1,
"valid": false,
"error_count": 1,
"errors": [
{
"path": "/",
"message": "'name' is a required property",
"keyword": "required"
}
]
}

The key-value store holds OUTPUT (run summary: status, counts, warnings, limitations, version, source commit) and REPORT.md (readable summary). OUTPUT.status is SUCCEEDED, PARTIAL_MAX_CHARGE, PARTIAL_RESULT_LIMIT or FAILED (with a structured error code/message/field). Invalid or empty input fails the run immediately with an explanation and returns no results.

Use from code

curl -X POST "https://api.apify.com/v2/acts/colt2822~json-schema-contract-validator/run-sync-get-dataset-items?token=$APIFY_TOKEN" \
-H "Content-Type: application/json" -d '{"records": [{"id": 1}], "schema": {"type": "object", "required": ["id", "name"]}}'
from apify_client import ApifyClient
run = ApifyClient("$APIFY_TOKEN").actor("colt2822/json-schema-contract-validator").call(run_input={"records": [{"id": 1}], "schema": {"type": "object", "required": ["id", "name"]}})

This Actor can also be called by AI agents through the Apify MCP server (https://mcp.apify.com), which exposes Actors as tools.

Limitations

  • Remote $ref fetching is not supported.
  • An inferred schema describes your sample, not your intended contract: review before enforcing.
  • Max 50,000 records per run.

Support

Questions or problems: https://elyraon.com.co/contact/ (ELYRAON). Source revision: 64dbaa5. Actor version 1.0.