# Web Search

> Web Search is a paid API for AI agents from 1gateway.dev, paid per call via x402, $0.006/call, status unknown (last checked 2026-10-31).

Fetches current web search results (title, URL, date) for a query, with optional result count and time range filtering.

## Facts

- Endpoint: GET https://1gateway.dev/v1/web/search?utm_source=zero.xyz
- Price: $0.006/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-31
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/web-search-e173d0c1
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_gtNpKGudzasbDadVBRiL3

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability web-search-e173d0c1
```

Example prompt: Search the web for 'x402 payment protocol' and give me the top 5 results from the past month — I need the titles and URLs.

## When to prefer this

Use this endpoint when an AI agent needs fresh, real-time web search results beyond its training data cutoff. Prefer over static knowledge retrieval when current information, recent news, or live URLs are required. Use the companion /v1/web/search-read endpoint instead if you also need the full page text content, not just titles and URLs.

## Known failure modes

- Provider failure — not charged, returns error indicating upstream unavailability
- Empty results — query returns zero matches for the given time range
- Invalid time_range value — must be one of: day, week, month, year
- Query too long — q exceeds 300 character limit
- max out of bounds — must be between 1 and 10

## How this service works

Use when an agent needs current web results for a query. Input: q, optional max (1-10, default 5), time_range (day, week, month, year). Output: JSON results with title, URL and date when known, provider and retrieval time. For page text use /v1/web/search-read. Provider failure is not charged. Example: ?q=x402+payment+protocol&max=5

## Output

A JSON object containing the original query, time range applied, result count, an array of results each with title, URL, and published date (when known), the upstream provider name, retrieval timestamp, whether the result was cached, upstream cost in USD, attribution, and any notes about the response.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "q"
     ],
     "properties": {
      "q": {
       "type": "string",
       "examples": [
        "x402 payment protocol"
       ],
       "maxLength": 300,
       "description": "Search query"
      },
      "max": {
       "type": "integer",
       "maximum": 10,
       "minimum": 1,
       "examples": [
        5
       ],
       "description": "Number of results (default 5)"
      },
      "time_range": {
       "enum": [
        "day",
        "week",
        "month",
        "year"
       ],
       "type": "string",
       "examples": [
        "month"
       ],
       "description": "Only results from the past day, week, month or year"
      }
     },
     "additionalProperties": false
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "required": [
      "query",
      "timeRange",
      "count",
      "results",
      "provider",
      "retrievedAt",
      "cached",
      "upstreamCostUsd",
      "attribution",
      "notes"
     ],
     "properties": {
      "count": {
       "type": "integer"
      },
      "notes": {
       "type": "array",
       "items": {
        "type": "string"
       }
      },
      "query": {
       "type": "string"
      },
      "cached": {
       "type": "boolean"
      },
      "results": {
       "type": "array",
       "items": {
        "type": "object",
        "properties": {
         "url": {
          "type": "string"
         },
         "title": {
          "type": "string"
         },
         "publishedAt": {
          "type": [
           "string",
           "null"
          ]
         }
        }
       }
      },
      "provider": {
       "type": "string"
      },
      "timeRange": {
       "type": "null"
      },
      "attribution": {
       "type": "string"
      },
      "retrievedAt": {
       "type": "string"
      },
      "upstreamCostUsd": {
       "type": "number"
      }
     }
   
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/web-search-e173d0c1/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from 1gateway.dev](https://www.zero.xyz/host/1gateway.dev/llms.txt)
