API
Text2Card API
APIで美しいテキストカードを生成。シンプルなREST API、認証不要。
超高速
エッジ処理、グローバル配信
5種類のテーマ
全テーマがAPI経由で利用可能
高画質
1080p+ PNG出力
多言語対応
日本語・中国語・英語をサポート
クイックスタート
シンプルなGETリクエストでテキストカードを生成:
GET https://your-domain.com/api/generate?text=Hello%20World&theme=minimal結果:
パラメータ
| パラメータ | 型 | 説明 | デフォルト |
|---|---|---|---|
text* | string | カードに表示するテキスト | - |
author | string | 下部に表示する著者名 | @text2card_design |
theme | string | minimal | editorial | bold | dark | gradient | minimal |
ratio | string | square | portrait | landscape | portrait |
利用可能なテーマ
minimaleditorialbolddarkgradientアスペクト比
square1080×1080px
portrait1080×1440px
landscape1440×1080px
コード例
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
長いテキストやより細かい制御が必要な場合は、JSONボディでPOSTリクエスト:
// 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);利用制限
APIは無料で利用可能、合理的な制限あり:
- • 認証不要
- • 適切なレート制限を適用
- • 商用利用可
始めましょう
今すぐText2CardをプロジェクトにIntegrate。
エディターを試す