MostlyRender

SDKs と統合

MostlyRender はプレーンな REST API です — HTTP クライアントを備えたあらゆる言語から使用できます。Python SDK と Zapier アプリも提供しています。

# Python

依存関係なし(stdlib のみ)、Python 3.8+。

bash
pip install mostlyrender
python
from mostlyrender import MostlyRender

mr = MostlyRender("mr_live_…")  # or base_url="https://mostly-render-api.web.app"

mr.render("tpl_abc", modifications={"title": "Hello"})           # → { id, url, output }
mr.render_batch(template_id="tpl_abc", items=[{"title": "A"}])    # → { results, count, ok }
mr.screenshot("https://stripe.com", full_page=True)              # → { id, url, output }
mr.list_templates()                                              # → { templates: [...] }
mr.get_account()                                                 # → { plan, email, display_name }

job = mr.render_async("tpl_abc", output="pdf", webhook_url="https://your.app/hook")
final = mr.wait_for_render(job["id"])                            # polls until done

エラーは .status.body を持つ MostlyRenderError を発生させます。Errors を参照してください。

# Zapier

Zapier で API キーを使用して MostlyRender に接続します(GET /v1/account に対して検証されます)。アクション:

  • テンプレートをレンダリング — テンプレートの修正を入力して、画像 URL を取得します。
  • URL をスクリーンショット — ページをキャプチャします。
  • テンプレートはドロップダウンで提供されます(GET /v1/templates で powered)。

# cURL / REST

SDK が実行するすべてのことは直接 REST 呼び出しです:

bash
curl https://api.mostlyrender.com/v1/renders \
  -H "Authorization: Bearer mr_live_…" \
  -H "Content-Type: application/json" \
  -d '{ "template": "tpl_abc", "modifications": { "title": "Hello" } }'

完全なマシン可読の契約は OpenAPI spec です — 独自のクライアント ジェネレータまたは Postman にインポートしてください。API reference でインタラクティブに参照してください。