Convert Word to HTML API Integration Guide
Convert DOC and DOCX files into readable HTML for browser viewing and content workflows.
Convert Word to HTML
Convert DOC or DOCX documents into readable HTML for browser viewing, content migration and document review. Headings, paragraphs, lists and supported images can be retained. Complex layouts and fonts may differ; active content is removed.
Upload a document
Send one Word file up to 20 MiB. Encrypted, damaged and unsupported documents are rejected. This endpoint accepts uploads, not a remote document URL.
curl --request POST \
'https://api.gugudata.io/v1/imagerecognition/word-to-html?appkey=YOUR_APPKEY' \
--form 'file=@./sample.docx'
| Parameter | Location | Required | Meaning |
|---|---|---|---|
appkey |
Query | Yes | Your application key. Keep it on your server. |
file |
Multipart | Yes | DOC or DOCX, maximum 20 MiB. |
Read the result
This example illustrates the structure; use the actual URL returned by your request.
{
"dataStatus": {
"requestParameter": "input=file&bytes=32768",
"statusCode": 200,
"statusDescription": "successfully",
"dataTotalCount": 1
},
"data": {
"html_url": "https://storage.example/converted.html",
"html_content": "<!doctype html><html><head><meta charset=\"utf-8\"></head><body><p>Project notes</p></body></html>"
}
}
| Field | Type | Meaning |
|---|---|---|
data.html_url |
String | HTTPS link to the converted HTML file. |
data.html_content |
String, optional | Converted HTML when included, up to 20 MiB in UTF-8. |
Result links are public. Only upload documents you are permitted to share this way. Save the downloaded file if you need to retain it; permanent hosting is not guaranteed. Display HTML in an isolated viewer under your application’s content policy.
Try the sample
The Demo converts this Word sample. Compare its project notes, headings and checklist with the output.
Demo results are cached for 15 minutes. X-GuGuData-Demo-Mode reports live or cached; X-GuGuData-Generated-At identifies generation time. Failed conversions are not cached as successful results.
Handle errors
| HTTP status | Meaning |
|---|---|
400 |
Missing file or invalid parameters. |
401 / 403 |
Authentication or access denied. |
413 |
Input exceeds 20 MiB. |
422 |
Invalid or encrypted document, conversion failure or oversized output. |
429 |
Rate or usage limit reached. |
502 |
Conversion timeout or invalid response. |
503 |
Conversion or storage unavailable. |
500 |
Unexpected service error. |
Check HTTP status and dataStatus.statusCode. Invalid parameters use business code 400; conversion failures use 500. Avoid immediate retry loops after a timeout: the earlier request may already have consumed processing resources.
Related APIs
See the API details and OpenAPI specification.