JSON schema from example API: infer a JSON Schema
Infer a JSON Schema (draft 2020-12) from an example JSON value: types, nested object properties, required keys, array item shapes merged across all items, and string formats (date-time, date, email, uri, uuid). Use to document an API response or to validate later data against the same shape.
When to use it
- Turn an example API response into a JSON Schema (draft 2020-12)
- Merge the shapes of all items in an array, with optional keys left out of required
- Detect string formats such as date-time, email, uri and uuid
Inputs
| Name | Type | Description |
|---|---|---|
json (required) | string | The example JSON |
Request
Over HTTP, with a card key from /credits:
curl -H "Authorization: Bearer adt_…" "https://agent-data-tools.revmesh2074.workers.dev/json/schema?json=%7B%22id%22%3A1%2C%22email%22%3A%22ada%40example.com%22%2C%22tags%22%3A%5B%22a%22%2C%22b%22%5D%2C%22created%22%3A%222026-10-23T08%3A00%3A00Z%22%7D"
Or one of your 25 free calls, no key:
curl "https://agent-data-tools.revmesh2074.workers.dev/json/schema?json=%7B%22id%22%3A1%2C%22email%22%3A%22ada%40example.com%22%2C%22tags%22%3A%5B%22a%22%2C%22b%22%5D%2C%22created%22%3A%222026-10-23T08%3A00%3A00Z%22%7D&trial=1"
Without a key, the same URL answers 402 Payment Required with x402 and MPP terms, so an agent with a wallet pays per call in USDC (Base, Polygon, Arbitrum or Solana over x402; Base or Tempo over MPP) and retries.
Example result
{
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"email": {
"type": "string",
"format": "email"
},
"tags": {
"type": "array",
"items": {
"type": "string"
}
},
"created": {
"type": "string",
"format": "date-time"
}
},
"required": [
"id",
"email",
"tags",
"created"
]
}
}
From an AI agent (MCP)
Add the MCP server to Claude, Cursor or any MCP client. This tool is json_schema, and the first 25 successful calls are free:
https://agent-data-tools.revmesh2074.workers.dev/mcp
Questions
Which JSON Schema version?
Draft 2020-12.
How are mixed numbers handled?
Integers and decimals in the same field widen to number.
How do I pay?
Each successful call costs $0.01; failed calls are not charged. The first 25 calls are free. Then pay with card credits (from $5) or per call in USDC over x402 or MPP. No account or API key is needed.