{"openapi":"3.1.0","info":{"title":"forage","version":"1.0.0","description":"Web search & URL-to-markdown for AI agents. Pay per call with USDC on Base via x402 (HTTP 402 handshake) — no signup, no API key. Unpaid requests receive a 402 with payment requirements; retry with the PAYMENT-SIGNATURE header."},"servers":[{"url":"https://forage.cash"}],"paths":{"/api/search":{"post":{"summary":"Google web search ($0.005/query via x402)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"q":{"type":"string","minLength":1,"maxLength":400,"description":"Search query"},"num":{"type":"integer","minimum":1,"maximum":20,"description":"Number of results (default 10)"},"gl":{"type":"string","description":"Country code, e.g. us, fr"},"hl":{"type":"string","description":"Language code, e.g. en, fr"},"page":{"type":"integer","minimum":1,"maximum":10,"description":"Results page (default 1)"}},"required":["q"]}}}},"responses":{"200":{"description":"Search results (organic, answerBox, knowledgeGraph, relatedSearches)."},"400":{"description":"Invalid input (no charge)."},"402":{"description":"Payment required — x402 quote in body and PAYMENT-REQUIRED header."}}}},"/api/scrape":{"post":{"summary":"URL to LLM-ready markdown ($0.002/page via x402)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","description":"Public http(s) URL to fetch"},"maxChars":{"type":"integer","minimum":1000,"maximum":500000,"description":"Cap on returned markdown/text length (default 200000)"}},"required":["url"]}}}},"responses":{"200":{"description":"Extracted content: { url, finalUrl, title, byline, markdown, truncated, fetchedAt }."},"400":{"description":"Invalid input (no charge)."},"402":{"description":"Payment required — x402 quote in body and PAYMENT-REQUIRED header."}}}}}}