API v1
為開發者準備的 API
一次 API 呼叫即可取得 HTML、CSS、切分圖片、結構化 JSON 與品質報告。
01
驗證
AUTH每個請求都需要 Authorization: Bearer <API_KEY> 標頭。登入後可在我的工作區核發金鑰。
02
轉換請求
RECONSTRUCTcURL
curl -X POST https://gumson.com/api/v1/reconstruct \ -H "Authorization: Bearer i2h_your_api_key" \ -F "image_file=@product-page.jpg" \ -F "mode=full" \ -F "format=json"
| 參數 | 類型 | 說明 |
|---|---|---|
| image_file | file | 要轉換的圖片。JPG、PNG 或 WebP,最大 25 MB。 |
| image_url | string | 可改為傳入遠端圖片網址,取代 image_file。 |
| mode | string | full(預設)・text・assets |
| format | string | json(預設)・html・zip |
| lang | string | 輸出文字的語言。預設為原始語言。 |
| webhook_url | string | 非同步作業完成時要通知的網址。 |
03
回應
RESPONSEJSON
{
"id": "cnv_9f2a…",
"status": "done",
"sections": 8,
"quality": 94,
"html": "<section class=…>",
"css": ".i2h-hero{…}",
"assets": [
{ "name": "product-01.png", "url": "https://…" }
],
"review_zones": [
{ "y": 4120, "h": 380, "reason": "low_contrast_text" }
]
}
04
狀態碼
ERRORS| 代碼 | 意義 | 處理方式 |
|---|---|---|
| 400 | 請求格式錯誤 | 請檢查參數。 |
| 401 | 驗證失敗 | 請檢查您的 API 金鑰。 |
| 402 | 點數不足 | 請檢查您的方案。 |
| 413 | 檔案過大 | 請縮減至 25 MB 以下。 |
| 429 | 超過速率限制 | 請稍候再重試。 |