# FirstMention Web Search API

> FirstMention Web Search API is a paid API for AI agents from api.firstmention.uk, paid per call via x402, $0.01/call, status unknown (last checked 2026-10-29).

Searches across Wikipedia, Hacker News, GitHub, and Stack Exchange to return ranked web results for a given query, paid per-call via x402 USDC micropayment.

## Facts

- Endpoint: GET https://api.firstmention.uk/s/websearch/search?utm_source=zero.xyz
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-29
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/firstmention-web-search-api-a6d648ae
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_EKKh-TIou8WaLstJiUcVg

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 firstmention-web-search-api-a6d648ae
```

Example prompt: Search for 'x402 payment protocol' across Wikipedia, Hacker News, and GitHub and give me the top 5 results as JSON.

## When to prefer this

Choose this endpoint when you need lightweight, pay-per-call web search across curated open knowledge sources (Wikipedia, Hacker News, GitHub, Stack Exchange) without a subscription or API key — especially in autonomous agent workflows where micropayment via x402 USDC on Base is available and per-call cost must be minimal ($0.01). Prefer this over general-purpose web search APIs when results from developer/technical communities and encyclopedic sources are most relevant, and when markdown output format is useful for direct downstream consumption.

## Known failure modes

- Missing required 'q' query parameter returns a validation error
- Invalid 'sources' value not in wiki/hn/github/se set may be ignored or error
- 'limit' outside 1-25 range rejected by schema validation
- Payment failure via x402 protocol returns 402 Payment Required before any search is performed
- Underlying source (e.g. HN, GitHub) temporarily unavailable causes that source to appear in source_errors with partial results still returned
- Empty result set returned if no matching documents found across selected sources

## How this service works

Pay-per-call HTTP APIs, paid with x402 in USDC on Base (eip155:8453): agentkit, api-change-check, basedue, basewatch, chainread, check-sanctions, chgwatch, company-facts, composite, edgar, feednews, pageaudit, solcheck, token-dd, txpreflight, walletcheck, webmd, webread, websearch, x402index. Each operation describes its service.

## Output

A JSON object containing a boolean 'ok' flag, the original query string, an array of result objects (each with url, title, snippet, sources array, and rank_score), a total result_count, a sources_used array, and a source_errors field listing any sources that failed.

## 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",
      "HEAD",
      "DELETE"
     ],
     "type": "string"
    },
    "headers": {
     "type": "object",
     "additionalProperties": {
      "type": "string"
     }
    },
    "queryParams": {
     "type": "object",
     "required": [
      "q"
     ],
     "properties": {
      "q": {
       "type": "string",
       "description": "search query, max 300 chars"
      },
      "chars": {
       "type": "integer",
       "maximum": 8000,
       "minimum": 200,
       "description": "for /brief: markdown chars per page"
      },
      "limit": {
       "type": "integer",
       "maximum": 25,
       "minimum": 1
      },
      "format": {
       "enum": [
        "json",
        "md"
       ],
       "type": "string"
      },
      "extract": {
       "type": "integer",
       "maximum": 5,
       "minimum": 0,
       "description": "for /brief: how many top hits to fetch and convert to markdown"
      },
      "sources": {
       "type": "string",
       "description": "comma list of wiki,hn,github,se"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "ok": {
       "type": "boolean"
      },
      "pages": {
       "type": "array",
       "items": {
        "type": "object",
        "properties": {
         "url": {
          "type": "string"
         },
         "title": {
          "type": "string"
         },
         "clipped": {
          "type": "boolean"
         },
         "markdown": {
          "type": "string"
         },
         "final_url": {
          "type": "string"
         },
         "markdown_chars": {
          "type": "number"
         }
        }
       }
      },
      "query": {
       "type": "string"
      },
      "results": {
       "type": "array",
       "items": {
        "type": "object",
        "properties": {
         "url": {
          "type": "string"
         },
         "title": {
          "type": "string"
         },
         "snippet": {
          "type": "string"
       
… (truncated)
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "ok": true,
  "query": "x402 payments",
  "results": [
   {
    "url": "https://news.ycombinator.com/item?id=1",
    "title": "Show HN: x402 payments",
    "snippet": "Show HN discussion of x402 paid endpoints",
    "sources": [
     "hn",
     "github"
    ],
    "rank_score": 9.2
   }
  ],
  "result_count": 12,
  "sources_used": [
   "wiki",
   "hn",
   "github"
  ],
  "source_errors": {}
 }
}
```

## More

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