Omni Text
Endpoints

Extract content from document

Extract text content from uploaded documents and return it in the specified output format

POST
/v1/extract/{format}
x-api-key<token>

API key for authentication.

In: header

Path Parameters

formatstring

Output format

Value in"md" | "txt" | "html" | "markdown"

Query Parameters

mode?string

Processing mode

Default"auto"
fallback?string

Fallback processing mode

Default"auto"
filefile

Document file to extract content from

Formatbinary

Response Body

curl -X POST 'https://api.omnitext.io/v1/extract/md' \\\
  -H 'x-api-key: YOUR_API_KEY' \\\
  -F 'file=@/path/to/document.pdf'
{
  "content": "# Document Title\n\nThis is the extracted content...",
  "metadata": {
    "characters": 32150,
    "contentType": "application/pdf",
    "created": "2024-01-15T10:30:00Z",
    "creator": "John Doe",
    "extension": ".pdf",
    "last_author": "Jane Smith",
    "modified": "2024-01-20T14:45:00Z",
    "pages": 25,
    "raw": {},
    "subject": "Document processing",
    "title": "Sample Document Title",
    "words": 5420
  },
  "success": true
}
{
  "error": "Bad Request",
  "status": 400,
  "success": false
}
{
  "error": "Unauthorized",
  "status": 401,
  "success": false
}
{
  "error": "Over Free Credit Limit - Payment Required",
  "status": 402,
  "success": false
}
{
  "error": "Rate limit exceeded",
  "status": 429,
  "success": false
}
{
  "error": "Internal Server Error",
  "status": 500,
  "success": false
}