Welcome to the comprehensive API documentation for content generation functions. This guide covers various endpoints designed to assist in creating and manipulating different types of content. Each endpoint now includes a "Try it" button to test the API directly.
Generates and returns a raw SVG element based on a given concept.
{
"concept": "string",
"width": number,
"height": number,
"style": "string" // optional, e.g., "minimalist", "detailed", "abstract"
}
{
"svg": "string (raw SVG content)"
}
// Request
{
"concept": "tree",
"width": 200,
"height": 300,
"style": "minimalist"
}
Generates and returns JavaScript code for a described function that can be used directly in an eval statement.
{
"description": "string",
"parameters": ["string"],
"returnType": "string"
}
{
"function": "string (JavaScript function code)"
}
// Request
{
"description": "Calculate the factorial of a number",
"parameters": ["number"],
"returnType": "number"
}
Generates text based on given parameters.
{
"type": "string", // e.g., "article", "story", "poem"
"topic": "string",
"length": number, // word count
"style": "string" // optional, e.g., "formal", "casual", "humorous"
}
{
"text": "string (generated text)"
}
// Request
{
"type": "article",
"topic": "Artificial Intelligence",
"length": 200,
"style": "formal"
}
Generates an image based on a text description.
{
"description": "string",
"width": number,
"height": number,
"style": "string" // optional, e.g., "photorealistic", "cartoon", "abstract"
}
{
"image_url": "string (URL to the generated image)"
}
// Request
{
"description": "A serene lake surrounded by mountains at sunset",
"width": 800,
"height": 600,
"style": "photorealistic"
}
Generates code snippets based on a description.
{
"language": "string", // e.g., "python", "javascript", "java"
"description": "string",
"complexity": "string" // optional, e.g., "basic", "intermediate", "advanced"
}
{
"code": "string (generated code snippet)"
}
// Request
{
"language": "python",
"description": "A function to check if a number is prime",
"complexity": "intermediate"
}
Generates sample data based on specified parameters.
{
"type": "string", // e.g., "json", "csv", "xml"
"schema": {}, // object describing the data structure
"rows": number // number of data entries to generate
}
{
"data": "string (generated data in specified format)"
}
// Request
{
"type": "json",
"schema": {
"name": "string",
"age": "number",
"email": "email"
},
"rows": 2
}