API
Text2Card API
Generate beautiful text cards programmatically. Simple REST API, no authentication required.
Lightning Fast
Edge-powered, globally distributed
5 Themes
All themes available via API
High Quality
1080p+ PNG output
Multi-language
Chinese & English text support
Quick Start
Generate a text card with a simple GET request:
GET https://your-domain.com/api/generate?text=Hello%20World&theme=minimalResult:
Parameters
| Parameter | Type | Description | Default |
|---|---|---|---|
text* | string | The text content to display on the card | - |
author | string | Author name shown at bottom | @text2card_design |
theme | string | minimal | editorial | bold | dark | gradient | minimal |
ratio | string | square | portrait | landscape | portrait |
Available Themes
minimaleditorialbolddarkgradientAspect Ratios
square1080×1080px
portrait1080×1440px
landscape1440×1080px
Code Examples
cURL
curl -o card.png "https://your-domain.com/api/generate?text=Design%20is%20intelligence%20made%20visible.&theme=minimal&ratio=portrait"HTML
<img src="https://your-domain.com/api/generate?text=Your%20Quote%20Here&theme=bold&ratio=square" alt="Text Card" />JavaScript
// Fetch and display the image
const text = encodeURIComponent("Design is intelligence made visible.");
const imageUrl = `https://your-domain.com/api/generate?text=${text}&theme=gradient&ratio=portrait`;
// Use in an img tag or download
const img = document.createElement('img');
img.src = imageUrl;
document.body.appendChild(img);POST Request
For longer text or when you need more control, use POST with JSON body:
// POST request for longer text
const response = await fetch('https://your-domain.com/api/generate', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
text: "This is a longer piece of text that you might want to send via POST instead of GET.",
author: "@yourname",
theme: "editorial",
ratio: "portrait"
})
});
const blob = await response.blob();
const imageUrl = URL.createObjectURL(blob);Rate Limits & Usage
The API is free to use with fair usage limits:
- • No authentication required
- • Reasonable rate limiting applied
- • Commercial use allowed
Ready to Build?
Start integrating Text2Card into your projects today.
Try the Editor