Spectre - AI Browser And Bot Detection Library icon

Spectre - AI Browser And Bot Detection Library

Hot or Not
Spectre - AI Browser And Bot Detection Library

Description

🚀 Spectre – AI Browser & Bot Detection Library

Spectre is a professional, high-performance PHP library designed for detecting AI browsers and bots. Built with modern PHP 8.2+ features, it offers a robust hybrid detection system combining server-side User-Agent analysis with client-side JavaScript fingerprinting.

💡 Why Choose Spectre?

Spectre is built to be lightweight yet powerful. It integrates seamlessly into any PHP project, whether you're building a CMS, analytics platform, content protection system, or API gateway. The hybrid detection approach ensures high accuracy even for browsers that actively mask their identity.

🌐 Browser & Bot Support

Browser/Bot Detection Method Accuracy Comet Chrome 140+ + AI APIs ⭐⭐⭐⭐⭐ High Arc CSS Variable Fingerprinting ⭐⭐⭐⭐⭐ High Brave Navigator Object ⭐⭐⭐⭐⭐ High SearchGPT User-Agent Analysis ⭐⭐⭐⭐⭐ High Copilot User-Agent Analysis ⭐⭐⭐⭐ Good ClaudeBot User-Agent Analysis ⭐⭐⭐⭐⭐ High GPTBot User-Agent Analysis ⭐⭐⭐⭐⭐ High

Features

✨ Key Features

  • Hybrid Detection: Combines server-side PHP analysis with client-side JavaScript fingerprinting for maximum accuracy.
  • AI Browser Support: Detects Comet, Arc, Brave, and other emerging AI browsers.
  • Bot Detection: Identifies SearchGPT, ClaudeBot, GPTBot, and Microsoft Copilot.
  • Zero Dependencies: Standalone library that works with any PHP 8.2+ project.
  • Modular Architecture: Driver-based system for easy extensibility.
  • Privacy-Focused: Detects browser technology without compromising user privacy.
  • Modern PHP: Utilizes enums, readonly properties, and strict typing.

Requirements

⚙️ Requirements

  • PHP 8.2 or higher
  • No external dependencies required

Instructions

📖 Instructions

Basic Server-Side Detection

<code class="language-php">
<!--?php
use AlizHarbSpectreSpectre;
if (Spectre::isAiBrowser()) {
    $browser = Spectre::detect();
    echo "Detected: " . $browser--->value;
}
?>
</code>

Simple Testing Example

<code class="language-php">
<!--?php
require 'vendor/autoload.php';
use AlizHarbSpectreSpectre;
?-->
    <title>Spectre Test</title>
    <script><?php echo Spectre::getJsSnippet(); ?></script>
    <!--?php if (Spectre::isAiBrowser()): ?-->
        <p>✅ AI Browser Detected: <!--?php echo Spectre::detect()--->value; ?></p>
    <!--?php else: ?-->
        <p>ℹ️ Standard Browser Detected</p>
    <!--?php endif; ?-->
</code>

Hybrid Detection (Recommended)

Add the JavaScript snippet in your <head> and check results on page load:

<code class="language-php">
<script><?php echo AlizHarbSpectreSpectre::getJsSnippet(); ?></script>
<!--?php
use AlizHarbSpectreSpectre;
use AlizHarbSpectreEnumsBrowserType;
$browser = Spectre::detect();
if ($browser) {
    switch ($browser) {
        case BrowserType::COMET:
            echo "Comet browser detected";
            break;
        case BrowserType::ARC:
            echo "Arc browser detected";
            break;
        case BrowserType::BRAVE:
            echo "Brave browser detected";
            break;
        case BrowserType::SEARCH_GPT:
        case BrowserType::GPT_BOT:
        case BrowserType::CLAUDE:
            echo "AI bot detected";
            break;
    }
}
?-->
</code>

Advanced Usage

Custom User-Agent testing:

<code class="language-php">
<!--?php
use AlizHarbSpectreSpectre;
Spectre::init('Mozilla/5.0 (compatible; OAI-SearchBot/1.0)');
if (Spectre::isAiBrowser()) {
    echo "Detected: " . Spectre::detect()--->value;
}
?>
</code>

Conditional content delivery:

<code class="language-php">
<!--?php
use AlizHarbSpectreSpectre;
use AlizHarbSpectreEnumsBrowserType;
$browser = Spectre::detect();
if ($browser === BrowserType::COMET || $browser === BrowserType::ARC) {
    include 'templates/enhanced-content.php';
} elseif ($browser === BrowserType::GPT_BOT || $browser === BrowserType::CLAUDE) {
    include 'templates/bot-content.php';
} else {
    include 'templates/standard-content.php';
}
?-->
</code>

Best Practices

  • Always use hybrid detection for accuracy
  • Cache detection results to improve performance
  • Respect user privacy
  • Handle null results gracefully
  • Keep the package updated for new AI browsers
AuthorHarbzAli
CategoryScripts & Code / PHP Scripts / Security
Price$34
Extended License$102
First ReleaseDec 3, 2025
Last UpdateDec 3, 2025
Files included.php, .html
Software versionPHP 8.2, PHP 8.3, PHP 8.4

External listing. code.market does not sell this product and does not process payment for it. Pricing, payment, delivery, licensing, refunds, and support are handled by the third-party merchant on its own website. We may earn an affiliate commission from a referral. Details.

Products of the Week.

Submit
Spectre - AI Browser And Bot Detection Library | Code Market