JSON to JSON Schema API - Generate draft-07 Schema from Sample
Infers a JSON Schema draft-07 document from the provided value: scalar types map to their schema type, integers get {type: integer}, arrays get {type: array, items: <schema>}, objects get {type: object, properties, required} with every present key in required. Includes $schema reference in the output.
Code examples
curl -X POST https://api.botoi.com/v1/schema/json-to-jsonschema \
-H "Content-Type: application/json" \
-d '{"json":{"id":1,"title":"Hello"}}'When to use this API
Bootstrap API documentation
Paste a real response, get a starting JSON Schema, and import into your OpenAPI spec. Removes the tedious step of hand-writing property blocks for every endpoint.
Contract tests against real fixtures
Generate schemas from saved response fixtures and commit them alongside the fixtures. Run /v1/schema/validate in CI to catch any upstream schema drift.
Data-catalog description from samples
For a data warehouse project, describe each table's row shape by sampling one row per table and generating its schema. Auto-document hundreds of tables in minutes.
Frequently asked questions
What draft does the output target?
Are all fields marked required?
How are arrays described?
Does it distinguish integer vs. number?
Are enum values inferred?
Get your API key
Free tier includes 5 requests per minute with no credit card required. Upgrade for higher limits.