apyhub
DATA EXTRACTION · DEVELOPER TOOLS

Extract Text from Word API

Hosted on ApyHub

What it does

Word Text Extraction pulls plain text out of .doc and .docx files and returns it as a single data string. Send a remote document URL or upload a file, and get the extracted text back without dealing with Word-specific parsing in your own code.

Use the /url endpoint when the document is already hosted remotely, or /file when you have the binary upload in hand. Both endpoints accept an optional preserve_paragraphs setting so you can keep paragraph breaks when the structure matters, or flatten the text when you only need the content.

This is useful for indexing contracts, ingesting office documents into search, or normalising user-uploaded Word files before passing them into downstream workflows. If you need document text for analysis, storage, or moderation, Word Text Extraction gives you a simple text payload you can process immediately.

The response schema is intentionally minimal: you get extracted text in data, with no extra document metadata to filter out.

▣ ENDPOINT 01 / 02
POST
Extract text from Word document at remote URL
http://localhost:8080/apyhub/extract-text-from-word/url
QUICKSTARTGUIDE

Quickstart

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

curl -X POST "http://localhost:8080/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
http://localhost:8080/apyhub/extract-text-from-word/file
QUICKSTARTGUIDE

Quickstart

Upload a Word document to extract its text.

curl -X POST "http://localhost:8080/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.