API Documentation
Schema Documentation
Basic Types
JSON Schema supports several primitive data types that form the building blocks of more complex schemas.
String Type
The string type is used for text values. Our AI will extract text that matches the context described in your schema.
{ "type": "object", "properties": { "name": { "type": "string", "description": "The person's full name" }, "email": { "type": "string", "description": "The person's email address" } } }
Example Input:
John Smith is a developer who can be reached at [email protected].
Example Output:
{ "name": "John Smith", "email": "[email protected]" }
Pro Tip:
Adding a clear description helps the AI understand the context and extract the right information.
Number Type
The number type is used for numeric values, including integers and floating-point numbers.
{ "type": "object", "properties": { "age": { "type": "number", "description": "The person's age in years" }, "height": { "type": "number", "description": "The person's height in centimeters" }, "weight": { "type": "number", "description": "The person's weight in kilograms" } } }
Example Input:
The patient is 35 years old, stands 182.5 cm tall, and weighs 78 kg.
Example Output:
{ "age": 35, "height": 182.5, "weight": 78 }
Note:
The AI will automatically convert numeric text (e.g., "thirty-five", "35") to actual numbers in the output JSON.
Boolean Type
The boolean type represents true/false values. Our AI can extract boolean values based on the context in the input text.
{ "type": "object", "properties": { "isEmployed": { "type": "boolean", "description": "Whether the person is currently employed" }, "isStudent": { "type": "boolean", "description": "Whether the person is a student" } } }
Example Input:
Jane is currently working at Acme Inc. She is not a student at the moment.
Example Output:
{ "isEmployed": true, "isStudent": false }
Pro Tip:
The AI recognizes various textual indicators for boolean values: "yes/no", "true/false", "is/isn't", etc.
Null Type
The null type indicates that a value is explicitly empty or undefined. The AI can infer when a value should be null based on the input text.
{ "type": "object", "properties": { "name": { "type": "string", "description": "The person's name" }, "spouse": { "type": ["string", "null"], "description": "The person's spouse's name if married, null if single" } } }
Example Input:
Mark Johnson is single and has no spouse.
Example Output:
{ "name": "Mark Johnson", "spouse": null }
Note:
To allow a property to be either a specific type or null, use an array of types like ["string", "null"]
.
Multiple Types
You can specify that a field can accept multiple types using an array of type names.
{ "type": "object", "properties": { "id": { "type": ["string", "number"], "description": "The ID can be either a string or a number" }, "middleName": { "type": ["string", "null"], "description": "Middle name if available, null if not" } } }
Example Input:
Employee #12345, Bob (no middle name) Smith
Example Output:
{ "id": 12345, "middleName": null }