Upstage Document Parsing icon

Upstage Document Parsing

Convert documents into structured HTML/Markdown using Upstage Document Parse

Sync Parse (Upload File)

AI-generated

Summary

Uploads a document to Upstage's Document Parse API to extract structured content and layout elements, returning HTML, Markdown, Text, or an array of layout elements.

Inputs

  • binaryPropertyName (required) — Name of the binary property containing the file to upload (default: 'data').
  • model (required) — The parsing model to use (e.g., 'document-parse').
  • ocr (required) — OCR setting: 'auto' (image only) or 'force' (always).
  • base64Categories (required) — List of categories (e.g., 'table', 'figure') to return cropped base64 images for.
  • merge_multipage_tables (required) — Boolean flag to merge tables across pages.
  • outputFormats (required) — List of formats to include in the response (e.g., 'html', 'markdown').
  • coordinates (required) — Boolean flag to include bounding box coordinates for layout elements.
  • chartRecognition (required) — Boolean flag to convert charts to tables.
  • returnMode (required) — How to format the output: 'full' (entire JSON), 'content_html/markdown/text', or 'elements'.

Output shape

A single JSON item per input item. Content depends on 'returnMode' (e.g., full JSON, HTML string, Markdown string, or array of layout elements).

If the 'returnMode' is set to 'content_html', 'content_markdown', or 'content_text', the JSON object contains a single key (html, markdown, or text) with the formatted string. If the API request fails, the JSON includes an 'error' field with the message and a timestamp.

Examples

Example 1: Extract Markdown text from a PDF file

Set returnMode to 'Content → Markdown' and outputFormats to ['markdown'].

Example 2: Get layout elements with coordinates for structured data extraction

Set returnMode to 'Elements Array' and coordinates to true.

Example 3: Parse a complex document with charts and tables

Set chartRecognition to true and merge_multipage_tables to true.

Discussion