---
title: "Web Search"
method: POST
path: "/search"
tags: ["Search"]
---

# Web Search

`POST /search`

## Request

- Base URL: `https://api.weblens.dev`
- URL: `https://api.weblens.dev/search`
- Auth: API key in header `Payment-Signature`

Real-time web search powered by Google. Returns ranked results with titles, URLs, and snippets. Set includeContent to also fetch the top result pages as markdown in the same call. Price: $0.015, plus $0.0015 per result page fetched with includeContent.

## Request body

- object
  - `query` string, required: Search query
  - `limit` number: Maximum results to return
  - `includeContent` boolean: Also fetch the top result pages as markdown (+$0.0015 per fetched result)
  - `contentResults` number: How many top results to fetch content for (when includeContent)
  - `contentChars` number: Per-page content character cap

## Response `200`

Ranked web results; set includeContent to get page markdown too.

- object
  - `query` string: Original search query
  - `results` object[]: Search results with title, url, snippet; with includeContent also content and contentTruncated
  - `searchedAt` string: ISO timestamp
  - `requestId` string

## Other responses

- `400`: The body failed validation
- `402`: Payment required — x402 v2 protocol. Parse the PAYMENT-REQUIRED response header (base64-encoded JSON), sign the payment with your wallet, then retry the request with the Payment-Signature request header.

---

[API](https://skmtc.dev/weblens/apis/weblens-api.md) · [All operations](https://skmtc.dev/weblens/apis/weblens-api/llms.txt) · [OpenAPI document](https://skmtc.dev/weblens/apis/weblens-api/revisions/63a7e81b6921?raw)
