If so you can download any of the below versions for testing. The product will function as normal except for an evaluation limitation. At the time of purchase we provide a license file via email that will allow the product to work in its full capacity. If you would also like an evaluation license to test without any restrictions for 30 days, please follow the directions provided here.
If you experience errors, when you try to download a file, make sure your network policies (enforced by your company or ISP) allow downloading ZIP and/or MSI files.

Installation
The package is available at Packagist and it can be installed via Composer by executing following command:
composer require groupdocscloud/groupdocs-comparison-cloud

Requirements
- PHP 8.2 or later
- Composer
- PHP extensions — curl, json, mbstring
- GroupDocs Cloud credentials — Client ID and Client Secret from the Dashboard
Dependencies
The SDK requires the following packages:
| Package | Constraint |
|---|
| guzzlehttp/guzzle | ^6.5.8 or ^7.4.5 |
| ext-curl | * |
| ext-json | * |
| ext-mbstring | * |
Quick Start
Get your API credentials
To use GroupDocs.Comparison Cloud, sign up at GroupDocs.Cloud Dashboard and get your Client ID and Client Secret.
Initialize the API
Use the following code to start using the GroupDocs.Comparison Cloud SDK for PHP:
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Get your ClientId and ClientSecret at https://dashboard.groupdocs.cloud
$configuration = new GroupDocs\Comparison\Configuration();
$configuration->setAppSid("YourClientId");
$configuration->setAppKey("YourClientSecret");
$configuration->setApiBaseUrl("https://api.groupdocs.cloud");
$compareApi = new GroupDocs\Comparison\CompareApi($configuration);
See the full example in Utils.php.
Compare two documents
Once initialized, use this basic example to compare two Word documents in cloud storage and get a link to the result.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
use GroupDocs\Comparison\Model;
use GroupDocs\Comparison\Model\Requests;
$configuration = new GroupDocs\Comparison\Configuration();
$configuration->setAppSid("YourClientId");
$configuration->setAppKey("YourClientSecret");
$configuration->setApiBaseUrl("https://api.groupdocs.cloud");
$compareApi = new GroupDocs\Comparison\CompareApi($configuration);
$sourceFile = new Model\FileInfo();
$sourceFile->setFilePath("source_files/word/source.docx");
$targetFile = new Model\FileInfo();
$targetFile->setFilePath("target_files/word/target.docx");
$options = new Model\ComparisonOptions();
$options->setSourceFile($sourceFile);
$options->setTargetFiles([$targetFile]);
$options->setOutputPath("output/result.docx");
$request = new Requests\comparisonsRequest($options);
$response = $compareApi->comparisons($request);
echo "Output file link: " . $response->getHref() . "\n";
See the full example in CompareDocuments.php.
Compare Password-Protected Documents
This example compares two Word documents and supplies a password for each file.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
use GroupDocs\Comparison\Model;
use GroupDocs\Comparison\Model\Requests;
$configuration = new GroupDocs\Comparison\Configuration();
$configuration->setAppSid("YourClientId");
$configuration->setAppKey("YourClientSecret");
$configuration->setApiBaseUrl("https://api.groupdocs.cloud");
$compareApi = new GroupDocs\Comparison\CompareApi($configuration);
$sourceFile = new Model\FileInfo();
$sourceFile->setFilePath("source_files/word/source.docx");
$sourceFile->setPassword("1231");
$targetFile = new Model\FileInfo();
$targetFile->setFilePath("target_files/word/target.docx");
$targetFile->setPassword("5784");
$options = new Model\ComparisonOptions();
$options->setSourceFile($sourceFile);
$options->setTargetFiles([$targetFile]);
$options->setOutputPath("output/result.docx");
$request = new Requests\comparisonsRequest($options);
$response = $compareApi->comparisons($request);
echo "Output file link: " . $response->getHref() . "\n";
See the full example in CompareProtectedDocuments.php.
Get List of Changes
This example retrieves the changes detected between a source document and a target document.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
use GroupDocs\Comparison\Model;
use GroupDocs\Comparison\Model\Requests;
$configuration = new GroupDocs\Comparison\Configuration();
$configuration->setAppSid("YourClientId");
$configuration->setAppKey("YourClientSecret");
$configuration->setApiBaseUrl("https://api.groupdocs.cloud");
$compareApi = new GroupDocs\Comparison\CompareApi($configuration);
$sourceFile = new Model\FileInfo();
$sourceFile->setFilePath("source_files/word/source.docx");
$targetFile = new Model\FileInfo();
$targetFile->setFilePath("target_files/word/target.docx");
$options = new Model\UpdatesOptions();
$options->setSourceFile($sourceFile);
$options->setTargetFiles([$targetFile]);
$options->setOutputPath("output/result.docx");
$changes = $compareApi->postChanges(new Requests\postChangesRequest($options));
echo "Changes count: " . count($changes) . "\n";
See the full example in GetListOfChanges.php.
Accept or Reject Changes
This example rejects every detected change, accepts the first one, and saves the updated document.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
use GroupDocs\Comparison\Model;
use GroupDocs\Comparison\Model\Requests;
$configuration = new GroupDocs\Comparison\Configuration();
$configuration->setAppSid("YourClientId");
$configuration->setAppKey("YourClientSecret");
$configuration->setApiBaseUrl("https://api.groupdocs.cloud");
$compareApi = new GroupDocs\Comparison\CompareApi($configuration);
$sourceFile = new Model\FileInfo();
$sourceFile->setFilePath("source_files/word/source.docx");
$targetFile = new Model\FileInfo();
$targetFile->setFilePath("target_files/word/target.docx");
$options = new Model\UpdatesOptions();
$options->setSourceFile($sourceFile);
$options->setTargetFiles([$targetFile]);
$options->setOutputPath("output/result.docx");
$changes = $compareApi->postChanges(new Requests\postChangesRequest($options));
for ($i = 0; $i < count($changes); $i++) {
$changes[$i]->setComparisonAction(Model\ChangeInfo::COMPARISON_ACTION_REJECT);
}
$changes[0]->setComparisonAction(Model\ChangeInfo::COMPARISON_ACTION_ACCEPT);
$options->setChanges($changes);
$request = new Requests\putChangesDocumentRequest($options);
$response = $compareApi->putChangesDocument($request);
echo "Output file link: " . $response->getHref() . "\n";
See the full example in AcceptOrRejectChanges.php.
Examples on GitHub
The GroupDocs.Comparison Cloud PHP Examples repository includes ready-to-run examples covering:
| Category | Examples |
|---|
| Basic Usage | Supported formats, document information, license consumption, compare documents, compare PDF documents, preview document |
| Compare Multiple Documents | Compare multiple documents with options, compare multiple protected documents |
| Revisions | Get list of revisions, apply revisions, accept all revisions, reject all revisions |
| Save Options | Set metadata, set password |
| Change Control | Accept or reject changes, compare protected documents, compare sensitivity, customize change styles, get changes coordinates, get list of changes, put changes |
How to run the examples
- Clone or download the examples repository
- Edit
Examples/Utils.php and set your ClientId and ClientSecret - Go to the
Examples directory - Run
composer update - Execute
php RunExamples.php
For more details, visit Getting Started.

Document Comparison API | PHP Cloud API | GroupDocs.Comparison Cloud | REST API | Document Comparison | Folder Comparison | Revision Control | Track Changes | Preview Generation | Multi-format Support | Password Protected Documents | Source Code Comparison | Change Tracking | Customization | Document Merging | Change Coordinates | Metadata Extraction | Document Security | Document Review | Secure API Access | Cloud Storage Integration | Cross-platform API