# Doc Parser

## Word Document Processing Guide

Document Parser API supports extraction of text from Microsoft Word documents (.doc and .docx).

### Endpoint

`POST /documents/parse`

### Word-Specific Configuration

```json
{
    "url": "string",         // URL of the Word document
    "type": "doc",          // Use "doc" for .doc or .docx files
    "output": "plain|markdown",
    "webhook": "string"     // Optional webhook URL
}
```

### Supported Word Features

* DOC format (.doc)
* DOCX format (.docx)
* Text content
* Tables (converted to text)
* Headers and footers
* Maximum file size: 50MB

### Example Request

```bash
curl --location 'https://api.yetanotherapi.com/documents/parse' \
--header 'x-api-key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
    "url": "https://example.com/document.doc",
    "type": "doc",
    "output": "markdown"
}'
```

### Response Format

Each page's content is separated by a page break marker:

```json
{
    "requestId": "string",
    "status": "COMPLETED",
    "data": "Page 1 content\n\n=== Page Break ===\n\nPage 2 content"
}
```

### Word-Specific Limitations

1. Macros are ignored
2. Comments are not included
3. Track changes are processed in their current state
4. Complex formatting may be simplified
5. Images are not processed


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.yetanotherapi.com/document-parser/doc-parser.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
