apyhub
Back
DATA EXTRACTION · DEVELOPER TOOLS

Extract Text from Word API

Hosted on ApyHub

What it does

The Word to Text API pulls the plain text out of Word documents. Upload a DOC or DOCX file (up to 100 MB) or send the URL of one hosted elsewhere, and get the full text back as a single JSON string. Set preserve_paragraphs to true to keep paragraph breaks, or leave it off to get the text as one continuous block.

Use it to make contracts and reports searchable, feed Word files into AI and analysis pipelines, check uploaded documents before storing them, or convert DOCX files to TXT in bulk.

For other document types, use the Extract Text from PDF API. To get a short summary instead of the full text, use the AI Summarize Documents API.

You can start on ApyHub's free tier with no card required.

▣ ENDPOINT 01 / 02
POST
Extract text from Word document at remote URL
https://api.eu.apyhub.com/apyhub/extract-text-from-word/url

QUICKSTART

GUIDE

Quickstart

Extract text from a Word document by sending its file URL.

curl -X POST "https://api.eu.apyhub.com/apyhub/extract-text-from-word/url" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://assets.apyhub.com/samples/sample.docx"
  }'

What you'll get back

Returns a JSON object with a data string field containing the extracted text from the Word document.

{
  "data": "Sample Word document paragraph one. Sample paragraph two."
}
TRY ITLIVE · 60 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
body*

About this endpoint

What it does

Extracts text from a Word document located at a remote URL and returns the extracted text as a JSON string.

Request Body

ParameterTypeMandatoryDescription
urlStringYesThe remote Word document URL to fetch and extract text from. Must be a valid URI.
preserve_paragraphsBooleanNoPreserves paragraph separation in the extracted text. Default: false.

Response

Returns a JSON object with a data string field containing the extracted text from the Word document.

ParameterTypeMandatoryDescription
dataStringYesThe extracted text content from the Word document.

Body

Name
Type
Description
bodyREQUIRED
object
▣ ENDPOINT 02 / 02
POST
Extract text from uploaded Word document
https://api.eu.apyhub.com/apyhub/extract-text-from-word/file

QUICKSTART

GUIDE

Quickstart

Upload a Word document to extract its text.

curl -X POST "https://api.eu.apyhub.com/apyhub/extract-text-from-word/file" \
  -H "apy-token: $APY_TOKEN" \
  -F "file=@/path/to/document.docx"

What you'll get back

Returns a JSON object with a data string field containing the extracted text from the Word document.

{
  "data": "Sample Word document paragraph one. Sample paragraph two."
}
TRY ITLIVE · 60 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
Max 100MB total per request (all files combined). Larger? Use this API's URL-based endpoint instead, if it has one.
body*
Word document (.doc or .docx).

About this endpoint

What it does

Uploads a Word document and extracts its text content. The response returns the extracted text as a JSON object with a data string field.

Request Body

ParameterTypeMandatoryDescription
fileStringYesWord document upload in binary form. Accepted formats: .doc or .docx.
preserve_paragraphsENUMNoControls paragraph preservation in the extracted output. Allowed values: true, false. Default: false.

Response

Returns a JSON object with a data string field containing the extracted text from the uploaded Word document. Success response is represented by a JSON object, typically returned with HTTP 200.

ParameterTypeMandatoryDescription
dataStringYesExtracted text from the Word document.

Body

Name
Type
Description
bodyREQUIRED
object

Max 100MB total per request (all files combined). Larger? Use this API's URL-based endpoint instead, if it has one.

▣ COMMON ERRORS

Errors any endpoint can return

400bad_request

Required parameter missing or malformed body.

401unauthorized

API key missing, revoked, or not authorized for this service.

429rate_limited

Your plan's per-second rate exceeded. Retry with exponential backoff.

503upstream_busy

Backend temporarily unavailable. Try again in a few seconds.