jarir-ahmed/uncensored-search
Composer 安装命令:
composer require jarir-ahmed/uncensored-search
包简介
Framework-agnostic meta web-search client for PHP. Aggregates multiple search APIs (Tavily, Serper, Firecrawl, SearchApi, ScrapingBee, Scavio) with automatic failover and an unfiltered (safe-search off) mode.
关键字:
README 文档
README
A framework-agnostic meta web-search client for PHP. Point it at several search-API keys and it gives you one clean interface with automatic failover — if one provider is down, rate-limited, or returns nothing, the next one covers. Results are unfiltered by default (safe-search off); you opt back into filtering when you want it.
Supported providers: Serper, Tavily, SearchApi.io, Scavio, Firecrawl, ScrapingBee. All six have free tiers.
This is web search (the open internet via search APIs). For searching your own indexed data (Elasticsearch, Meilisearch, …) see
jarir-ahmed/search.
Install
composer require jarir-ahmed/uncensored-search
Requires PHP 7.4+ and ext-curl.
Quick start
use JarirAhmed\UncensoredSearch\UncensoredSearch; // Load whatever keys you have — only configured providers are used. $search = UncensoredSearch::fromKeys([ 'serper' => 'xxxx', 'tavily' => 'tvly-xxxx', // 'searchapi' => '...', 'scavio' => '...', 'firecrawl' => '...', 'scrapingbee' => '...', ]); $results = $search->search('open source vector database'); echo $results->provider(); // "serper" (whichever one answered) foreach ($results as $hit) { echo $hit->title() . "\n"; echo $hit->url() . "\n"; echo $hit->snippet() . "\n\n"; }
Loading keys
UncensoredSearch::fromKeys([...]); // inline array UncensoredSearch::fromFile('uncensored_keys.txt'); // KEY=value / .env style file UncensoredSearch::fromEnv(); // SERPER_API_KEY, TAVILY_API_KEY, ...
Both naming styles are accepted in arrays and files: provider names (serper)
or env-var names (SERPER_API_KEY).
Two search modes
// FAILOVER (default) — try providers in order, first with results wins. // Cheapest: one provider's quota per query. $set = $search->search('php 8.4 release date'); // AGGREGATE — query every provider, merge, dedupe by URL. Max coverage, // spends multiple quotas per call. $set = $search->searchAll('php 8.4 release date'); echo implode('+', $set->providers()); // e.g. "serper+tavily+firecrawl"
The Query object
Safe-search is off by default. Everything is fluent and immutable.
use JarirAhmed\UncensoredSearch\Query; $q = Query::create('climate data') ->withLimit(20) ->withSafeSearch(true) // re-enable filtering (providers that support it) ->withCountry('us') ->withLanguage('en'); $search->search($q);
Working with results
$set = $search->search('something'); $set->count(); // int (ResultSet is Countable + iterable) $set->isEmpty(); // bool $set->first(); // ?Result $set->provider(); // ?string — who served it $set->providers(); // string[] — all contributors (aggregate mode) $set->elapsedMs(); // float $set->errors(); // array<provider,message> — why others were skipped $set->toArray(); // array of plain rows foreach ($set as $r) { $r->title(); $r->url(); $r->snippet(); $r->source(); // provider name $r->position(); // ?int rank $r->score(); // ?float (Tavily) $r->raw(); // untouched provider row }
search() never throws on provider failure — failures land in errors() and an
all-failed run simply returns an empty set you can inspect.
Choosing / ordering providers
// Restrict and reorder; tries tavily first, then serper. $search->only(['tavily', 'serper'])->search('...');
Default failover order (best free quota / quality first):
serper → tavily → searchapi → scavio → firecrawl → scrapingbee.
Command-line tool
php examples/cli.php "open source vector database" php examples/cli.php --all --limit=5 "best php testing framework" php examples/cli.php --safe "kids science fair ideas" php examples/cli.php --keys=/path/to/keys.txt "php 8.4"
Provider reference
| Provider | Free tier | Safe-search switch | Notes |
|---|---|---|---|
| Serper | 2,500/mo | yes | Google SERP JSON; default first choice |
| Tavily | 1,000/mo | no | AI-tuned snippets, relevance score |
| SearchApi | free credits | yes | Google + many engines |
| Scavio | 250/mo | no | Google/Amazon/YouTube/Reddit |
| Firecrawl | 1,000/mo | no | AI search; data.web results |
| ScrapingBee | 1,000/mo | partial | Google SERP; key in query string |
Get keys from each provider's site, drop them in a KEY=value file, and never
commit it — .gitignore already excludes *.env / *keys.txt.
Extending
Implement Contracts\ProviderInterface (or extend Providers\AbstractProvider
for the shared mapping/decoding helpers) and pass your provider into the
UncensoredSearch constructor. The failover engine and aggregator work against
the interface, so no core changes are needed.
Testing
composer test
Tests use a fake HTTP client fed with real captured provider JSON, so no network or API quota is touched. 31 tests, 86 assertions, all green.
License
MIT © Jarir Ahmed
jarir-ahmed/uncensored-search 适用场景与选型建议
jarir-ahmed/uncensored-search 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 21 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 06 月 10 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「search」 「aggregator」 「SERP」 「failover」 「web-search」 「firecrawl」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 jarir-ahmed/uncensored-search 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 jarir-ahmed/uncensored-search 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 jarir-ahmed/uncensored-search 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A Laravel package to retrieve data from Google Search Console
A PHP library to get social networks feeds and merge them
A stand-alone class implementation of the IPv4+IPv6 IP+CIDR aggregator from CIDRAM.
Symfony2 Bundle to integrate the CKEditor plugin Notification Aggregator
Indexed Search Autocomplete - Extends the TYPO3 Core Extension Indexed_Search searchform with an autocomplete feature.
Manipulate google searches and SERP
统计信息
- 总下载量: 21
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 20
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-06-10