# JSON Schema Validator API

> JSON Schema Validator is a JSON validator API that tests any JSON object against a JSON Schema you provide, so you can check JSON against its schema before trusting it. It reports pass-fail status and total error count, while paid plans add specific error messages.

**Endpoint:** `POST https://api.apiverve.com/v1/jsonschemavalidator`  
**Category:** Text Processing  
**Cost:** 2 credits per call  
**Canonical page:** https://apiverve.com/marketplace/jsonschemavalidator

## Overview

A JSON schema validator API for checking payloads before they reach your database or downstream services. JSON Schema Validator works by comparing JSON data against a JSON Schema definition you send in the same request, so you can validate JSON against a schema without bundling a validation library into every client, script or no-code workflow.

It checks types, required fields, string patterns and lengths, numeric ranges, array sizes, enums and a set of common string formats, then reports whether the document is valid and how many problems it found. Teams use it to vet webhook bodies, form submissions, config files and data imports, and to test a schema against sample records while they are still writing it.

The Free plan returns the valid flag and the error count, which is enough to accept or reject a document. Paid plans add the full error list, where each entry names the failing field path, says what rule it broke, and shows the offending value, so you can tell users exactly what to fix.

## Authentication

Every call carries your key in an `x-api-key` header. The same key works across the whole
APIVerve catalog — there are no per-API subscriptions. Responses always use the same three
top-level keys: `status`, `error`, and `data`.

## Example request

```bash
curl -X POST "https://api.apiverve.com/v1/jsonschemavalidator" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"schema":{"type":"object","properties":{"name":{"type":"string"},"age":{"type":"integer"}},"required":["name"]},"json":{"name":"John Doe","age":30}}'
```

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `schema` | object | Yes | The JSON Schema to validate against |
| `json` | object | Yes | The JSON data to validate. An empty object is a valid document and is accepted. |

## Response fields

- `valid` — boolean · Whether the JSON data is valid against the schema
- `errors` — array · Array of validation error messages · (premium)
- `error_count` — number · Number of validation errors found

## Sample response

```json
{
  "status": "ok",
  "error": null,
  "data": {
    "valid": true,
    "errors": [],
    "error_count": 0
  }
}
```

## Use cases

- **API Validation** — Validate incoming API request payloads against defined schemas before processing to ensure data quality
- **Configuration Files** — Verify configuration files match expected schemas before deployment to prevent runtime errors
- **Data Quality** — Validate data integrity in ETL pipelines by checking against schemas during data transformation
- **Contract Testing** — Ensure API responses match contract specifications by validating against JSON schemas in tests

## SDKs

- **npm** — `npm install @apiverve/jsonschemavalidator` (https://www.npmjs.com/package/@apiverve/jsonschemavalidator)
- **PyPI** — `pip install apiverve-jsonschemavalidator` (https://pypi.org/project/apiverve-jsonschemavalidator/)
- **NuGet** — `dotnet add package APIVerve.API.JSONSchemaValidator` (https://www.nuget.org/packages/APIVerve.API.JSONSchemaValidator)
- **Source** — https://github.com/apiverve/jsonschemavalidator-api

## More

- Full reference: https://docs.apiverve.com/ref/jsonschemavalidator
- Get an API key: https://dashboard.apiverve.com
- Full catalog: https://apiverve.com/marketplace
