コンテンツへスキップ
White page Kit
日本語

APIドキュメント

ホワイトページサイトを作成し、進行状況を追跡し、ファイルを自分のコード、ノーコードツール、または単にAIアシスタントに依頼してダウンロード。すべてのリクエストはHTTPS経由のJSONです。

しくみ

接続方法に関わらず3つのステップ:

  1. APIキーを作成する サインインし、ダッシュボードのAPIキーを開いてキーを作成してください。アカウントのパスワードのように機能するため、秘密にしてください。
  2. サイトを依頼する タイトルと言語、必要に応じてトピック、対象読者、キーワードを送信してください。生成価格は残高から差し引かれ、サイトの構築が始まります。
  3. サイトを受け取る 通常、数分で準備が整います。ステータスを確認するか、完了時にあなたのURLを呼び出すように設定し、その後プレビュー、編集、ファイルのダウンロードを行います。

接続方法を選択する

ノーコードツール:HTTPリクエストを送信できるもの(Zapier、Make、n8n、スプレッドシートのスクリプトなど)は、同じ呼び出しを実行できます。POST /sitesでサイトを開始し、GET /sites/{uuid}をタイマーやcallback_urlで実行すると、完了したかどうかがわかります。APIキーはAuthorizationヘッダーに入れてください。

重要な用語

サイト
すべてのページを含む1つの生成されたウェブサイト。uuidで識別されます。
ステータス
ビルド中はpending、準備ができるとdone、失敗した場合はerrorになります。失敗したサイトは自動的に返金されます。
APIキー
リクエストがあなたのアカウントから送信されたことを証明する秘密の文字列です。ダッシュボードでキーを作成・破棄できます。
残高
アカウント内の前払い金。サイトの作成時に生成価格がここから確保されます。
コールバック
サイトが完成したときに一度だけ呼び出すあなたのURL。何度も確認し続ける必要がありません。
冪等性キー
同じリクエストを2回送っても、2つのサイトを作成したり課金したりしないようにするためにつけるラベル。

AIアシスタントと使う

AIアシスタントと接続して、単に「私の歯科医院のサイトをトルコ語で作って」と言うだけ。アシスタントはあなたのアカウントの下で同じAPIを呼び出します。あなたがコントロールを保ちます:サイト作成には残高が必要で、良いアシスタントは作成前にあなたに確認します。

あなたが言えること

  • 残高はいくらで、サイト1つあたりの費用はいくらですか?
  • どのデザインキットがベーカリーに適していますか?
  • 静かな港のゲストハウス、アルダーハウスの1ページサイトを英語で作成してください。
  • 私のサイトは準備できていますか?プレビューリンクを送ってください。

MCP(Claude、Cursorなど)を通じて接続する

MCPはアシスタントが外部ツールを呼び出すためのオープンスタンダードです。アシスタントにMCPのURLを指定し、APIキーをBearerトークンとして渡してください。

Claude Code

bash

claude mcp add --transport http whitepagekit https://whitepagekit.com/api/v1/mcp \
  --header "Authorization: Bearer YOUR_API_KEY"

Cursor

~/.cursor/mcp.json

{
  "mcpServers": {
    "whitepagekit": {
      "url": "https://whitepagekit.com/api/v1/mcp",
      "headers": {
        "Authorization": "Bearer ${env:WPK_API_KEY}"
      }
    }
  }
}

Claude Desktop

claude_desktop_config.json

{
  "mcpServers": {
    "whitepagekit": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "https://whitepagekit.com/api/v1/mcp",
               "--header", "Authorization:${WPK_AUTH}"],
      "env": { "WPK_AUTH": "Bearer YOUR_API_KEY" }
    }
  }
}

生のJSON-RPC

curl

curl -X POST https://whitepagekit.com/api/v1/mcp \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"get_account","arguments":{}}}'

Claude Desktopはmcp-remoteブリッジを通じてリモートサーバーにアクセスします。これはNode.jsが必要です。.

ChatGPT(カスタムGPT)

  1. ChatGPTでGPTを作成し、設定を開いて「新しいアクションを作成」を選択します。
  2. 「URLからインポート」を選び、https://whitepagekit.com/api/v1/openapi.json?profile=assistantを貼り付けます。このトリムされたスキーマは6つのアシスタントツールのみを含んでいます。
  3. 認証下でAPIキーを選び、認証タイプをBearerに設定し、APIキーを貼り付けます。
  4. ChatGPTは何かを変更するリクエストに対し確認を求めるので、残高がかかるものはあなたが制御できます。

Schema URL

