Translate HTML content while preserving all markup, tags, attributes, and document structure. Only the visible text content is translated, leaving HTML elements and attributes intact.
HTTP Request
| |
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
source | string | No | "auto" | Source language code. Use auto for automatic detection |
target | string | Yes | — | Target language code |
Request Body
Send the HTML content as the raw request body with Content-Type: text/html.
| |
Response
| |
Response Fields
| Field | Type | Description |
|---|---|---|
status | boolean | Whether the request was successful |
data.translated_html | string | The translated HTML with markup preserved |
data.source_language | string | Detected or specified source language code |
data.source_language_name | string | Human-readable name of the source language |
Code Examples
| |
| |
| |
Related Endpoints
- Translate Markdown — Translate Markdown content
- Translate XML — Translate XML content
- Translate — Translate plain text