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
RunJob method returns a JobID that you can use with client.Job.Get() to retrieve results.
Input Options
TheDocumentURL 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, useParse.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. TheParseResponseResult 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
- Learn about extracting specific fields from parsed documents
- Explore response format details for complete structure
- Check out best practices for optimization