> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pocketutils.com/llms.txt
> Use this file to discover all available pages before exploring further.

# XBEL to HTML

> Convert an XBEL bookmark archive into a Netscape-format HTML file every browser can import.

Converts an XBEL bookmark file into the Netscape Bookmark HTML format that Chrome, Firefox, Safari, and Edge all accept as an import. Folders, nested folders (up to 100 levels deep), separators, and `<alias>` references are all walked and rendered in their original order; dates are converted from XBEL's ISO 8601 to the Unix-seconds format the HTML format expects.

<Info>
  **1 credit** per call · Typical response time \~110ms
</Info>

## Request

`multipart/form-data`, not JSON.

<ParamField body="file" type="file" required>
  The `.xbel` file to convert — must already be plain XBEL XML. Max **10 MB**. Must have a `.xbel` extension (or be sent as `application/octet-stream`). If your file is encrypted, run it through [XBEL Decryptor](/api-reference/xbel-decrypt) first.
</ParamField>

## Response

<ResponseField name="success" type="boolean" required />

<ResponseField name="downloadUrl" type="string" required>
  Absolute URL to fetch the converted HTML file from — `GET` it directly, no auth required. Valid for **30 minutes**.
</ResponseField>

<ResponseField name="fileName" type="string" required>
  Suggested filename for the download, derived from your upload (e.g. `bookmarks.xbel` → `bookmarks.html`).
</ResponseField>

<ResponseField name="message" type="string" required />

## Download the result

`GET` the `downloadUrl` from the response directly — it streams the file with a `Content-Disposition: attachment` header, ready to import in any browser's bookmark manager. No credit cost, no auth required. After 30 minutes the file is deleted and the link 404s.

## Errors

| Status | Cause                                                              |
| ------ | ------------------------------------------------------------------ |
| `400`  | No file attached to the request                                    |
| `500`  | The file isn't valid XML, or has no `<xbel>` root element          |
| `404`  | (on the download endpoint) the file's 30-minute window has expired |

See the full [error reference](/errors) for the platform-level codes (`401`, `402`, `429`) that apply to every endpoint.

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST https://api.pocketutils.com/v1/xbel-to-html \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -F "file=@bookmarks.xbel"
  ```

  ```javascript JavaScript theme={null}
  const form = new FormData();
  form.append("file", fileInput.files[0]);

  const res = await fetch("https://api.pocketutils.com/v1/xbel-to-html", {
    method: "POST",
    headers: { Authorization: "Bearer YOUR_API_KEY" },
    body: form,
  });
  const { downloadUrl } = await res.json();
  ```

  ```python Python theme={null}
  import requests

  with open("bookmarks.xbel", "rb") as f:
      res = requests.post(
          "https://api.pocketutils.com/v1/xbel-to-html",
          headers={"Authorization": "Bearer YOUR_API_KEY"},
          files={"file": f},
      )
  download_url = res.json()["downloadUrl"]
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "success": true,
    "downloadUrl": "https://api.pocketutils.com/v1/xbel-to-html/download/converted-1784541632760.html",
    "fileName": "bookmarks.html",
    "message": "File converted successfully"
  }
  ```
</ResponseExample>


## Related topics

- [Introduction](/index.md)
- [Rate Limits & Credits](/rate-limits-and-credits.md)
- [XBEL Decryptor](/api-reference/xbel-decrypt.md)
