← 返回 Skills 市场
vaibhav1805

Langsearch

作者 Vaibhav Kumar · GitHub ↗ · v1.0.4
cross-platform ✓ 安全检测通过
579
总下载
2
收藏
2
当前安装
5
版本数
在 OpenClaw 中安装
/install langsearch
功能描述
Free web search and semantic reranking API for AGI applications. Use when you need to perform web searches, retrieve current information from the internet, o...
使用说明 (SKILL.md)

LangSearch

⚠️ Security & Credentials

Required Credentials:

  • LANGSEARCH_API_KEY - Your free LangSearch API key (required)

Security Best Practices:

  1. Get a free API key - Sign up at langsearch.com/api-keys
  2. Protect your API key - Never commit .env files containing LANGSEARCH_API_KEY to version control
  3. Use environment variables - Store the key in .env or set via export LANGSEARCH_API_KEY="..."
  4. Monitor usage - Check your API usage on the LangSearch dashboard
  5. Code inspection - This tool only uses the official LangSearch API. All communication is via HTTPS to api.langsearch.com

Network Access:

  • Only connects to: https://api.langsearch.com (official LangSearch API)
  • No external data collection or telemetry
  • No tracking or logging sent elsewhere

Overview

LangSearch provides free APIs for web search and semantic reranking. It combines keyword search precision with vector-based semantic matching, making it ideal for integrating current web information into LLM applications and building RAG systems.

Quick Start

Prerequisites

  1. Get a free API key at https://langsearch.com/api-keys
  2. Set your API key as an environment variable: export LANGSEARCH_API_KEY="your-api-key"

Basic Web Search

The simplest way to search the web using LangSearch:

import requests
import json
import os

api_key = os.getenv("LANGSEARCH_API_KEY")
headers = {
    "Authorization": f"Bearer {api_key}",
    "Content-Type": "application/json"
}

query = "latest AI developments 2025"
payload = {
    "query": query,
    "count": 5,
    "summary": True
}

response = requests.post(
    "https://api.langsearch.com/v1/web-search",
    headers=headers,
    json=payload
)

results = response.json()
print(json.dumps(results, indent=2))

Or using cURL:

curl -X POST https://api.langsearch.com/v1/web-search \
  -H "Authorization: Bearer $LANGSEARCH_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "latest AI developments 2025",
    "count": 5,
    "summary": true
  }'

Web Search API

The web search endpoint retrieves information from billions of web documents using hybrid search (keyword + vector matching) with optional summaries.

Endpoint

POST https://api.langsearch.com/v1/web-search

Request Parameters

Parameter Type Required Description
query string Yes The search query
count integer No Number of results to return (default: 10, max: 100)
summary boolean No Include markdown summaries in results (default: false)
freshness string No Filter results by freshness (day, week, month, year)

Response Structure

The API returns an array of search results with:

  • title - Result title
  • url - Result URL
  • snippet - Text excerpt from the page
  • summary - Markdown formatted summary (if summary: true in request)
  • score - Relevance score

Example Use Cases

Current Information Retrieval When your LLM needs up-to-date information:

# Search for recent developments
response = requests.post(
    "https://api.langsearch.com/v1/web-search",
    headers=headers,
    json={
        "query": "Python 3.14 release notes",
        "count": 3,
        "summary": True,
        "freshness": "week"
    }
)

Multi-Query Research Build context from multiple searches:

queries = [
    "climate change mitigation strategies",
    "renewable energy trends 2025",
    "carbon capture technology"
]

all_results = []
for query in queries:
    response = requests.post(
        "https://api.langsearch.com/v1/web-search",
        headers=headers,
        json={"query": query, "count": 5, "summary": True}
    )
    all_results.extend(response.json())

Semantic Reranking API

Improve search accuracy by reranking results based on semantic relevance to your query.

Endpoint

POST https://api.langsearch.com/v1/rerank