https://whitepagekit.com/api/v1/openapi.json?profile=assistant

OpenAI API(MCPツール)

Responses APIはMCP URLをリモートツールとして使用できます。require_approvalは人間による承認を維持します。

Python

from openai import OpenAI

client = OpenAI()
response = client.responses.create(
    model="YOUR_MODEL",
    tools=[{
        "type": "mcp",
        "server_label": "whitepagekit",
        "server_url": "https://whitepagekit.com/api/v1/mcp",
        "headers": {"Authorization": "Bearer YOUR_API_KEY"},
        "require_approval": "always",
    }],
    input="What does one site cost, and which design kits suit a bakery?",
)
print(response.output_text)

独自のツールループ(関数呼び出し)

モデルループを自分で実行する場合、既製のツールスキーマを取得し、それぞれのツール呼び出しを対応するRESTエンドポイントで実行します。フォーマットはopenai(Responses API)、openai-chat、anthropic、mcpです。

curl

curl "https://whitepagekit.com/api/v1/ai-tools?format=openai"   # or openai-chat, anthropic, mcp

6つのツール

6つのツール
ツール 何をするか REST コール コスト
get_account あなたの残高と1つのサイトの費用を表示します。 GET /me 無料
list_languages サイトが書かれている可能性のある言語を一覧表示します。 GET /languages 無料
list_themes トピックまたはスタイルでデザインキットを検索します。 GET /themes 無料
create_site サイトの生成を開始し、生成価格を残高から差し引きます。 POST /sites バランスを使用
get_site 1つのサイトを表示します:進行状況、プレビューリンク、ダウンロードリンク。 GET /sites/{uuid} 無料
list_sites あなたのサイトを一覧表示し、新しいものを最初に表示します。 GET /sites 無料

これらのドキュメントを任意のAIに提供してください

このページはプレーンなMarkdownとしても利用可能で、チャットに貼り付けたり、コーディングアシスタントに渡したりするのに最適です:

Markdown

https://whitepagekit.com/api/v1/docs.md

貼り付け可能なプロンプト

Prompt

You can build websites with the White Page Kit API. Read https://whitepagekit.com/api/v1/docs.md first.
My API key is in the environment variable WPK_API_KEY.
Check my balance and the price, then create a site for my dental clinic in Izmir, in Turkish,
wait until it is ready and send me the preview link.

安全性とコスト

  • create_site のみが残高を消費します。他の5つのツールは読み取り専用です。
  • アシスタント用には別のキーを使用してください。ダッシュボードで有効期限とレート制限を設定し、いつでも取り消せます。
  • アシスタントはサイトの削除、設定の変更、支払い処理はできません:それらのルートはツールとしては公開されていません。
  • create_site で idempotency_key を設定し、再試行時に二重請求されないようにします。失敗した生成は返金されます。
  • ページの編集、参照画像、ZIPダウンロードはREST APIとダッシュボードに残ります。

クイックスタート

3つのコールでブリーフからダウンロード可能なサイトまで進みます。YOUR_API_KEYをダッシュボードのキーに置き換えてください。

1. 生成を開始する

POST /sites はブリーフを検証し、残高から生成価格を予約して即座に応答します。

curl

curl -X POST https://whitepagekit.com/api/v1/sites \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: order-1042-attempt-1" \
  -d '{"title":"Alder House","lang":"en","sector":"guesthouse","keywords":"quiet stay, harbour","structure":"onepage"}'

レスポンスは新しいサイトとともに202 Acceptedです。

202 Accepted

{
  "success": true,
  "data": {
    "uuid": "550e8400-e29b-41d4-a716-446655440000",
    "status": "pending",
    "title": "Alder House",
    "lang": "en",
    "preview_url": null,
    "download_url": null
  }
}

2. ステータスをポーリングする

GET /sites/{uuid} を約5~20秒ごとにポーリングしてステータスが完了またはエラーになるまで確認するか、ポーリングの代わりにコールバックURLを使用してください。

curl

curl https://whitepagekit.com/api/v1/sites/550e8400-e29b-41d4-a716-446655440000 \
  -H "X-API-Key: YOUR_API_KEY"

3. ファイルをダウンロードする

完了したサイトはZIPとしてダウンロードされます。formatはmultiまたはonepage、assetsはinlineまたはexternalです。

curl

curl -o site.zip \
  -H "X-API-Key: YOUR_API_KEY" \
  "https://whitepagekit.com/api/v1/sites/550e8400-e29b-41d4-a716-446655440000/download?format=multi&assets=inline"

コードで同じフローを実行する

PHP

