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 ⭐⭐⭐⭐⭐ HighFeatures
✨ 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
| Author | HarbzAli |
|---|---|
| Category | Scripts & Code / PHP Scripts / Security |
| Price | $34 |
| Extended License | $102 |
| First Release | Dec 3, 2025 |
| Last Update | Dec 3, 2025 |
| Files included | .php, .html |
| Software version | PHP 8.2, PHP 8.3, PHP 8.4 |
Categories
Tags
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🥇
Free LinkedIn Likes From Real Members | LinkedInLikes
Get free LinkedIn likes on your posts from real members who react by hand. No password needed: you only share a link.
Website · 12,847 views · 46 clicksWebsite · Week 49 · 12,847 views · 46 clicks
🥈
Free Medium Claps From Real Writers | MediumPlace
Free Medium claps on your stories from verified accounts of real writers, each given by hand. No bots, no Medium password, nothing to pay. Paste a link.
Website · 7,964 views · 10 clicksWebsite · Week 49 · 7,964 views · 10 clicks
🥉
Free GitHub Stars From Real Developers | GitWow
Get free GitHub stars on your repository from real developers who star by hand. No token or password, and it's free.
Website · 15,624 views · 28 clicksWebsite · Week 49 · 15,624 views · 28 clicks
#4
Free Substack Likes From Real Writers | StackRooms
Free Substack likes on your posts and Notes from verified accounts of real writers, given by hand. Free to ask, free to receive. Just share a link.
Website · 7,784 views · 2 clicksWebsite · Week 49 · 7,784 views · 2 clicks
#5
Free Twitter Likes From Real People | SupaTwitter
Free Twitter likes on your tweets from verified accounts of real people, each given by hand. No bots, no Twitter password, nothing to pay. Paste a link.
Website · 7,679 views · 4 clicksWebsite · Week 49 · 7,679 views · 4 clicks
#6
Free X Likes From Real People, Given by Hand | XFast
Free X likes on your posts from verified accounts of real people, each one given by hand. No bots, no X password, no conditions. Paste a link to start.
Website · 7,591 views · 0 clicksWebsite · Week 49 · 7,591 views · 0 clicks