Skip to main content
The Convertly PHP SDK is a small cURL-based client for server-side apps and WordPress plugins. It has zero dependencies beyond the PHP cURL extension.
CDN delivery is separate from this API client. To serve optimized images from the CDN, use a CDN endpoint and either Convertly Storage file IDs/slugs or an origin source for your deployed asset URLs. See Image CDN setup.

Create a client

For a custom API origin (for example staging):

Convert a file

Conversion options

For raster-to-SVG conversion, color is preserved by default. Pass 'mono' => true only when you want monochrome tracing.

Compress a file

Compression options

Media tools

Use the generic mediaTool() method for any Convertly media tool endpoint:
Available tool slugs: thumbnail, pdf-preview, image-to-pdf, strip-metadata, poster-frame, extract-audio, watermark, inspect, trim, gif, storyboard, video-frames, transform, remove-background. Pass 'async' => 'true' in $fields for longer media-tool work. Async tool responses include a jobId; use getJob($jobId) to poll completion.

Convertly Storage

The WordPress-bundled SDK also exposes storage helpers used by the plugin:
Use an empty string ('') for root-level storage listings. Use null only when you intentionally want the API default behavior.

Batch jobs

Upload multiple files in a single batch job:

Job management

Error handling

Every method returns a consistent response array:
Common error cases:
  • Missing API key: ['ok' => false, 'error' => 'Missing Convertly API key.']
  • Missing cURL extension: ['ok' => false, 'error' => 'Convertly uploads require the PHP cURL extension.']
  • Unreadable file: ['ok' => false, 'error' => 'File is not readable.']
  • HTTP errors: ['ok' => false, 'status' => 429, 'error' => 'Rate limit exceeded.']

WordPress integration

The WordPress plugin is built on this SDK, so plugin behavior and standalone PHP behavior stay aligned. You can use the same ConvertlyClient class in custom WordPress themes or plugins:

Method reference

Last modified on July 17, 2026