<?php
$ch = curl_init('https://whitepagekit.com/api/v1/sites');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_POST => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . getenv('WPK_API_KEY'),
        'Content-Type: application/json',
        'Idempotency-Key: order-1042-attempt-1',
    ],
    CURLOPT_POSTFIELDS => json_encode(['title' => 'Alder House', 'lang' => 'en']),
]);
$site = json_decode(curl_exec($ch), true)['data'];
do {
    sleep(5);
    $ch = curl_init('https://whitepagekit.com/api/v1/sites/' . $site['uuid']);
    curl_setopt_array($ch, [CURLOPT_RETURNTRANSFER => true,
        CURLOPT_HTTPHEADER => ['X-API-Key: ' . getenv('WPK_API_KEY')]]);
    $site = json_decode(curl_exec($ch), true)['data'];
} while ($site['status'] === 'pending');

Node.js

const headers = {
  Authorization: `Bearer ${process.env.WPK_API_KEY}`,
  'Content-Type': 'application/json',
  'Idempotency-Key': 'order-1042-attempt-1',
};
let { data: site } = await (await fetch('https://whitepagekit.com/api/v1/sites', {
  method: 'POST', headers,
  body: JSON.stringify({ title: 'Alder House', lang: 'en' }),
})).json();
while (site.status === 'pending') {
  await new Promise((r) => setTimeout(r, 5000));
  ({ data: site } = await (await fetch(`https://whitepagekit.com/api/v1/sites/${site.uuid}`, { headers })).json());
}

Python

import os, time, requests

headers = {"Authorization": f"Bearer {os.environ['WPK_API_KEY']}",
           "Idempotency-Key": "order-1042-attempt-1"}
site = requests.post("https://whitepagekit.com/api/v1/sites", headers=headers,
                     json={"title": "Alder House", "lang": "en"}).json()["data"]
while site["status"] == "pending":
    time.sleep(5)
    site = requests.get(f"https://whitepagekit.com/api/v1/sites/{site['uuid']}", headers=headers).json()["data"]

認証

OpenAPIドキュメントを除くすべてのリクエストにAPIキーを送信してください。キーはサーバーに保管し、ブラウザコードやURLに決して入れないでください。

  • ヘッダー:Authorization: Bearer YOUR_API_KEY または X-API-Key: YOUR_API_KEY。
  • ダッシュボードでキーを作成、取り消し、レート制限できます。キーには有効期限とIP許可リストを設定可能です。
  • 自分のサイトのみが表示されます。他のアカウント所有のサイトは404 not_foundを返します。
  • ?lang=xx または Accept-Language を追加してエラーメッセージをローカライズしてください。

冪等性

POST /sites にIdempotency-Key(8~80文字:文字、数字、_および-)を送信してください。同じキーを繰り返すと元のサイトが返され、二重課金はされませんので、タイムアウト後の再試行も安全です。失敗した生成を再試行するには新しいキーを使用してください。

Webhook(コールバック)

callback_urlをPOST /sitesに渡す(またはアカウントWebhookを設定)し、ジョブが完了した(site.completed)または失敗した(site.failed)ときに1回のJSON POSTを受け取ります。

POST callback_url

{
  "event": "site.completed",
  "uuid": "550e8400-e29b-41d4-a716-446655440000",
  "status": "done",
  "site_title": "Alder House",
  "lang": "en",
  "domain": null,
  "created_at": "2026-01-15T09:30:00+00:00",
  "preview_url": "https://whitepagekit.com/preview?uuid=550e8400-…"
}

アカウントにWebhookシークレットがある場合、すべてのリクエストには生のボディのHMAC-SHA256であるX-Webhook-Signature: sha256=<hex>が付与されます。JSONを解析する前にこれを定数時間比較で検証してください。

PHP

$raw = file_get_contents('php://input');
$expected = 'sha256=' . hash_hmac('sha256', $raw, $webhookSecret);
if (!hash_equals($expected, $_SERVER['HTTP_X_WEBHOOK_SIGNATURE'] ?? '')) {
    http_response_code(401);
    exit;
}

Node.js

import crypto from 'node:crypto';

const expected = 'sha256=' + crypto
  .createHmac('sha256', webhookSecret).update(rawBody).digest('hex');
const received = req.get('x-webhook-signature') ?? '';
const ok = received.length === expected.length
  && crypto.timingSafeEqual(Buffer.from(received), Buffer.from(expected));

各コールバックは一度だけ試行され、タイムアウトは10秒で再試行されません。通知として扱い、GET /sites/{uuid}で整合性を取ってください。uuidとイベントで冪等に繰り返しを処理してください。プライベートネットワークのターゲットは拒否されます。

