Generate AI-powered content in structured blocks based on user instructions, language, and style. The API returns a JSON object containing various content blocks, such as paragraphs, lists, headers, code snippets, tables, and images, making it compatible with any programming language or platform that supports JSON. This versatility ensures seamless integration across different environments and workflows.
This API allows users to generate text content in block format using AI. Based on the provided instructions, language, and content type, it creates a JSON object containing different content blocks—such as paragraphs, lists, headers, code snippets, tables, and image prompts. The block-based structure is platform-agnostic, allowing easy integration into any system or programming language that supports JSON.
Block Content Generator API Explanation:
The Block Content Generator API creates structured content blocks based on the instructions provided. These blocks offer flexibility in how the content is used, as they return a JSON format that can be processed by any language or platform that supports JSON. Below is a table describing the types of blocks generated by this API and how to use them:
Block Type | Description | Example JSON |
---|---|---|
Paragraph | Used to generate standard text blocks. | { "type": "paragraph", "data": { "text": "Your response here" } } |
List | Used to generate ordered or unordered lists. | { "type": "list", "data": { "style": "unordered", "items": ["item 1", "item 2"] } } |
Header | Used to generate headers of different levels (1 to 4). | { "type": "header", "data": { "text": "Header", "level": 2 } } |
Code | Used to insert code snippets in different programming languages. | { "type": "code", "data": { "code": "Code here", "language": "Language name here" } } |
Table | Used to create tables with headers and rows of data. | { "type": "table", "data": { "header": ["Header 1", "Header 2"], "rows": [["Row 1", "Row 2"], ["Row 1", "Row 2"]] } } |
Image | Generates prompts describing AI-generated images based on detailed instructions. | { "type": "image", "data": { "prompt": "Prompt to generate image using AI", "caption": "Caption here" } } |
How to Use the Blocks:
Each block can be used in applications that accept JSON as input and output. Simply receive the JSON returned by the API and process it according to your needs. For example, a content editor can map the blocks to visual components, such as text paragraphs or automatically generated images.
Disclaimer: The content generated by this API is created using AI and should be carefully reviewed and validated by the user. We are not responsible for the accuracy, veracity, or appropriateness of the generated content. It is the user's responsibility to verify and ensure that the content meets their standards and requirements before use.
Response Schema
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"blocks": {
"type": "array",
"items": {
"$ref": "#/definitions/block"
}
}
},
"required": ["blocks"],
"definitions": {
"block": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": ["paragraph", "list", "header", "code", "table", "image"]
},
"data": {
"$ref": "#/definitions/blockData"
}
},
"required": ["type", "data"]
},
"blockData": {
"type": "object",
"anyOf": [
{ "$ref": "#/definitions/paragraphData" },
{ "$ref": "#/definitions/listData" },
{ "$ref": "#/definitions/headerData" },
{ "$ref": "#/definitions/codeData" },
{ "$ref": "#/definitions/tableData" },
{ "$ref": "#/definitions/imageData" }
]
},
"paragraphData": {
"type": "object",
"properties": {
"text": {
"type": "string"
}
},
"required": ["text"]
},
"listData": {
"type": "object",
"properties": {
"style": {
"type": "string",
"enum": ["unordered", "ordered"]
},
"items": {
"type": "array",
"items": {
"type": "string"
}
}
},
"required": ["style", "items"]
},
"headerData": {
"type": "object",
"properties": {
"text": {
"type": "string"
},
"level": {
"type": "integer"
}
},
"required": ["text", "level"]
},
"codeData": {
"type": "object",
"properties": {
"code": {
"type": "string"
},
"language": {
"type": "string"
}
},
"required": ["code", "language"]
},
"tableData": {
"type": "object",
"properties": {
"header": {
"type": "array",
"items": {
"type": "string"
}
},
"rows": {
"type": "array",
"items": {
"type": "array",
"items": {
"type": "string"
}
}
}
},
"required": ["header", "rows"]
},
"imageData": {
"type": "object",
"properties": {
"prompt": {
"type": "string"
},
"caption": {
"type": "string"
}
},
"required": ["prompt", "caption"]
}
}
}