Skip to main content
PipeLLM exposes WebSearch through a public gateway route. Use this API when you want web results in your own app, backend, or agent workflow without installing the npm plugin.

Endpoint

MethodEndpoint
GEThttps://api.pipellm.ai/v1/websearch/search

Authentication

Authorization: Bearer $PIPELLM_API_KEY

Query Parameters

ParameterTypeRequiredDescription
qstringYesSearch query

What This Route Does

/v1/websearch/search is the full retrieval route. It starts with search results, then extracts page content, runs embedding similarity, and reranks the best contexts when available.

Example Request

curl -X GET "https://api.pipellm.ai/v1/websearch/search?q=latest+AI+news" \
  -H "Authorization: Bearer $PIPELLM_API_KEY"

Response Format

{
  "code": 200,
  "message": "ok",
  "took_ms": 6050,
  "data": {
    "organic": [
      {
        "title": "AI News | Latest News | Insights Powering AI-Driven Business ...",
        "link": "https://www.artificialintelligence-news.com/",
        "snippet": "AI News delivers the latest updates in artificial intelligence..."
      },
      {
        "title": "The Latest AI News and AI Breakthroughs that Matter Most",
        "link": "https://www.crescendo.ai/news/latest-ai-news-and-updates",
        "snippet": "Summary: Xiaomi has announced a next-gen AI voice model...",
        "contexts": [
          {
            "idx": 0,
            "text": "December 26, 2025\n\n# The Latest AI News and AI Breakthroughs..."
          }
        ]
      }
    ]
  }
}

Response Fields

FieldTypeDescription
codeinteger200 for success
messagestringStatus message
took_msintegerTime taken in milliseconds
data.organicarrayOrganic search results
data.organic[].titlestringPage title
data.organic[].linkstringPage URL
data.organic[].snippetstringSearch snippet
data.organic[].contextsarrayExtracted page contexts when available
data.organic[].contexts[].idxintegerContext index
data.organic[].contexts[].textstringExtracted text content

Error Response

{
  "code": 400,
  "message": "Bad Request, missing query parameter"
}

Pricing and Limits

ItemValue
Price$0.05 per successful request
Limit modelShares your account-level limits
Retry behaviorIf you receive 503 Service Unavailable with Retry-After, wait and retry

Example: RAG Context for an LLM

import os
import requests
from openai import OpenAI

search_response = requests.get(
    "https://api.pipellm.ai/v1/websearch/search",
    params={"q": "OpenAI o3 model capabilities"},
    headers={"Authorization": f"Bearer {os.getenv('PIPELLM_API_KEY')}"},
)
search_data = search_response.json()

context = "\n".join(
    f"[{r['title']}]({r['link']}): {r['snippet']}"
    for r in search_data.get("data", {}).get("organic", [])[:5]
)

client = OpenAI(
    api_key=os.getenv("PIPELLM_API_KEY"),
    base_url="https://api.pipellm.ai/v1",
)

response = client.chat.completions.create(
    model="gpt-4o",
    messages=[
        {"role": "system", "content": f"Use this context:\n{context}"},
        {"role": "user", "content": "What are the key features of OpenAI o3?"},
    ],
)

print(response.choices[0].message.content)

WebSearch Overview

Product overview, pricing, and entry points

Simple Search

Faster search route without deep retrieval

pipellm-websearch (npm)

Install the OpenClaw plugin from npm