跳到正文
Skillpedia
网页抓取33k · #8730

brightdata-local-search

它能做什么

这个技能帮你的 AI 智能体使用 Bright Data 设置并运行本地网页搜索引擎。适合想通过自己的工具获取搜索引擎结果的开发者。

适用场景

  • ✓当你想通过自己的本地搜索工具进行网页搜索时。
  • ✓当你需要对多个搜索引擎的结果进行排序和清理时。
  • ✓当你正在为项目设置 Bright Data 的 SERP API 时。

技能链接

https://github.com/davila7/claude-code-templates/blob/main/cli-tool/components/skills/development/brightdata-local-search/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/davila7/claude-code-templates/blob/main/cli-tool/components/skills/development/brightdata-local-search/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“请用 Bright Data 搭建一个本地搜索服务器,以便我能从应用中搜索网页。”

每周 5 个新技能,1 分钟读完。

工作原理

智能体会克隆 unfancy-search 项目,添加你的 Bright Data 密钥以及可选的 Anthropic 密钥,然后使用 Docker 或 Node.js 启动。之后它通过本地端点运行搜索。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Bright Data Local Search

Run powerful web searches locally using Bright Data's SERP API. This skill sets up the unfancy-search pipeline — a local search engine with query expansion, multi-engine SERP retrieval, RRF reranking, deduplication, and domain clustering.

Important: This skill uses the LOCAL version only. Do not use the hosted endpoint.

Prerequisites

Setup

Step 1: Clone and Configure

git clone https://github.com/yaronbeen/unfancy-search.git
cd unfancy-search
cp .env.example .env

Step 2: Set Environment Variables

Edit .env with your credentials:

BRIGHT_DATA_API_TOKEN=your_brightdata_token
BRIGHT_DATA_SERP_ZONE=serp_api1
ANTHROPIC_API_KEY=your_anthropic_key   # Optional: enables AI query expansion

Get your Bright Data token from: https://brightdata.com (SERP API section)

Step 3: Start the Local Server

Docker (recommended):

docker compose up -d
# Server runs at http://localhost:3000

Node.js:

pnpm install
pnpm dev
# Server runs at http://localhost:3000

API Endpoints

All requests go to http://localhost:3000:

Endpoint Method Description
/api/search POST Start a search job
/api/search-status/{jobId} GET Poll for results
/api/baseline POST Trigger baseline collection
/api/baseline-status/{id} GET Poll baseline progress

Running a Search

Step 1: Submit Search

curl -X POST http://localhost:3000/api/search \
  -H "Content-Type: application/json" \
  -d '{"query": "your search term"}'

The response returns a jobId.

Step 2: Poll for Results

curl http://localhost:3000/api/search-status/{jobId}

Poll every 3 seconds until status is "done".

Search Parameters

Parameter Type Default Description
query string required Search query
expand boolean false Enable AI query expansion via Claude
research boolean false Research mode (12 sub-queries for max coverage)
engines string[] all SERP engines to use
geo string — Geographic region filter
count number 10 Max results (up to 10)
includeDomains string[] — Only include results from these domains
excludeDomains string[] — Exclude results from these domains

Search Modes

  • Basic (expand: false): Single query, fastest, no AI cost
  • Expanded (expand: true): Claude Haiku generates 3 sub-queries for broader coverage
  • Research (research: true): 12 sub-queries for maximum coverage

Usage Examples

Basic Search from an Agent

# Start search
JOB_ID=$(curl -s -X POST http://localhost:3000/api/search \
  -H "Content-Type: application/json" \
  -d '{"query": "best practices for API rate limiting"}' | jq -r '.jobId')

# Poll until done
while true; do
  RESULT=$(curl -s http://localhost:3000/api/search-status/$JOB_ID)
  STATUS=$(echo $RESULT | jq -r '.status')
  if [ "$STATUS" = "done" ]; then
    echo $RESULT | jq '.results'
    break
  fi
  sleep 3
done

Research Mode with Domain Filtering

curl -X POST http://localhost:3000/api/search \
  -H "Content-Type: application/json" \
  -d '{
    "query": "kubernetes scaling strategies",
    "research": true,
    "excludeDomains": ["pinterest.com", "quora.com"]
  }'

Adding Search to an Existing Agent

To give your Claude Code agent search capabilities:

  1. Ensure the local server is running (docker compose up -d in the unfancy-search directory)
  2. Your agent can use curl or fetch to query http://localhost:3000/api/search
  3. Parse the ranked results to ground responses with real web data

Response Format

Results include:

  • Ranked URLs with RRF scores
  • Domain clustering (grouped by source)
  • Cost transparency (per-search expense breakdown)
  • Raw and unique result counts
  • Search duration

Troubleshooting

Issue Solution
Server won't start Verify Docker is running or Node.js 18+ installed
No results returned Check BRIGHT_DATA_API_TOKEN is valid and SERP API zone is active
Query expansion not working Verify `
常见问题

开始需要什么?

你需要一个开通了 SERP API 访问权限的 Bright Data 账号,以及 Docker 或 Node.js 18 或更高版本。

它使用托管服务吗?

不使用。该技能说明只使用本地版本,而不使用托管端点。

AI 查询扩展是必需的吗?

不是。Anthropic 密钥是可选的,设置后会开启 AI 查询扩展。

详情

作者的原始描述

Set up and run local web searches using Bright Data SERP API with the unfancy-search pipeline (query expansion, SERP retrieval, RRF reranking).

repo: davila7/claude-code-templates

热度

GitHub 星标
33k
排名
#8730
许可证
MIT
更新时间
2026/11/2

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能