トピック

OG画像APIリファレンス

OG画像APIリファレンスでは、FastOGで動的なOpen Graph画像を生成するためのエンドポイント、パラメータ、テンプレートカタログについて説明します。APIはサブスクリプション制限があり、有効なDynamic APIプランが必要ですが、レンダリング自体は従量課金されません: 月間のレンダリングクォータや超過課金はありません。HMAC署名付きURLにより、各リクエストは安全に保たれます。サインアップしてDynamic APIプランを選択し、ダッシュボードでAPIキーとHMACシークレットを作成してください。有料APIのレンダリングはクリーンです。生成されたOpenAPIコントラクトは、パラメータ、エラーコード、テンプレートスラッグの正式な機械可読リストです。

ベースURL

https://fastog.com/api/v1/og

認証

すべてのリクエストには HMAC-SHA256 署名認証が必要です。公開 key と s 署名はクエリパラメータです。ヘッダーベースの認証は現在サポートされていません。詳細は HMAC ドキュメント を参照してください。

エンドポイント

GET /api/v1/og

指定されたパラメータに基づいて動的なOG画像を生成します。

クエリパラメータ

パラメータ 型 必須 説明
template string いいえ テンプレート名(デフォルト: default)
title string はい メイン見出し。必須です。タイトルのないカバーは有用なプレビューになりません。
subtitle string いいえ サブタイトルまたは説明テキスト
key string はい 完全なAPIキー
s string はい HMAC-SHA256署名(64桁の16進文字)

テンプレート固有のパラメータ

すべてのテンプレートは、以下の共通パラメータに加えて、テンプレート固有のパラメータを受け付けます(インデックスの表を参照してください)。templateクエリパラメータで使用するレイアウトを選択します(デフォルト: default)。

共通パラメータ(すべてのテンプレート)

パラメータ 型 説明
title string メイン見出しのテキスト
subtitle string 補足テキスト
tags list カンマ区切りのタグラベル
theme string dark | light | glass | solid | midnight | vivid | paper | glass_light | custom
gradient_preset string 名前付きグラデーションプリセット(例: indigo、ocean、sunset、cosmic)
gradient_direction number グラデーションの角度(度単位、デフォルト 135)
bg_color hex 単色の背景色
pattern string 背景パターン(grid、dots、noise、none、…)
pattern_color hex パターンの色
pattern_intensity number パターンの不透明度(1〜30)
font_family string font-sans、font-jakarta、font-dm、font-outfit、font-space、font-playfair、font-merriweather、font-instrument、font-jetbrains、font-fira
accent_color hex ハイライト用のアクセントカラー
auto_text_color bool 背景からテキスト色を導出(デフォルト true)
title_color hex タイトル色を上書き
subtitle_color hex サブタイトル色を上書き
brand_name string ブランド/ロゴのテキスト(デフォルト FastOG)
brand_logo string ブランドロゴ画像のURL
layout_mode string split | centered | banner(テンプレート固有のバリアントが適用されます)

テンプレート一覧 — レンダリング可能な slug は 67 件、選択可能な slug は 48 件。以下の表は、よく使われる見た目とテンプレート固有の props をまとめたものです。網羅的な生成リスト(ラベル、カテゴリ、retired フラグ、および受け付けられるすべての slug)は /openapi.json の x-template-catalogue にあり、各テンプレートのエディターフィールド(key、label、type、default、options、URL 形式)は x-template-fields にあります。retired の slug もレンダリング可能なまま残るため、すでに公開されている URL は引き続き動作しますが、ピッカーには表示されません。

