dopplrhub / php-sdk
PHP SDK for the DopplrHub file conversion API
Requires
- php: ^8.1
- ext-curl: *
- ext-json: *
This package is not auto-updated.
Last update: 2026-05-12 02:21:51 UTC
README
A chainable PHP SDK for the current DopplrHub public API, including generic conversions, tools, and utility endpoints.
Install
composer require dopplrhub/php-sdk
Or for this local scaffold:
cd D:\AudioConverter\sdk\php-sdk composer dump-autoload
If you want to distribute the SDK directly from the backend, this workspace now exposes a zip bundle at /api/sdk/php-sdk.zip.
Local file conversion
<?php require __DIR__ . '/vendor/autoload.php'; use DopplrHub\DopplrHub; $api = new DopplrHub('YOUR_API_KEY', 'https://api.dopplrhub.com/api/v1'); $api->start('./input.pdf', 'jpg') ->wait() ->download('./input.jpg') ->delete();
Remote file conversion
<?php require __DIR__ . '/vendor/autoload.php'; use DopplrHub\DopplrHub; $api = new DopplrHub('YOUR_API_KEY', 'https://api.dopplrhub.com/api/v1'); $api->startFromURL('https://example.com/brochure.pdf', 'png') ->wait() ->download('./brochure.png') ->delete();
Tools
<?php require __DIR__ . '/vendor/autoload.php'; use DopplrHub\DopplrHub; $api = new DopplrHub('YOUR_API_KEY', 'https://api.dopplrhub.com/api/v1'); $api->tools()->ocr('./scan.pdf', 'ocr-docx', ['language' => 'eng']) ->wait() ->download('./scan.docx'); $api->tools()->imageResize('./hero.png', [ 'width' => 1920, 'height' => 1080, 'fit' => 'cover', 'outputFormat' => 'webp', ])->wait()->download('./hero.webp'); $api->tools()->pdfCompress('./packet.pdf', 'screen') ->wait() ->download('./packet-compressed.pdf'); $api->tools()->videoTrim('./clip.mp4', 3, 12, [ 'outputFormat' => 'mp4', ])->wait()->download('./clip-trimmed.mp4'); $api->tools()->ada('./brochure.pdf') ->download('./brochure-ada-report.pdf'); $api->tools()->ats('./resume.pdf', 'Senior PHP engineer with API design experience', [ 'industry' => 'technology', ])->download('./resume-optimized.docx'); $api->tools()->archive(['./a.txt', './b.txt'], 'zip', [ 'archiveName' => 'documents', ])->wait()->download('./documents.zip');
Tool coverage in the PHP SDK includes ocr(), pdf(), image(), video(), ada(), ats(), atsReexport(), and archive() on $api->tools().
Examples
examples/convert-local-file.phpexamples/convert-remote-file.phpexamples/ocr-tool.phpexamples/pdf-tool.phpexamples/image-tool.phpexamples/video-tool.phpexamples/ada-tool.phpexamples/ats-tool.phpexamples/tools-and-utilities.php
Utilities
<?php require __DIR__ . '/vendor/autoload.php'; use DopplrHub\DopplrHub; $api = new DopplrHub('YOUR_API_KEY', 'https://api.dopplrhub.com/api/v1'); $formats = $api->utilities()->supportedFormats(); $rates = $api->utilities()->currencyRates('USD'); $api->utilities()->batchDownload(['JOB_ID_1', 'JOB_ID_2'], './converted_files.zip');
Important behavior note
startFromURL() currently downloads the remote resource first, then uploads it into DopplrHub.
It does not perform headless browser webpage rendering.
That means this shape is ready today for remote files like PDF, DOCX, TXT, and other downloadable assets. A call like startFromURL('http://google.com/', 'png') would require a backend webpage-render route that does not exist in the current API yet.
API summary
upload(string $filePath): UploadedFileimportFromUrl(string $url, array $options = []): UploadedFilestart(string $filePath, string $targetFormat, array $options = []): ConversionJobstartFromContents(string $contents, string $fileName, string $targetFormat): ConversionJobstartFromURL(string $url, string $targetFormat, array $options = []): ConversionJobconvert(mixed $source, string $targetFormat, array $options = []): ConversionJobtools(): ToolsClientutilities(): UtilitiesClientConversionJob::wait(?int $timeoutSeconds = null, int $pollSeconds = 2): selfConversionJob::download(?string $targetPath = null): selfConversionJob::delete(): self