1. Go to this page and download the library: Download scanlyser/php-sdk library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
scanlyser / php-sdk example snippets
use ScanLyser\Client;
use ScanLyser\Enums\ScanCategory;
$client = new Client(apiKey: 'your-api-token');
// List your sites
$sites = $client->sites($teamId)->list();
foreach ($sites->data as $site) {
echo "{$site->name}: {$site->url}\n";
}
// Trigger a scoped scan. Omit categories to assess all five public categories.
$scan = $client->scans($teamId)->trigger(
$siteId,
wcagLevel: 'AA',
categories: [ScanCategory::Accessibility, ScanCategory::SEO],
);
// Wait for completion
$scan = $client->scans($teamId)->awaitCompletion($scan->id);
// Get issues
$issues = $client->issues($teamId)->list($scan->id, severity: 'critical');
// Inspect scanner diagnostics independently from findings
$diagnostics = $client->diagnostics($teamId)->list($scan->id);
$client = new Client(
apiKey: 'your-api-token',
maxRetries: 3, // optional, retries on 429
);