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 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
  • Comments: margin comments and their note text
For DOCX input, every change and comment also carries the author name and timestamp. See Output markup for the exact tags each input type returns. This allows you get a full revision history from your documents 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
The API accepts DOCX, PDF, and image files:
  • DOCX — tracked changes are extracted exactly from the document XML. Author names, timestamps, and comments are fully preserved.
  • PDF, images (PNG, JPEG, TIFF, etc.), and other formats — each page is rendered and read by a visual redline model that detects underlined or colored insertions, struck-through or bracketed deletions, “Inserted:” and “Deleted:” balloons, and margin comments. Scanned documents are handled the same way as digital PDFs. A page with no visible markup is returned as a plain parse, so you can submit a whole document without pre-filtering pages.
Submit your document to the dedicated Track Changes endpoint. The output will be provided in Markdown, HTML, and chunks format by default, with all tracked changes and comments preserved in the markup.
The extraction path is chosen from the file extension. When you pass a file_url whose path has no recognizable extension (for example https://example.com/download?id=123), the request is treated as DOCX. For PDFs and images behind opaque URLs, download the file and upload it with file instead.

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 document and extract its tracked changes using the REST API:

Output markup

The response contains your document with all tracked changes preserved inline. For DOCX input, each tag carries revision metadata:
  • 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>
For PDF and image input, the same tags are used but carry no author or timestamp attributes, because that metadata is not printed on the page:
  • Insertions: <ins>new text</ins>
  • Deletions: <del>old text</del>
  • Comments: <comment text="comment text">marked text</comment>
Only rely on data-revision-author, data-revision-datetime, and data-comment-author when the input is DOCX. Parse PDF and image output by tag name only.
Here is real Markdown output for the header of a public regulatory redline PDF, where the dates were bumped from 2023 to 2024. Edits are tagged at the character level:
This markup appears in HTML, Markdown, and chunks output. Markdown has no native syntax for insertions or comments, so the tags are kept as literal inline HTML.

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:

Pricing

Track Changes is billed as a conversion plus a $6 per 1,000 pages add-on, for every input type. See pricing for current rates.

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.