Overview
Generate complete blog post metadata including images, excerpt, category, and tags using AI. This endpoint uses advanced AI models to create professional blog metadata.
Request Body
The title of your blog post. This is used to generate all elements.
Optional blog post content. Providing content helps generate more accurate and relevant results.
image_style
string
default:"realistic"
The style of images to generate. Options:
realistic: Photorealistic images
illustration: Artistic illustrations
abstract: Abstract designs
minimalist: Simple, clean designs
photographic: High-quality photographs
Language code for the generated content (default: en)
Source identifier for tracking (web, api, extension, wordpress, shopify, batch)
Example Request
cURL
curl -X POST https://api.gistmag.co.uk/blog/generate \
-H "Content-Type: application/json" \
-d '{
"title": "10 Tips for Better Productivity",
"content": "In this article, we explore proven strategies to improve your productivity and get more done in less time...",
"api_key": "your_api_key_here",
"image_style": "realistic",
"language": "en"
}'
Python
import requests
url = "https://api.gistmag.co.uk/blog/generate"
payload = {
"title": "10 Tips for Better Productivity",
"content": "In this article, we explore proven strategies to improve your productivity and get more done in less time...",
"api_key": "your_api_key_here",
"image_style": "realistic",
"language": "en"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
if response.status_code == 200:
data = response.json()
print(f"Generated {len(data['images'])} images")
print(f"Excerpt: {data['excerpt']}")
print(f"Category: {data['category']}")
print(f"Tags: {', '.join(data['tags'])}")
else:
print(f"Error: {response.json()}")
JavaScript
const response = await fetch('https://api.gistmag.co.uk/blog/generate', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
title: '10 Tips for Better Productivity',
content: 'In this article, we explore proven strategies to improve your productivity...',
api_key: 'your_api_key_here',
image_style: 'realistic',
language: 'en'
})
});
const data = await response.json();
if (response.ok) {
console.log(`Generated ${data.images.length} images`);
console.log(`Excerpt: ${data.excerpt}`);
console.log(`Category: ${data.category}`);
console.log(`Tags: ${data.tags.join(', ')}`);
} else {
console.error('Error:', data);
}
Response
Array of generated images (up to 3 images)
URL of the generated image
The style of the image (realistic, illustration, abstract, minimalist, photographic)
Description of what the image represents
A concise 2-3 sentence summary of the blog post (max 200 characters)
An appropriate category name for the blog post (e.g., “Technology”, “Health”, “Business”)
Array of 5-8 relevant tags for the blog post
ISO 8601 timestamp of when the content was generated
Example Response
{
"images": [
{
"url": "https://oaidalleapiprodscus.blob.core.windows.net/private/...",
"style": "realistic",
"description": "Create a realistic style image representing: 10 Tips for Better Productivity..."
},
{
"url": "https://oaidalleapiprodscus.blob.core.windows.net/private/...",
"style": "realistic",
"description": "Create a realistic style image representing: 10 Tips for Better Productivity..."
},
{
"url": "https://oaidalleapiprodscus.blob.core.windows.net/private/...",
"style": "realistic",
"description": "Create a realistic style image representing: 10 Tips for Better Productivity..."
}
],
"excerpt": "Discover 10 proven strategies to boost your productivity and accomplish more in less time. Learn practical tips for time management, focus, and efficiency.",
"category": "Productivity",
"tags": [
"productivity",
"time management",
"efficiency",
"work-life balance",
"focus",
"organization",
"tips",
"self-improvement"
],
"generated_at": "2024-12-20T12:00:00.000Z"
}
Error Responses
Common Errors
400 Bad Request: Invalid request parameters (e.g., missing title, invalid image_style)
401 Unauthorized: Invalid or missing API key
402 Payment Required: Insufficient credits (requires 3 credits per generation)
500 Internal Server Error: Server error processing the request
Example Error Response
{
"error": "Insufficient Credits",
"message": "You don't have enough credits. Current balance: 1. Please purchase more credits or upgrade your plan."
}
Best Practices
- Provide Content When Possible: Including the blog post content helps generate more accurate excerpts, categories, and tags
- Choose Appropriate Image Style: Select an image style that matches your blog’s aesthetic
- Review Generated Content: Always review and edit the generated content to ensure it matches your brand voice
- Handle Image URLs: Generated image URLs are temporary - download and host them on your own server for permanent use
- Credit Management: Each generation costs 3 credits, so ensure you have sufficient credits before making requests
Rate Limits
The Blog Meta Generator follows the same rate limits as other GistMag API endpoints. Check your subscription tier for specific limits.