{
  "openapi": "3.0.1",
  "info": {
    "title": "Document Compare API: Redline PDF, Word & Text Diff",
    "description": "Compare two versions of a PDF, Word, HTML or text document: get a redline PDF, a Word file with tracked changes and every change listed, with edited amounts, dates and shall/may flagged.",
    "version": "0.1",
    "x-build-id": "q7iBSMNiQXhjsBUaG"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/jumblemog~document-compare/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-jumblemog-document-compare",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/jumblemog~document-compare/runs": {
      "post": {
        "operationId": "runs-sync-jumblemog-document-compare",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/jumblemog~document-compare/run-sync": {
      "post": {
        "operationId": "run-sync-jumblemog-document-compare",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "original": {
            "title": "Original document",
            "type": "string",
            "description": "The earlier version. A link to a PDF, Word .docx, HTML, Markdown or text file (Google Drive, Google Docs and Dropbox share links work), base64 of a PDF or .docx, or the text itself."
          },
          "revised": {
            "title": "Revised document",
            "type": "string",
            "description": "The later version, compared against the original. A link to a PDF, Word .docx, HTML, Markdown or text file (Google Drive, Google Docs and Dropbox share links work), base64 of a PDF or .docx, or the text itself."
          },
          "uploads": {
            "title": "Or upload two files",
            "type": "array",
            "description": "Upload the original first, then the revised (PDF, .docx, HTML, Markdown or text), or pick two files already in an Apify key-value store."
          },
          "requests": {
            "title": "More pairs",
            "type": "array",
            "description": "Several comparisons in one run: each entry is {\"original\": ..., \"revised\": ...} (also old/new, before/after, v1/v2), or \"link1 vs link2\". Optional per entry: title, ignoreCase, ignorePunctuation, ignoreNumbering, show, outputs, pageSize, author. Up to 50 pairs."
          },
          "ignoreCase": {
            "title": "Ignore case",
            "type": "boolean",
            "description": "Treat 'Agreement' and 'agreement' as the same.",
            "default": false
          },
          "ignorePunctuation": {
            "title": "Ignore punctuation",
            "type": "boolean",
            "description": "Compare words only: added or removed commas, periods and quotes don't count.",
            "default": false
          },
          "ignoreNumbering": {
            "title": "Ignore list numbering",
            "type": "boolean",
            "description": "Leave out the number or letter at the start of a paragraph (1., 2.3, (a), iv.) so renumbered clauses don't show as changes.",
            "default": false
          },
          "show": {
            "title": "Redline shows",
            "enum": [
              "all",
              "changes"
            ],
            "type": "string",
            "description": "For the PDF and HTML redlines. The Word file always holds the whole document.",
            "default": "all"
          },
          "outputs": {
            "title": "Files",
            "type": "array",
            "description": "The files to make for each pair. Every change is also in the dataset item.",
            "items": {
              "type": "string",
              "enum": [
                "pdf",
                "docx",
                "html",
                "csv"
              ],
              "enumTitles": [
                "Redline PDF",
                "Word (.docx) with tracked changes",
                "Redline HTML page",
                "Changes CSV"
              ]
            },
            "default": [
              "pdf",
              "docx",
              "html",
              "csv"
            ]
          },
          "pageSize": {
            "title": "PDF page size",
            "enum": [
              "letter",
              "a4"
            ],
            "type": "string",
            "description": "Page size of the redline PDF.",
            "default": "letter"
          },
          "author": {
            "title": "Tracked-change author",
            "type": "string",
            "description": "The name Word shows on each tracked change ('Document Compare' by default)."
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}