{"uid":"cap_Zvo6dbkJMCS6SjDneAWOI","slug":"apiacre-com-json-schema-inference-fc6eb80f","name":"apiacre.com JSON Schema Inference","description":"Create and generate a nested JSON Schema Draft 2020-12 contract by inferring field types and required fields from representative JSON, CSV, TSV, JSON Lines, or YAML records, with equivalent CSV/TSV numeric and null inference, input evidence, and non-enforcing observed bounds.","url":"https://apiacre.com/v1/data/schema","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"format":{"enum":["csv","tsv","json","jsonl","yaml"],"type":"string"},"content":{"type":"string"},"root_mode":{"enum":["records","preserve"],"type":"string"}}},"responseSchema":{"type":"json","example":{"data":{"input":{"format":"json","records":1,"rootMode":"records","utf8Bytes":27,"characters":27},"schema":{"type":"array","items":{"type":"object","required":["name","score"],"properties":{"name":{"type":"string","x-apiacre-observed":{"types":["string"],"nullCount":0,"sampleCount":1,"missingCount":0,"presentCount":1}},"score":{"type":"integer","x-apiacre-observed":{"types":["integer"],"nullCount":0,"sampleCount":1,"missingCount":0,"presentCount":1}}},"x-apiacre-observed":{"types":["object"],"nullCount":0,"sampleCount":1,"missingCount":0,"presentCount":1}},"$schema":"https://json-schema.org/draft/2020-12/schema","x-apiacre-observed":{"types":["array"],"nullCount":0,"sampleCount":1,"missingCount":0,"presentCount":1}},"inference":{"dialect":"https://json-schema.org/draft/2020-12/schema","version":"apiacre-schema-inference/3","csvEmptyStringsAsNull":false,"csvNumericStringsCoerced":false,"tabularNumericStringsCoerced":false}},"meta":{"cached":false,"sources":[],"warnings":[],"duration_ms":42,"next_actions":[{"path":"/v1/data/schema-validate","title":"JSON Schema validation","method":"POST","reason":"Validate a future JSON value against the inferred Draft 2020-12 contract.","service":"data.schema-validate"}]},"service":"data.schema","version":"1","request_id":"018f1f54-7f38-7ba2-8dc3-5f90272d9f1a"}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.025","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.025/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.025","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.025","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_-OyOTeZtQkQhiKIYzqukw","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.025","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Infers a JSON Schema from a set of structured records by analyzing their fields, types, and patterns.","exampleAgentPrompt":"Look at these JSON records I have and figure out the JSON Schema that describes them — infer the field names, types, and which fields are required.","exampleUseCases":[{"title":"API contract generation from samples","prompt":"I have a bunch of sample API response objects and I need you to infer a JSON Schema from them so I can use it for validation and documentation."},{"title":"Data pipeline schema discovery","prompt":"I'm ingesting these structured records from a third-party source and I need to automatically derive a JSON Schema so I know what fields and types to expect downstream."},{"title":"Form validation schema from existing data","prompt":"Here are some existing form submission records — can you generate a JSON Schema from them that I can use to validate future submissions?"}],"resultDescription":"A JSON Schema object describing the structure of the input records, including field names, inferred data types, and likely required/optional designations derived from the provided sample data.","failureModes":["Empty or null records array returns an error or minimal schema","Inconsistent field types across records may produce union types or ambiguous results","Deeply nested or highly irregular records may produce incomplete schemas","Malformed JSON input returns a validation error","Insufficient sample size may produce overly permissive schema"],"whenToPreferThis":"Choose this endpoint when you need to automatically derive a JSON Schema from existing structured records without manually authoring one. Ideal for data pipeline bootstrapping, API contract generation, or documentation from sample data. Prefer this over manual schema authoring when records already exist and field types need to be discovered programmatically.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T12:57:12.248Z","isFirstParty":false}