# JSON Schema Record Validator (`grounded_goldeneye/json-schema-record-validator`) Actor

Validate inline JSON records against JSON Schema Draft 2020-12 or Draft 7. Export per-record results, complete counts and bounded error paths. Local references only; no network fetching.

- **URL**: https://apify.com/grounded_goldeneye/json-schema-record-validator.md
- **Developed by:** [david tan](https://apify.com/grounded_goldeneye) (community)
- **Categories:** Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$0.05 / completed json schema record validator

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## JSON Schema Record Validator

Validate inline JSON records against JSON Schema Draft 2020-12 or Draft 7. Export per-record results, complete counts and bounded error paths. Local references only; no network fetching.

### When to use it

Validate exported API records before importing them into a database or using them in another Actor.

### Price

**$0.05 per completed report**, for supported paying Apify users. One `report-generated` event, after files and a summary are stored. No per-row, per-URL or dataset-item charge. Invalid input and processor timeouts do not trigger the report event. Apify’s free-user rules and any separately applicable platform charges are governed by Apify.

Use a maximum charge limit that covers at least one report. Keep a smaller diagnostic `detailLimit` for large inputs; all output records and counts remain complete. No external AI models or API keys are needed.

### Example input

```json
{
  "recordsJson": "[{\"id\":\"001\",\"quantity\":2},{\"id\":\"002\",\"quantity\":\"invalid\"}]",
  "schemaJson": "{\"type\":\"object\",\"properties\":{\"id\":{\"type\":\"string\"},\"quantity\":{\"type\":\"integer\"}},\"required\":[\"id\",\"quantity\"],\"additionalProperties\":false}",
  "draft": "2020-12",
  "checkFormats": false,
  "detailLimit": 100
}
```

### Results

- `REPORT.json`: complete `summary`, full `records` and bounded `details`.
- `RECORDS.csv`: all output records. Formula-like cells are escaped for spreadsheets; JSON is the authoritative typed result.
- `REPORT.html`: self-contained escaped report, with at most 20 output records in the preview.

The default dataset contains a single operational summary; it is not the records export. A low detail limit truncates diagnostics only. Download JSON or CSV for full output.

### Limits and behavior

Combined records and schema text: 5 MiB; 5,000 records; JSON depth 32; 100,000 JSON nodes; 100,000 validation errors. External $ref and $dynamicRef are blocked. Format checking is opt-in and restricted to the six documented formats. Diagnostic messages omit rejected values. Schema recursion, invalid schemas and processing timeouts fail without a report charge.

All products have a 25-second processor deadline, 256 MiB container memory, a 60-second run timeout and a combined 10 MiB export limit. Large or wide inputs may hit the export limit before the row limit. Failed exports do not charge the report event. No automatic restarts are enabled.

### Privacy and operation

Use only data you are authorized to process. Inline data and outputs are stored in your run’s Apify storage under its configured access and retention settings. This Actor does not fetch external resources or invoke a model, and does not log source values. Review your own storage sharing and retention settings for sensitive inputs.

Billing uses a durable checkpoint. If a charge response is uncertain, the same run stops for ledger review instead of retrying payment automatically. Start a new run only after inspecting the earlier attempt. Report a problem through Apify’s Actor issue tracker with sanitized examples; do not post private records or tokens.

# Actor input Schema

## `recordsJson` (type: `string`):

JSON text containing an array of records or values. At most 5,000 items.

## `schemaJson` (type: `string`):

A JSON object or boolean schema. Local # references only; external references are rejected.

## `draft` (type: `string`):

The schema $schema URI, when supplied, must agree with this selection.

## `checkFormats` (type: `boolean`):

Off by default. When enabled, only date, email, ipv4, ipv6, uuid and regex formats are accepted. Unknown formats are rejected.

## `detailLimit` (type: `integer`):

Caps warning or diagnostic samples only. Complete counts and output records are retained.

## Actor input object example

```json
{
  "recordsJson": "[{\"id\":\"001\",\"quantity\":2},{\"id\":\"002\",\"quantity\":\"invalid\"}]",
  "schemaJson": "{\"type\":\"object\",\"properties\":{\"id\":{\"type\":\"string\"},\"quantity\":{\"type\":\"integer\"}},\"required\":[\"id\",\"quantity\"],\"additionalProperties\":false}",
  "draft": "2020-12",
  "checkFormats": false,
  "detailLimit": 100
}
```

# Actor output Schema

## `summary` (type: `string`):

One summary row; no source values.

## `file0` (type: `string`):

Full records are in JSON and CSV. HTML previews at most 20 output rows. Markdown and text files, when present, are complete.

## `file1` (type: `string`):

Full records are in JSON and CSV. HTML previews at most 20 output rows. Markdown and text files, when present, are complete.

## `file2` (type: `string`):

Full records are in JSON and CSV. HTML previews at most 20 output rows. Markdown and text files, when present, are complete.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "recordsJson": "[{\"id\":\"001\",\"quantity\":2},{\"id\":\"002\",\"quantity\":\"invalid\"}]",
    "schemaJson": "{\"type\":\"object\",\"properties\":{\"id\":{\"type\":\"string\"},\"quantity\":{\"type\":\"integer\"}},\"required\":[\"id\",\"quantity\"],\"additionalProperties\":false}"
};

// Run the Actor and wait for it to finish
const run = await client.actor("grounded_goldeneye/json-schema-record-validator").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "recordsJson": "[{\"id\":\"001\",\"quantity\":2},{\"id\":\"002\",\"quantity\":\"invalid\"}]",
    "schemaJson": "{\"type\":\"object\",\"properties\":{\"id\":{\"type\":\"string\"},\"quantity\":{\"type\":\"integer\"}},\"required\":[\"id\",\"quantity\"],\"additionalProperties\":false}",
}

# Run the Actor and wait for it to finish
run = client.actor("grounded_goldeneye/json-schema-record-validator").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "recordsJson": "[{\\"id\\":\\"001\\",\\"quantity\\":2},{\\"id\\":\\"002\\",\\"quantity\\":\\"invalid\\"}]",
  "schemaJson": "{\\"type\\":\\"object\\",\\"properties\\":{\\"id\\":{\\"type\\":\\"string\\"},\\"quantity\\":{\\"type\\":\\"integer\\"}},\\"required\\":[\\"id\\",\\"quantity\\"],\\"additionalProperties\\":false}"
}' |
apify call grounded_goldeneye/json-schema-record-validator --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,grounded_goldeneye/json-schema-record-validator"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/qbz6w8XaoCPFjzCRn/builds/vuRMyQNvukCkwmZQH/openapi.json
