If you need to extract plain or structured text from Microsoft Word documents for automation, indexing, or analysis, GroupDocs.Parser Cloud SDK for Node.js offers a reliable RESTful solution. With just a few lines of code, you can extract content from .doc and .docx files without installing Microsoft Word or using any server-side tools.
- Word Document Text Extraction API
- How to Extract Text from Word using Node.js
- Extract Text from Word via cURL
- Online Word Text Extractor
Word Document Text Extraction API
The GroupDocs.Parser Cloud SDK for Node.js is a wrapper for the REST API that simplifies extracting:
- Text (full document or selective pages).
- Tables and structured data.
- Metadata and embedded fields.
- Attachments and images.
It supports various formats, including PDF, Word, Excel, PowerPoint, MSG, ZIP, and more.
Prerequisites
- Create an account at GroupDocs.Cloud Dashboard.
- Get your Client ID and Client Secret.
- Install SDK:
npm install groupdocs-parser-cloud
You may consider visiting the following article to learn more about, how to obtain your Client ID and Client Secret for authentication.
Word Document Text Extraction API
Please follow the steps given below for information on how to extract text from a Word document using the Node.js SDK.
Step 1: Initialize Configuration:
const { ParserApi, Configuration, ImagesRequest, FileInfo, ImagesOptions } = require("groupdocs-parser-cloud");
const config = new Configuration("YOUR_CLIENT_ID", "YOUR_CLIENT_SECRET");
const parserApi = new ParserApi(config);
Step 2: Setup File Info and Text Options: Initialize an object of the TextRequest class and pass the instance of the TextOptions class.
const fileInfo = new FileInfo();
// path to your Word file
fileInfo.filePath = "sample.docx";
const options = new TextOptions();
options.fileInfo = fileInfo;
const request = new TextRequest(options);
Step 3: Extract Text from Word File: Invoke the text method, and it will return the plain text content from Word document.
parserApi.text(request).then(response => {
console.log("Extracted text content:");
console.log(response.text);
}).catch(err => {
console.error("Error extracting text:", err);
});
You can see the output of the above code sample in the image below:

Extract Text from Word via cURL
If you prefer command-line operations or want to integrate into a script? You can extract text from Word document using cURL and GroupDocs.Parser REST API.
Step 1 – Generate Access Token:
curl -X POST "https://api.groupdocs.cloud/connect/token" \
-d "grant_type=client_credentials&client_id=YOUR_CLIENT_ID&client_secret=YOUR_CLIENT_SECRET" \
-H "Content-Type: application/x-www-form-urlencoded"
Step 2 – Extract Text via API Call:
curl -v -X POST "https://api.groupdocs.cloud/v1.0/parser/text" \
-H "accept: application/json" \
-H "authorization: Bearer {ACCESS_TOKEN}" \
-H "Content-Type: application/json" \
-d
"{
\"FileInfo\":
{
\"FilePath\": \"sample.docx\",
\"StorageName\": \"internal\"
},
\"StartPageNumber\": 0,
\"CountPagesToExtract\": 1
}"
- Replace <ACCESS_TOKEN> with the one you generated.
Benefits of using cURL with GroupDocs.Parser API
- ✅ No SDK installation.
- ✅ Cross-platform automation.
- ✅ Ideal for shell scripts & CI pipelines.
- ✅ Efficient and lightweight.
Online Word Text Extractor
Use our Free Online Word Text Extractor powered by GroupDocs.Parser Cloud if you prefer a no-code option.

Conclusion
With GroupDocs.Parser Cloud SDK for Node.js, you can easily extract text from Word documents (.docx or .doc) for automation, indexing, or data mining. The SDK and REST API offer flexible and scalable options, whether you prefer Node.js or direct cURL commands.
📚 Additional Resources
Frequently Asked Questions – FAQs
- Can I extract text from DOCX tables too?
- Yes. GroupDocs.Parser can extract structured content, including table cells and layout data.
- Is Microsoft Word required?
- No. The API runs in the cloud and does not depend on Microsoft Office.
- What is the pricing model?
- We offer a single pay as you go pricing model. For further information, please visit pricing guide.
- Can I have free trial?
- Yes. Once you are subscribed to free trial account, you can make 150 API calls per month for free. Please visit pricing guide for further details.