Skip to main content
The Parse.Run() method converts documents into structured JSON with text, tables, and figures. It runs OCR, detects document layout, and returns content organized into chunks optimized for LLM and RAG workflows.

Basic Usage


Method Signatures

Synchronous Parse

Asynchronous Parse

The RunJob method returns a JobID that you can use with client.Job.Get() to retrieve results.

Input Options

The DocumentURL parameter accepts several formats:

Configuration Examples

Chunking

By default, Parse returns the entire document as one chunk. For RAG applications, use variable chunking:

Table Output Format

Control how tables appear in the output:

Page Range

Process only specific pages:

Filter Blocks

Remove specific content types from output:

Asynchronous Processing

For long-running operations, use Parse.RunJob() to submit a job and poll for results:

Response Structure


Union Types

The Go SDK uses union types for responses that can have different structures. The ParseResponseResult can be either a ParseResponseResultFullResult (inline content) or a ParseResponseResultURLResult (URL to fetch content). Always check the Type field first, then use AsUnion() to cast to the specific type:

Error Handling


Next Steps