# 将上传的 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
{}
```
