Official PHP SDK for Capture - Screenshot and content extraction API.
composer require techulus/captureuse Techulus\Capture\Capture;
$client = new Capture('your-api-key', 'your-api-secret');
$imageUrl = $client->buildImageUrl('https://example.com');
echo $imageUrl;- Screenshot Capture: Capture full-page or viewport screenshots as PNG/JPG
- PDF Generation: Convert web pages to PDF documents
- Content Extraction: Extract HTML and text content from web pages
- Metadata Extraction: Get page metadata (title, description, og tags, etc.)
- Animated GIFs: Create animated GIFs of page interactions
- Zero Dependencies: Uses only PHP built-in extensions (curl, json)
use Techulus\Capture\Capture;
$client = new Capture('your-api-key', 'your-api-secret');
// Use edge endpoint for faster response times
$client = new Capture('your-api-key', 'your-api-secret', ['useEdge' => true]);$imageUrl = $client->buildImageUrl('https://example.com');
$imageUrl = $client->buildImageUrl('https://example.com', [
'full' => true,
'delay' => 2,
'vw' => 1920,
'vh' => 1080,
]);$pdfUrl = $client->buildPdfUrl('https://example.com');
$pdfUrl = $client->buildPdfUrl('https://example.com', [
'format' => 'A4',
'landscape' => true,
]);$contentUrl = $client->buildContentUrl('https://example.com');$metadataUrl = $client->buildMetadataUrl('https://example.com');$animatedUrl = $client->buildAnimatedUrl('https://example.com');$imageData = $client->fetchImage('https://example.com');
file_put_contents('screenshot.png', $imageData);$pdfData = $client->fetchPdf('https://example.com', ['full' => true]);
file_put_contents('page.pdf', $pdfData);$content = $client->fetchContent('https://example.com');
echo $content['html'];
echo $content['textContent'];
echo $content['markdown'];$metadata = $client->fetchMetadata('https://example.com');
print_r($metadata['metadata']);$gifData = $client->fetchAnimated('https://example.com');
file_put_contents('animation.gif', $gifData);useEdge(bool): Use edge.capture.page instead of cdn.capture.page for faster response timestimeout(int): cURL timeout in seconds. Defaults to30
The SDK supports two base URLs:
- CDN:
https://cdn.capture.page(default) - Edge:
https://edge.capture.page(whenuseEdgeistrue)
MIT
For support, please visit capture.page or open an issue on GitHub.