ホーム/開発者
API

Text2Card API

APIで美しいテキストカードを生成。シンプルなREST API、認証不要。

超高速

エッジ処理、グローバル配信

5種類のテーマ

全テーマがAPI経由で利用可能

高画質

1080p+ PNG出力

多言語対応

日本語・中国語・英語をサポート

クイックスタート

シンプルなGETリクエストでテキストカードを生成:

GET https://your-domain.com/api/generate?text=Hello%20World&theme=minimal

結果:

Example output

パラメータ

パラメータ説明デフォルト
text*stringカードに表示するテキスト-
authorstring下部に表示する著者名@text2card_design
themestringminimal | editorial | bold | dark | gradientminimal
ratiostringsquare | portrait | landscapeportrait

利用可能なテーマ

minimalminimal
editorialeditorial
boldbold
darkdark
gradientgradient

アスペクト比

square

1080×1080px

portrait

1080×1440px

landscape

1440×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。

エディターを試す
Text2Card - 美しいテキストカードを作成