エラー

すべてのレスポンスはエンベロープを使用します。エラーには安定的なコード、ローカライズされたメッセージ、および検証エラーの場合は失敗したフィールドが含まれます。

JSON

{
  "success": false,
  "error": {
    "code": "validation_error",
    "message": "...",
    "details": { "field": "title" }
  }
}
エラー
HTTPエラーコード
400 validation_error, invalid_json, invalid_webhook_url
401 missing_api_key
402 insufficient_balance
403 api_disabled, invalid_api_key, forbidden
404 not_found, route_not_found
405 method_not_allowed
409 site_not_ready, conflict, edits_reset_required
413 payload_too_large
415 unsupported_media_type
429 rate_limited
500 internal_error, export_failed
502 generation_failed

制限

制限
制限 値
キーごとのリクエスト数 デフォルトで1分あたり60回(キーごとに設定可能、0 = 無制限)。同じIPからの無効なキーの繰り返しは429でRetry-Afterが返されます。
リクエストボディ 2MB;参照画像を含むPOST /sitesは最大162MB;エディターの保存は最大4MB。
参照画像 最大12枚のPNG、JPEG、またはWEBP画像(base64またはdata URL)、それぞれ最大10MB。
エディターページの内容 HTMLは最大500,000文字、CSSは最大100,000文字。スクリプトとイベントハンドラーは削除されます。
サイト画像 PNG、JPEG、WEBP、またはGIF、各5MBまで、サイトあたり最大200枚。
サイトタイトル サイトタイトル 1〜200文字。

エディターAPI

ダッシュボードエディターが行うすべての操作は、完成したサイトに対しても利用可能です:ページ内容、ページおよびセクションの計画、スタイル、タイトル/テーマ/レイアウト/構造、トラッキング、画像。ページ編集はページを置き換えます;DELETEは生成されたページを復元します。

curl

# Load, change and save a page
curl -H "X-API-Key: YOUR_API_KEY" \
  "https://whitepagekit.com/api/v1/sites/UUID/editor?page=index"
curl -X PATCH https://whitepagekit.com/api/v1/sites/UUID/editor \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"page":"index","html":"<main>…</main>","css":""}'
# Restore the generated page
curl -X DELETE -H "X-API-Key: YOUR_API_KEY" \
  "https://whitepagekit.com/api/v1/sites/UUID/editor?page=index"

編集には完成したサイトが必要です(そうでない場合は409 site_not_ready)。編集済みのページに対してテーマ、レイアウト、構造を変更すると、reset_editsがtrueでない限り409 edits_reset_requiredが返されます。編集は無料です。

エンドポイントリファレンス

OpenAPIドキュメントから生成されているため、常にライブAPIと一致します。パスはベースURLに対して相対的です。

アカウント

  • GET /me

    Get the authenticated account

  • GET /transactions

    List account balance transactions

カタログ

  • GET /languages

    List enabled supported languages

  • GET /themes

    List site themes

  • GET /layouts

    List enabled layouts

サイト

  • GET /sites

    List the authenticated account's sites

  • POST /sites

    Start site generation

  • GET /sites/{uuid}

    Get site status and refresh generation state

  • DELETE /sites/{uuid}

    Delete a terminal site and its generated data — Pending, queued and running generation jobs cannot be deleted. Wait for done or error; active deletion returns 409 conflict without refunding or removing the job.

  • GET /sites/{uuid}/download

    Download a completed site archive

AIと自動化

  • GET /ai-tools

    Function-calling tool schemas — The same six tools the MCP endpoint offers, as JSON schemas for your own tool loop. format is openai (Responses API), openai-chat (Chat Completions), anthropic or mcp. Public; no response envelope.

  • GET /docs.md

    Documentation as Markdown — The developer guide, endpoint reference and AI integration guide as one Markdown file, written for language models and quick copy-paste. Public.

  • POST /mcp

    Model Context Protocol endpoint — MCP over Streamable HTTP (JSON-RPC 2.0, one JSON reply per POST). Methods: initialize, ping, tools/list, tools/call. Tools: get_account, list_languages, list_themes, create_site (paid), get_site, list_sites. Authenticate with the same API key; point an MCP client at this URL.

