flashcapture / client
Official PHP SDK for FlashCapture API (RapidAPI). Async website screenshots, ad-blocking & full-page capture.
Installs: 1
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/flashcapture/client
Requires
- php: ^8.0
- ext-json: *
- guzzlehttp/guzzle: ^7.0
README
Official PHP client for FlashCapture API. Generate screenshots of modern websites, handle lazy-loading, ads, and full-page rendering.
Installation
composer require flashcapture/client
Usage
Native PHP
require 'vendor/autoload.php'; use FlashCapture\Client; $flash = new Client('YOUR_RAPID_API_KEY'); try { // One-liner: Capture and save to disk $flash->captureAndSave( 'https://laravel.com', __DIR__ . '/laravel.png', [ 'fullPage' => true, 'darkMode' => true, 'width' => 1920 ] ); echo "Snapshot saved!"; } catch (Exception $e) { echo "Error: " . $e->getMessage(); }
Laravel Integration
You can easily use this in a Laravel Controller or Job.
public function store(Request $request) { $client = new \FlashCapture\Client(env('RAPID_API_KEY')); // Start the job asynchronously $jobId = $client->capture($request->input('url')); // Dispatch a Laravel Job to check status later CheckScreenshotStatus::dispatch($jobId)->delay(now()->addSeconds(5)); return response()->json(['job_id' => $jobId]); }
Options
| Option | Type | Default | Description |
|---|---|---|---|
fullPage |
bool | false |
Capture full scrollable page |
darkMode |
bool | false |
Force dark mode rendering |
hideElements |
array | [] |
CSS selectors to remove (ads, popups) |
| // ... voir la doc complète |