template テンプレート カテゴリ 追加パラメータ
default デフォルト ブランド —
blog ブログ記事 コンテンツ author, date, domain
ecommerce Eコマース コマース price, original_price, rating, rating_total, features, badge, cta, image, domain
company 企業 ブランド domain, logo, tag
launch 製品ローンチ ブランド kicker, version, tag, cta, domain
saaslaunch SaaSローンチ ブランド kicker, cta, domain
devtool 開発者ツール 開発者 version, badge, domain
game ゲーム コンテンツ price, rating, image, domain
event イベント ソーシャル location, host, date, domain
quote 引用 ソーシャル quote, author_name, author_title
job 求人募集 ソーシャル location, department, salary, job_type, domain
stats 統計 データ metric, metric_label, delta
pricing 料金 コマース price, period, cta
podcast ポッドキャスト メディア episode_number, guest_name, guest_role, duration
video 動画 メディア duration, channel, views
editorial エディトリアル コンテンツ kicker, author, date, domain
minimal ミニマル ブランド domain
changelog 変更履歴 開発者 version, tag
corporate コーポレート ブランド kicker, tag, domain
hero ヒーロー ブランド kicker, cta, status, domain
imageright 画像右配置 コマース kicker, price, original_price, rating, rating_total, badge, cta, image, domain
specgrid スペックグリッド コマース specs (`Label
logos ロゴウォール ブランド kicker, brand_logos, domain
notice お知らせ ソーシャル notice_status, notice_icon, notice_text, date, domain
testimonial お客様の声 ソーシャル quote, author_name, author_title, company, author_avatar, rating, rating_total, quote_style
logofocus ロゴフォーカス コンテンツ kicker, domain
xheader Xヘッダー ソーシャル size, handle, followers, location, website, avatar
bento Bento データ kicker, tiles, domain
comparison 比較 コマース kicker, left_label, left_desc, left_points, right_label, right_desc, right_points, verdict
timeline タイムライン コンテンツ kicker, milestones, domain
countdown カウントダウン ブランド kicker, target_date, cta, domain
news ニュース コンテンツ headline, byline, author, date, source, image
code コード 開発者 code, language, terminal_title, author, domain
testimonialpro お客様の声 Pro ソーシャル quote, author_name, author_title, company, author_avatar, rating, rating_total, cta
product 製品 コマース badge, title, price, original_price, rating, rating_total, features, cta, image, layout_mode
promo プロモ ブランド brand_name, benefits, title, subtitle, domain, layout_mode
devblog 開発ブログ コンテンツ category, title, subtitle, tags, author, author_title, date, read_time, views, likes, comments, code, language, file_path
codepost コード記事 コンテンツ category, date, title, subtitle, author, read_time, code, file_path, language
statsbar 統計バー データ kicker, metric, metric_label, delta, stats, domain
changelogpro 変更履歴 Pro 開発者 version, tag, title, changes, features, domain
quotecta 引用CTA ソーシャル quote, author_name, author_title, company, cta, domain
appscreenshot アプリのスクリーンショット メディア badge, title, subtitle, app_name, rating, screenshot, domain
realestate 不動産 コマース title, subtitle, price, beds, baths, sqft, cta_text, status, image_url, domain
autorental レンタカー コマース title, subtitle, rate_badge, cta_text, fleet_tag, image_url, domain
restaurant レストラン コマース kicker, title, subtitle, price, cta_text, badge, image_url, domain
hospitality ホスピタリティ メディア kicker, title, subtitle, rate, cta_text, image_url, domain
saasspend SaaS支出 ブランド status_pill, title, subtitle, cta_text, stat_callout, dashboard_image, domain
brutalist ブルータリスト ブランド agency_tag, title, subtitle, cta_text, footer_note, domain
training トレーニング ソーシャル track, dates, title, subtitle, cta_text, location, image_url, domain
ecosystem エコシステム 開発者 kicker, title, subtitle, apps_list, dock_label, domain

glassproduct は cta も受け付けます。ecommerce、product、glassproduct、imageright のテンプレートではデフォルトで「Shop now」が表示されます。視覚的なピルを非表示にするには、cta を空の値に設定してください。

構造化パラメータの型

型 形式 例
list カンマ区切りの値 features=Fast,Cheap,Secure
tiles 行区切りの label|value ペア tiles=Requests|12.4M\nUptime|99.99%
milestones 行区切りの date|title|description milestones=Q3 2026|Alpha|Invite-only
changes 行区切りの type|text (added,fixed,improved,removed) changes=added|Bento templates

レスポンス

  • 200 OK — PNG 画像データを返します
  • 401 Unauthorized — 認証が無効または欠落しています
  • 422 Unprocessable — テンプレートパラメータが無効です

エラーレスポンス

エラーコード HTTP ステータス 説明
missing_signature 401 key または s パラメータが欠落しています
invalid_signature 401 署名の検証に失敗しました

リクエスト例

GET /api/v1/og?template=blog&title=Hello%20World&subtitle=A%20test%20post&key=sk_quick_123abc&s=a1b2c3...

cURL の例

bash
curl "https://fastog.com/api/v1/og?template=blog&title=Hello%20World&key=sk_quick_123abc&s=<signature>"

料金と制限

FastOG はサブスクリプション制です。有効な Dynamic API プランが必要です。レンダリングは従量課金されません — 月間のレンダリングクォータや超過課金はありません。プランがゲートとなり、すべてのティアでカウンターなしにレンダリングできます。現在のティアと価格については料金をご覧ください。

キャッシュされた画像は無料です: Cloudflare のエッジキャッシュから配信されるリクエスト(同じテンプレート + パラメータであれば、以前にキャッシュされた URL 上の s 署名に関係なく)はオリジンに到達しないため、同一の URL で別のレンダリングを消費することはありません。

デフォルトでクリーン: すべてのレンダリングはクリーンです — どのプランにもウォーターマークはなく、無料の OG Image Tester、Studio のプレビュー、Studio のエクスポートにもありません。「Made with FastOG」バッジを明示的に要求する呼び出し元のために fastog_watermark レンダープロップは引き続きサポートされていますが、自動的に設定されることはありません。

無料で試す — サインアップ不要

動的OG画像を数秒でプレビューおよびテスト。

無料のOG画像テスターを開く

A BeCaSimulations site