エディター

  • GET /sites/{uuid}/editor

    Load a page for editing — Editor access for the site owner's API key; mirrors the dashboard editor. Only completed sites (409 site_not_ready otherwise).

  • PATCH /sites/{uuid}/editor

    Save a page's edited content — Replaces the page content and CSS. html must be non-empty (use DELETE to restore the generated page); scripts, event handlers and javascript: URLs are removed, HTML is limited to 500000 and CSS to 100000 characters, request body to 4 MB. Returns the saved page as GET does.

  • DELETE /sites/{uuid}/editor

    Restore a page's generated content — Discards the page's saved edits. Returns the regenerated page.

  • GET /sites/{uuid}/editor/canvas

    Get editing canvas data — Stylesheet, Tailwind theme, body class, direction, section blocks, icons and sample copy an external visual editor needs to render the page like the dashboard editor.

  • GET /sites/{uuid}/pages

    Get the page and section plan — Returns structure, pages with their sections and edited flag, one-page sections and the sections available to add. Same payload as the dashboard.

  • POST /sites/{uuid}/pages

    Save the page and section plan — Body: pages (list of {slug, title, nav, sections}; the first page is index) and, for onepage sites, onepage_sections. Sections of pages with saved edits are locked in the dashboard; edited pages that are removed lose their edits. At most 12 pages.

  • GET /sites/{uuid}/style

    Get style overrides — Returns stored overrides, effective colors, fonts, radius and density, and the allowed font, radius and density values.

  • POST /sites/{uuid}/style

    Save or reset style overrides — Send style ({colors, fonts: {heading, body}, radius, density}) or reset=true to return to the theme.

  • GET /sites/{uuid}/design

    Get site title, theme and layout — Returns site_title, title_suggestions, theme_variant, theme_mode, layout, structure and whether the site has saved edits.

  • POST /sites/{uuid}/design

    Change site title, theme, mode, layout or structure — theme_variant, theme_mode, layout and structure are required; site_title (1-200 characters), apply_blueprint and reset_edits are optional. Changing theme, layout or structure while pages have saved edits returns 409 edits_reset_required unless reset_edits is true; renaming alone keeps edits.

  • GET /sites/{uuid}/tracking

    Get tracking settings

  • POST /sites/{uuid}/tracking

    Save tracking settings — Body: tracking {ga4_measurement_id, google_ads_id, google_ads_conversion_label, meta_pixel_id, privacy_policy_url, terms_url}. Applied to exports; an empty object removes all tracking.

  • GET /sites/{uuid}/media

    List uploaded site images

  • POST /sites/{uuid}/media

    Upload or delete site images — multipart/form-data with one or more files in files[] (PNG, JPEG, WEBP or GIF, 5 MB each, at most 200 images per site), or JSON {"action": "delete", "name": <name>}. Returns the updated list for uploads. 409 conflict when the per-site image limit is reached.

外部支払い(管理者キー専用)

  • GET /payment-sites

    List external payment sites owned by the admin API account — Admin role required; payment.manage permission alone is insufficient. Webhook secrets are never returned.

  • POST /payment-sites

    Register an external payment site (admin only)

  • PATCH /payment-sites/{id}

    Update an owned external payment site (admin only)

  • DELETE /payment-sites/{id}

    Delete an owned external payment site (admin only) — Deletion is allowed only when the site has no orders. Sites with orders must be disabled instead.

  • GET /payments

    List external orders owned by the admin API account

  • POST /payments

    Create external checkout or automatic subscription (admin only) — Server-to-server only. Separate from wallet top-ups: no White Page Kit balance, bonus or referral credit. Repeated idempotency key returns the original order; a different payload or reused external order ID conflicts. Provider uncertainty never starts a second checkout automatically.

  • GET /payments/{uuid}

    Read owned external payment status (admin only)

  • POST /payments/{uuid}/cancel

    Cancel an owned subscription or locally close a pending one-time order (admin only) — Subscriptions stop future renewals. Pending one-time cancellation is a local close, not a refund; an already-open provider checkout may still accept payment. A late authenticated real payment remains recorded and notified. No payment is marked paid by a browser return.

  • POST /payments/{uuid}/approve

    Approve funds received for an owned pending or locally cancelled bank transfer (admin only) — Manual confirmation of funds received, including a transfer arriving after local cancellation; never approves a Dodo or Enigmoss order and never credits White Page Kit balance.

説明はOpenAPIドキュメントからのもので英語です。リクエストおよびレスポンスのスキーマはschemaファイルにあります。

既製の統合

統合キットは、ジェネレーターのフォーム、状態ポーリング、署名付きコールバックガイダンス、およびこのAPIとサーバーサイドプロキシ経由で通信する完全なビジュアルエディターを備えた小さなPHPアプリケーションです。アカウントを作成してキーを取得し、それぞれの生成にかかる価格を参照してください。