Request Parameters

Parameter Type Required Description
query string Yes The search query for context
documents array Yes Array of documents to rerank (each with title, text, etc.)
model string No Reranking model (default: langsearch-rerank-1)
top_n integer No Number of top results to return (default: 10)
return_documents boolean No Include full documents in response (default: false)

Example: Reranking Web Search Results

# Get initial search results
search_response = requests.post(
    "https://api.langsearch.com/v1/web-search",
    headers=headers,
    json={"query": "machine learning deployment best practices", "count": 10}
)

search_results = search_response.json()

# Prepare documents for reranking
documents = [
    {"title": r.get("title", ""), "text": r.get("snippet", "")}
    for r in search_results
]

# Rerank for better relevance
rerank_response = requests.post(
    "https://api.langsearch.com/v1/rerank",
    headers=headers,
    json={
        "query": "best practices for deploying ML models in production",
        "documents": documents,
        "top_n": 5
    }
)

reranked = rerank_response.json()

Building RAG Applications

Combine web search with LLM context for better information retrieval and generation:

def rag_query(user_question):
    # Step 1: Search the web for relevant information
    search_response = requests.post(
        "https://api.langsearch.com/v1/web-search",
        headers=headers,
        json={
            "query": user_question,
            "count": 5,
            "summary": True
        }
    )

    search_results = search_response.json()

    # Step 2: Extract summaries and URLs for context
    context = "\
".join([
        f"- {r['title']}: {r.get('summary', r.get('snippet', ''))}"
        for r in search_results
    ])

    # Step 3: Use with your LLM
    # This is where you'd call your LLM with the context
    rag_context = f"""
Based on recent web search results:

{context}

Answer the user's question: {user_question}
"""

    return rag_context, search_results

Error Handling

Common HTTP status codes:

Status Meaning Action
200 Success Results returned normally
401 Unauthorized Check API key is valid and set correctly
429 Rate limited Retry with exponential backoff
500 Server error Retry the request later

See scripts/web_search_example.py for a complete example with error handling.

Resources

This skill includes example resource directories that demonstrate how to organize different types of bundled resources:

scripts/

Executable code (Python/Bash/etc.) that can be run directly to perform specific operations.

Examples from other skills:

  • PDF skill: fill_fillable_fields.py, extract_form_field_info.py - utilities for PDF manipulation
  • DOCX skill: document.py, utilities.py - Python modules for document processing

Appropriate for: Python scripts, shell scripts, or any executable code that performs automation, data processing, or specific operations.

Note: Scripts may be executed without loading into context, but can still be read by Claude for patching or environment adjustments.

references/

Documentation and reference material intended to be loaded into context to inform Claude's process and thinking.

Examples from other skills:

  • Product management: communication.md, context_building.md - detailed workflow guides
  • BigQuery: API reference documentation and query examples
  • Finance: Schema documentation, company policies

Appropriate for: In-depth documentation, API references, database schemas, comprehensive guides, or any detailed information that Claude should reference while working.

assets/

Files not intended to be loaded into context, but rather used within the output Claude produces.

Examples from other skills:

  • Brand styling: PowerPoint template files (.pptx), logo files
  • Frontend builder: HTML/React boilerplate project directories
  • Typography: Font files (.ttf, .woff2)

Appropriate for: Templates, boilerplate code, document templates, images, icons, fonts, or any files meant to be copied or used in the final output.


Any unneeded directories can be deleted. Not every skill requires all three types of resources.

