Lorem Ipsum HTML API: Generate Formatted HTML Content

Testing a CMS, WYSIWYG editor, or rich text renderer? The Lorem Ipsum HTML API generates placeholder content with complete HTML formatting - headings, paragraphs, lists, blockquotes, and more.

Why HTML-Formatted Lorem Ipsum?

Plain text lorem ipsum is great for simple layouts, but real web content includes structure - headings that create hierarchy, lists for organized information, blockquotes for emphasis, and varied paragraph lengths.

The Lorem HTML API generates content that mirrors actual article structure, allowing you to test how your CSS handles all common HTML elements and how your CMS renders rich content.

Supported HTML Elements

The API can generate content with these HTML elements:

Text Structure

  • Headings (h1-h6)
  • Paragraphs (p)
  • Blockquotes (blockquote)

Lists

  • Unordered lists (ul/li)
  • Ordered lists (ol/li)

Inline Elements

  • Bold (strong)
  • Italic (em)
  • Links (a)
  • Code (code)
Customization: Enable or disable specific elements to match your content type - e.g., disable headings for comment testing.

Using the Lorem HTML API

TinyFn provides a comprehensive endpoint to generate formatted HTML content:

API Request
GET https://api.tinyfn.io/v1/generate/lorem/html?paragraphs=4
Headers: X-API-Key: your-api-key
Response
{
  "html": "<h2>Lorem Ipsum Dolor</h2>\n<p>Lorem ipsum dolor sit amet, <strong>consectetur adipiscing</strong> elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>\n<ul>\n  <li>Ut enim ad minim veniam</li>\n  <li>Quis nostrud exercitation</li>\n</ul>\n<p>Duis aute irure dolor in reprehenderit in <em>voluptate velit</em> esse cillum dolore eu fugiat nulla pariatur.</p>",
  "elements_used": ["h2", "p", "strong", "ul", "li", "em"],
  "word_count": 52
}

Parameters

Parameter Type Description
paragraphs integer Base number of paragraph elements (1-20, default: 4)
include_headings boolean Include h2/h3 headings (default: true)
include_lists boolean Include ul/ol lists (default: true)
include_formatting boolean Include bold/italic/code (default: true)
include_blockquotes boolean Include blockquote elements (default: false)

Code Examples

JavaScript / Node.js

const response = await fetch(
  'https://api.tinyfn.io/v1/generate/lorem/html?paragraphs=5&include_blockquotes=true',
  { headers: { 'X-API-Key': 'your-api-key' } }
);
const { html } = await response.json();
// Insert into DOM
document.getElementById('content').innerHTML = html;

Python

import requests

response = requests.get(
    'https://api.tinyfn.io/v1/generate/lorem/html',
    headers={'X-API-Key': 'your-api-key'},
    params={
        'paragraphs': 6,
        'include_headings': True,
        'include_lists': True
    }
)
html_content = response.json()['html']
# Save to file or use in template
with open('sample.html', 'w') as f:
    f.write(html_content)

cURL

curl "https://api.tinyfn.io/v1/generate/lorem/html?paragraphs=4" \
  -H "X-API-Key: your-api-key"

Common Use Cases

  • CMS Testing: Test WYSIWYG editor output rendering
  • CSS Development: Style all article elements with realistic content
  • Theme Development: Test WordPress/Ghost/etc themes with varied content
  • Email Templates: Test HTML email rendering with rich content
  • Print Stylesheets: Test print CSS with structured content

Best Practices

  1. Test all elements: Enable all options to ensure complete CSS coverage
  2. Vary content length: Generate both short and long articles
  3. Check sanitization: Ensure your app properly handles the HTML
  4. Test responsive: View generated content across all breakpoints
  5. Validate accessibility: Test heading hierarchy and list semantics

Use via MCP

Your AI agent can call this tool directly via Model Context Protocol — no HTTP code needed. Add TinyFn to Claude Desktop, Cursor, or any MCP client:

{
  "mcpServers": {
    "tinyfn-generate": {
      "url": "https://api.tinyfn.io/mcp/generate/",
      "headers": {
        "X-API-Key": "your-api-key"
      }
    }
  }
}

See all generator tools available via MCP in our Generator MCP Tools for AI Agents guide.

Try the Lorem HTML API

Get your free API key and start generating formatted HTML content.

Get Free API Key

Ready to try TinyFn?

Get your free API key and start building in minutes.

Get Free API Key