> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pawa-ai.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Documents Parsing

> Pawa AI offers enterprise-level document processing, combining cutting-edge OCR technology with advanced structured data extraction from any files such as images, audio, pdfs, docx, html, pptsx, xlsx, etc...Experience faster processing speeds, unparalleled accuracy, and cost-effective solutions, all scalable to meet your needs.

Pawa AI Document Parsing extracts text, tables, and structured data from various document formats. Perfect for **digitizing paper documents**, **processing forms**, and **building document analysis workflows**.

Unlock the full potential of your documents with our multilingual support, annotations and adaptable workflows for all document types, enabling you to extract, comprehend, and analyze information with ease.

> **Document Parsing Example**

<img src="https://mintcdn.com/sartifycoltd/h3QvoufTX15l3Mnz/images/Document%20understanding.png?fit=max&auto=format&n=h3QvoufTX15l3Mnz&q=85&s=db40d7d2ea7527ae31c5dfb3c1982925" alt="Document Parsing Example" className="w-full" width="1932" height="1216" data-path="images/Document understanding.png" />

### Parsing Based Models in Pawa AI.

Currently we have one parsing model, full advanced, OCR built-in:

* **pawa-v1-parser-20250809**: Structured extraction and data understanding for unstructured text, enabling automation and insights.

## Some Use Cases of Our Document Parsing API

<div className="grid grid-cols-1 md:grid-cols-2 gap-4 my-6">
  <div className="rounded-xl border border-neutral-800 bg-neutral-900 p-4">
    <div className="text-lg">📄 <strong>Invoice Processing</strong></div>
    <p className="text-neutral-300 text-sm mt-1">Extract vendor details, amounts, dates, and line items from invoices for automated accounting.</p>
  </div>

  <div className="rounded-xl border border-neutral-800 bg-neutral-900 p-4">
    <div className="text-lg">📋 <strong>Form Digitization</strong></div>
    <p className="text-neutral-300 text-sm mt-1">Convert paper forms into structured data for databases and workflow automation.</p>
  </div>

  <div className="rounded-xl border border-neutral-800 bg-neutral-900 p-4">
    <div className="text-lg">📊 <strong>Report Analysis</strong></div>
    <p className="text-neutral-300 text-sm mt-1">Extract tables, charts, and key metrics from business reports and presentations.</p>
  </div>

  <div className="rounded-xl border border-neutral-800 bg-neutral-900 p-4">
    <div className="text-lg">📚 <strong>Knowledge Base</strong></div>
    <p className="text-neutral-300 text-sm mt-1">Process documents for searchable knowledge bases and document management systems.</p>
  </div>

  <div className="rounded-xl border border-neutral-800 bg-neutral-900 p-4">
    <div className="text-lg">📝 <strong>Contract Analysis</strong></div>
    <p className="text-neutral-300 text-sm mt-1">Extract key terms, dates, and clauses from legal documents and contracts.</p>
  </div>

  <div className="rounded-xl border border-neutral-800 bg-neutral-900 p-4">
    <div className="text-lg">🏥 <strong>Medical Records</strong></div>
    <p className="text-neutral-300 text-sm mt-1">Process patient forms, prescriptions, and medical reports for digital health systems.</p>
  </div>
</div>

### Supported Formats

Pawa AI can parse and understand a wide range of formats, including:

* **PDFs**
* **DOCX**
* **Excel (XLSX)**
* **PowerPoint (PPTX)**
* **Images (PNG)**
* **Audio files**
* **Web links / HTML**

### Documents Parsing Request Example

```bash theme={null}
curl --request POST \
  --url https://api.pawa-ai.com/v1/documents/parse \
  --header "Authorization: Bearer $PAWA_AI_API_KEY" \
  --header 'Content-Type: multipart/form-data' \
  --form model=pawa-v1-parser-20250809 \
  --form documents=@example-file
```

### Response format example

```json theme={null}
{
  "success": true,
  "message": "Documents parsed successfully",
  "data": [
    {
      "fileName": "file.pdf",
      "fileType": "application/pdf",
      "fileSize": 123456,
      "content": "This is the content of the document."
    }
  ]
}
```

### Use Chat Request to get Structured Data After Extraction

After parsing a document, use Pawa AI's chat models to extract structured data, answer questions, or analyze the content.

To learn more about structured data, visit [here](/capabilities/structured).

#### Example to get structured request

```bash theme={null}
# 1. Parse the invoice
curl --request POST \
  --url https://api.pawa-ai.com/v1/documents/parse \
  --header "Authorization: Bearer $PAWA_AI_API_KEY" \
  --header 'Content-Type: multipart/form-data' \
  --form model=pawa-v1-parser-20250809 \
  --form documents=@example-file

# 2. Extract structured data using chat
    curl https://api.pawa-ai.com/v1/chat/request \
      -H "Content-Type: application/json" \
      -H "Authorization: Bearer $PAWA_AI_API_KEY" \
      -d '{
        "model": "pawa-v1-blaze-20250318",
    "messages": [
      {
        "role": "system",
        "content": [
          {
            "type": "text",
            "text": "Extract invoice data and return as JSON with fields, as given in the response_format"
          }
        ]
      },
      {
        "role": "user",
        "content": [
          {
            "type": "text",
            "text": "Extract data from this invoice is :\n\n'here put the actual textual data extracted.........'"
          }
        ]
      }
    ], 
    "response_format": {
    "type": "json_schema",
    "json_schema": {
      "name": "invoice_extractor",
      "strict": true,
      "schema": {
        "type": "object",
        "properties": {
          "reference_id": {
            "type": "string",
            "description":"The id of the invoice",
            "pattern": "^\\d+$"
          }
        },
        "required": [
          "reference_id"
        ],
        "additionalProperties": false
      }
    }
  }
  }'
```

### Best Practices for Structured Extraction

* **Be specific in prompts**: Clearly define the JSON schema you want
* **Use examples**: Show the model the format you expect
* **Validate output**: Always parse and validate the JSON response
* **Handle errors**: Check for malformed JSON and retry if needed
* **Batch processing**: Process multiple documents with the same extraction template

### Limits

* **File size**: Maximum 15MB per document
* **Rate limits**: Based on your subscription plan
