Skip to main content
If you’re working with legal documents, contracts, or any collaborative review process, you know how painful it is to manually track all the changes, comments, and revisions in Word documents. This guide shows you how to extract all that markup programmatically using the Track Changes API.

Overview

The Track Changes API extracts:
  • Tracked changes: insertions and deletions with author names and timestamps
  • Comments: all margin comments with author details
This allows you get a full revision history from your Word docs into clean HTML and Markdown. track_changes is perfect for legal workflows where you need to:
  • Generate redline summaries for clients
  • Identify all changes made by specific parties
  • Extract action items from comments
  • Analyze negotiation patterns across contract versions
  • Create audit trails of document revisions
Submit your Word document to the dedicated Track Changes endpoint. The output will be provided in Markdown and HTML format by default, with all tracked changes and comments preserved in the markup.

Quick Start (SDK)

The simplest way to extract tracked changes is with the Python SDK:

Making the API Request

Here’s how to submit a Word document and extract its tracked changes using the REST API:
The response will contain your document with all tracked changes preserved. Here’s what the markup looks like:
  • Insertions: <ins data-revision-author="Sandy Kwon" data-revision-datetime="2025-11-11T11:24:00">new text</ins>
  • Deletions: <del data-revision-author="Vikram Oberoi" data-revision-datetime="2025-11-11T10:34:00">old text</del>
  • Comments: <comment data-comment-author="Vikram Oberoi" data-comment-datetime="2025-11-11T10:32:00" data-comment-initial="VO" text="comment text">marked text</comment>
This markup will appear in both HTML and Markdown output.

Analyzing Changes with LLMs

Once you have the extracted markup, you can use an LLM to analyze the changes. Here’s an example using OpenRouter to generate a redline summary:

Pagination

For longer documents, you may want to preserve page breaks in the output so you can split them. Set paginate to True in your request:
For Markdown output, each page will preceded by a horizontal rule containing the page number:
For HTML output, each page will be wrapped in a div with the page number:
This makes it easy to process documents page-by-page or display them with proper pagination in your UI.

Full Code Sample

Here’s a complete example that extracts tracked changes and generates a legal review summary:

Next Steps

Document Conversion

Explore the full conversion API and output format options.

Structured Extraction

Extract structured data from documents using JSON schemas.

Pipelines

Chain processors into versioned, reusable pipelines.

SDK Conversion

Use the Python SDK for simpler document conversion workflows.