安全使用建议
This skill appears coherent and limited to calling the LangSearch API. Before installing: (1) verify you trust https://langsearch.com and obtain your API key there, (2) never commit the LANGSEARCH_API_KEY to source control, (3) review the example code yourself to confirm behavior meets your expectations, (4) monitor API usage and rotate the key if you detect unexpected calls, and (5) if you need stronger guarantees, limit the key's scope (if the provider supports it) or run the code in an isolated environment.
功能分析
Type: OpenClaw Skill Name: langsearch Version: 1.0.4 The OpenClaw skill 'langsearch' is designed for web search and semantic reranking via the LangSearch API. All files consistently point to `https://api.langsearch.com` for network communication, as declared in `SKILL.md` and implemented in `scripts/web_search_example.py`. The skill correctly retrieves the `LANGSEARCH_API_KEY` from environment variables and uses it for authentication. There is no evidence of data exfiltration to unauthorized endpoints, arbitrary command execution, persistence mechanisms, or prompt injection attempts against the agent within the `SKILL.md` instructions. The code and documentation align with the stated purpose and follow standard security practices for API interaction.
能力评估
Purpose & Capability
The name/description (web search + reranking) matches the declared requirement (LANGSEARCH_API_KEY) and the included example code, which only calls api.langsearch.com endpoints. Minor metadata mismatch: registry metadata lists no homepage while SKILL.md includes https://langsearch.com — this is likely a packaging omission, not evidence of extra capability.
Instruction Scope
SKILL.md instructs only how to call the LangSearch web-search and rerank endpoints and to read LANGSEARCH_API_KEY from the environment. The instructions and example code reference only the declared env var and only the api.langsearch.com endpoints; they do not instruct reading unrelated files or sending data to other endpoints.
Install Mechanism
No install spec (instruction-only skill with an example script) — low risk. There are no downloads, no extracted archives, and no third-party package installs requested by the skill.
Credentials
Only one required environment variable (LANGSEARCH_API_KEY) is declared and used; this is proportionate to a service that requires an API key. The SKILL.md and example code only access that env var.
Persistence & Privilege
always:false and no install-time persistence requested. The skill does not request elevated or persistent system presence or access to other skills' configuration.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install langsearch
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /langsearch 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.4
- Added OpenClaw metadata (`openclaw.requires.env` and `openclaw.primaryEnv`) to SKILL.md for enhanced environment variable specification. - No changes to functionality or code; documentation updated only.
v1.0.3
- Updated the SKILL.md to add required credential information to the description. - Added metadata fields: homepage, source, apiEndpoint, and primaryEnv for improved documentation and discoverability. - No functional or code changes were made in this release.
v1.0.2
- Added dedicated security and credentials section, including best practices and credential protection guidance. - Explicitly documented required credential (`LANGSEARCH_API_KEY`) and how to obtain and use it. - Clarified network access scope and supply chain risk (connects only to official LangSearch API, no external telemetry). - No changes to API endpoints or examples. - Improved transparency and security guidance for all users.
v1.0.1
- Added a `metadata` section with the version number (1.0.1) to the SKILL.md file. - Introduced a `credentials` section specifying the required `LANGSEARCH_API_KEY` with a description and link to obtain the key. - No changes to the API, usage examples, or other documentation content.
v1.0.0
Initial release of langsearch: a free web search and semantic reranking API for AGI applications. - Provides APIs for web search with both keyword and vector-based semantic retrieval. - Supports semantic reranking to improve search result relevance. - Includes example code for integration with RAG pipelines and LLM applications. - Offers detailed usage instructions, error handling guidelines, and resource directory organization.
元数据
Slug langsearch
版本 1.0.4
许可证
累计安装 2
当前安装数 2
历史版本数 5
常见问题

Langsearch 是什么?

Free web search and semantic reranking API for AGI applications. Use when you need to perform web searches, retrieve current information from the internet, o... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 579 次。

如何安装 Langsearch?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install langsearch」即可一键安装,无需额外配置。

Langsearch 是免费的吗?

是的,Langsearch 完全免费(开源免费),可自由下载、安装和使用。

Langsearch 支持哪些平台?

Langsearch 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Langsearch?

由 Vaibhav Kumar(@vaibhav1805)开发并维护,当前版本 v1.0.4。

💬 留言讨论