# 將上傳的 HTML 檔案解析為 markdown。

**API:** Data API

**Endpoint:** `POST /v1/beta/firecrawl/parse`

**Tags:** Firecrawl

將上傳的 HTML 檔案解析為 Markdown。以 multipart/form-data 傳送 file 與 options。檔案必須具有 text/html 內容類型，或使用 .html/.htm 檔名。options 是 JSON 字串，必須將 proxy 設為 basic，可將 formats 設為 ["markdown"]。options 欄位上限為 64 KB。回應包含 success 與 data.markdown。

### 計費參考

- 計量方式：方案資源單位。
- 參考請求估算：0.001071 美元。
- 單位成本基準：0.001071 美元。
- 資源單位：`firecrawl_credit`。
- 參考客戶倍率：1.0。不得對已結算的客戶金額再次應用。
- 成本基準不構成最終客戶價格，即使為零也不例外。

僅供參考的中繼資料，並非帳戶報價、保證價格或消費上限。資源額度並非 Felo 額度。最終費用依 Felo 計費記錄為準。

## Base URL

- `https://openapi.felo.ai`

## Authentication

- `FeloBearerAuth` (http bearer, bearer format Felo API Key)
- `FeloApiKey` (apiKey in header `X-API-Key`)

## Request body

Required: **yes**

### application/json

Schema:

```json
{
  "additionalProperties": false,
  "properties": {
    "file": {
      "type": "string",
      "description": "允許的檔名後綴：.htm、.html。"
    },
    "options": {
      "enum": [
        "{\"formats\":[\"markdown\"],\"proxy\":\"basic\"}"
      ],
      "type": "string"
    }
  },
  "required": [
    "file",
    "options"
  ],
  "type": "object"
}
```

Example:

```json
{
  "file": "example.htm",
  "options": "{\"formats\":[\"markdown\"],\"proxy\":\"basic\"}"
}
```

### application/x-www-form-urlencoded

Schema:

```json
{
  "additionalProperties": false,
  "properties": {
    "file": {
      "type": "string",
      "description": "允許的檔名後綴：.htm、.html。"
    },
    "options": {
      "enum": [
        "{\"formats\":[\"markdown\"],\"proxy\":\"basic\"}"
      ],
      "type": "string"
    }
  },
  "required": [
    "file",
    "options"
  ],
  "type": "object"
}
```

### multipart/form-data

Schema:

```json
{
  "additionalProperties": false,
  "description": "每個欄位都是單一 text/plain 部分；不支援重複欄位以及 JSON 物件／陣列部分。",
  "properties": {
    "file": {
      "type": "string",
      "description": "允許的檔名後綴：.htm、.html。"
    },
    "options": {
      "enum": [
        "{\"formats\":[\"markdown\"],\"proxy\":\"basic\"}"
      ],
      "type": "string"
    }
  },
  "required": [
    "file",
    "options"
  ],
  "type": "object"
}
```

## Responses

### 200 — 解析成功完成。

Headers:
- `X-Request-Id` (string) — 聯絡 Felo 支援時需提供的請求識別碼。

**application/json**

Schema: object

```json
{
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "parse 成功時為 true。"
    },
    "data": {
      "type": "object",
      "properties": {
        "markdown": {
          "type": "string",
          "description": "以 Markdown 表示的解析內容。"
        }
      }
    },
    "creditsUsed": {
      "type": "integer",
      "description": "消耗的 Firecrawl 額度（1 個）。"
    }
  }
}
```

### 400 — 無法處理該要求。請檢查請求參數。

### 401 — 需要有效的 Felo API 金鑰。

### 402 — 由於未符合計費要求，要求無法繼續。

### 403 — 該帳戶無權執行此操作。

### 429 — 已達到要求或支出上限。

### 502 — 服務無法完成該要求。

### 503 — API 或計費服務暫時無法使用。

### 504 — 服務在處理要求時逾時。

### default — 錯誤回應；上游透傳回應可能採用供應商格式

**application/json**

Schema:

```json
{}
```
