{"components":{"schemas":{"BatchResponse":{"properties":{"results":{"items":{"properties":{"content":{"type":"string"},"error":{"description":"Error message if this URL failed","type":"string"},"format":{"type":"string"},"metadata":{"$ref":"#/components/schemas/Metadata"},"url":{"type":"string"}},"type":"object"},"type":"array"},"total_time_ms":{"type":"integer"}},"type":"object"},"ExtractResponse":{"properties":{"data":{"description":"Extracted data keyed by selector names","type":"object"},"metadata":{"$ref":"#/components/schemas/Metadata"},"url":{"type":"string"}},"type":"object"},"Metadata":{"properties":{"content_length":{"description":"Original content length in bytes before truncation","type":"integer"},"elapsed_ms":{"description":"Time taken to fetch and render the page in milliseconds","type":"integer"},"truncated":{"description":"Whether content was truncated by max_length","type":"boolean"}},"type":"object"},"ReadResponse":{"properties":{"content":{"description":"Extracted article content","type":"string"},"metadata":{"$ref":"#/components/schemas/Metadata"},"title":{"description":"Page title","type":"string"},"url":{"type":"string"}},"type":"object"},"ScrapeResponse":{"properties":{"content":{"description":"Page content (or JS eval result if evaluate was provided)","type":"string"},"format":{"type":"string"},"metadata":{"$ref":"#/components/schemas/Metadata"},"url":{"type":"string"}},"type":"object"},"SearchResponse":{"properties":{"metadata":{"$ref":"#/components/schemas/Metadata"},"query":{"type":"string"},"results":{"items":{"properties":{"snippet":{"type":"string"},"title":{"type":"string"},"url":{"format":"uri","type":"string"}},"type":"object"},"type":"array"}},"type":"object"}},"securitySchemes":{"x402":{"description":"x402 payment protocol. Requests return HTTP 402 with payment details. Retry with PAYMENT-SIGNATURE header containing a signed USDC payment. See https://x402.org","scheme":"bearer","type":"http"}}},"extensions":{"bazaar":{"info":{"input":{"method":"POST","queryParams":{"format":"markdown","url":"https://docs.anthropic.com/en/docs/overview"},"type":"http"},"output":{"example":{"content":"# Welcome to Claude\n\nClaude is a family of large language models developed by Anthropic.","format":"markdown","metadata":{"content_length":4521,"elapsed_ms":1850,"truncated":false},"url":"https://docs.anthropic.com/en/docs/overview"},"type":"json"}},"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","properties":{"input":{"additionalProperties":false,"properties":{"method":{"enum":["POST"],"type":"string"},"queryParams":{"properties":{"format":{"enum":["html","markdown","text","links"],"type":"string"},"url":{"type":"string"}},"required":["url"],"type":"object"},"type":{"const":"http","type":"string"}},"required":["type","method"],"type":"object"},"output":{"properties":{"example":{"type":"object"},"type":{"type":"string"}},"required":["type"],"type":"object"}},"required":["input"],"type":"object"}}},"info":{"contact":{"email":"hello@swerver.net","name":"Swerver","url":"https://swerver.net"},"description":"Web search and scraping API. Search the web or fetch any URL and get back clean HTML, Markdown, plain text, or extracted links. Supports JavaScript evaluation, CSS selector targeting, stealth mode, and batch operations. Pay-per-request via x402 protocol (USDC on Base). No API key required.","title":"Swerver Web Search API","version":"0.2.0"},"openapi":"3.1.0","paths":{"/batch":{"post":{"description":"Scrapes up to 20 URLs concurrently. Each URL is fetched independently; individual failures don't affect other results.","operationId":"batch","requestBody":{"content":{"application/json":{"schema":{"properties":{"evaluate":{"description":"JavaScript to evaluate on each page","type":"string"},"format":{"default":"markdown","enum":["html","markdown","text","links"],"type":"string"},"max_length":{"description":"Max content length per result","maximum":1000000,"minimum":1,"type":"integer"},"stealth":{"default":false,"type":"boolean"},"timeout":{"default":30,"maximum":120,"minimum":1,"type":"integer"},"urls":{"description":"URLs to scrape (max 20)","items":{"format":"uri","type":"string"},"maxItems":20,"minItems":1,"type":"array"},"user_agent":{"maxLength":512,"type":"string"}},"required":["urls"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchResponse"}}},"description":"Batch results"},"400":{"description":"Invalid request parameters"},"402":{"description":"Payment required (x402)"}},"summary":"Scrape multiple URLs in parallel"},"x-bazaar":{"info":{"input":{"method":"POST","queryParams":{"format":"markdown","urls":["https://docs.anthropic.com/en/docs/overview","https://x402.org"]},"type":"http"},"output":{"example":{"results":[{"content":"# Welcome to Claude","format":"markdown","metadata":{"content_length":4521,"elapsed_ms":1850,"truncated":false},"url":"https://docs.anthropic.com/en/docs/overview"},{"content":"# x402 Protocol","format":"markdown","metadata":{"content_length":3102,"elapsed_ms":920,"truncated":false},"url":"https://x402.org"}],"total_time_ms":1850},"type":"json"}}}},"/extract":{"post":{"description":"Loads the URL and evaluates a map of CSS selectors against the page. Returns a JSON object where each key contains the text content of the matched element(s). Single matches return a string; multiple matches return an array.","operationId":"extract","requestBody":{"content":{"application/json":{"schema":{"properties":{"selector":{"description":"CSS selector to wait for before extracting","type":"string"},"selectors":{"additionalProperties":{"type":"string"},"description":"Map of field name to CSS selector","example":{"links":"nav a","price":".price","title":"h1"},"type":"object"},"stealth":{"default":false,"type":"boolean"},"timeout":{"default":30,"maximum":120,"minimum":1,"type":"integer"},"url":{"description":"URL to extract from","format":"uri","type":"string"},"user_agent":{"maxLength":512,"type":"string"},"wait":{"maximum":30,"minimum":0,"type":"integer"},"wait_until":{"default":"load","enum":["load","domcontentloaded","networkidle0"],"type":"string"}},"required":["url","selectors"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExtractResponse"}}},"description":"Extracted data"},"400":{"description":"Invalid request parameters"},"402":{"description":"Payment required (x402)"}},"summary":"Extract structured data via CSS selectors"},"x-bazaar":{"info":{"input":{"body":{"selectors":"object","url":"string"},"method":"POST","type":"http"},"output":{"example":{"data":{"links":["More information..."],"title":"Example Domain"},"metadata":{"content_length":0,"elapsed_ms":800,"truncated":false},"url":"https://example.com"},"type":"json"}},"schema":{"description":"Extract structured data from any web page using CSS selectors. Define named selectors and get back a JSON object with the matched text content.","tags":["web","extraction","structured-data","css-selectors"]}}},"/health":{"get":{"operationId":"health","responses":{"200":{"description":"Service is healthy"},"503":{"description":"Service is degraded"}},"security":[],"summary":"Health check"}},"/pdf":{"post":{"description":"Loads the given URL in a headless browser and returns a PDF rendering of the page.","operationId":"pdf","requestBody":{"content":{"application/json":{"schema":{"properties":{"landscape":{"default":false,"type":"boolean"},"margin_bottom":{"description":"Bottom margin in inches","type":"number"},"margin_left":{"description":"Left margin in inches","type":"number"},"margin_right":{"description":"Right margin in inches","type":"number"},"margin_top":{"description":"Top margin in inches","type":"number"},"paper_height":{"description":"Paper height in inches (default 11)","type":"number"},"paper_width":{"description":"Paper width in inches (default 8.5)","type":"number"},"print_background":{"default":true,"description":"Print background colors and images","type":"boolean"},"scale":{"default":1.0,"maximum":2.0,"minimum":0.1,"type":"number"},"selector":{"type":"string"},"stealth":{"default":false,"type":"boolean"},"timeout":{"default":30,"maximum":120,"minimum":1,"type":"integer"},"url":{"description":"URL to render as PDF","format":"uri","type":"string"},"user_agent":{"maxLength":512,"type":"string"},"wait":{"maximum":30,"minimum":0,"type":"integer"},"wait_until":{"default":"load","enum":["load","domcontentloaded","networkidle0"],"type":"string"}},"required":["url"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/pdf":{"schema":{"format":"binary","type":"string"}}},"description":"PDF document"},"400":{"description":"Invalid request parameters"},"402":{"description":"Payment required (x402)"}},"summary":"Render a web page as PDF"},"x-bazaar":{"info":{"input":{"body":{"landscape":"boolean","print_background":"boolean","url":"string"},"method":"POST","type":"http"},"output":{"mimeType":"application/pdf","type":"binary"}},"schema":{"description":"Render any web page as a PDF document. Supports landscape/portrait orientation, custom paper size, margins, and background printing.","tags":["web","pdf","headless-browser","document"]}}},"/qr":{"post":{"description":"Encodes the given data as a QR code and returns a PNG image. Supports customizable size and margin.","operationId":"qr","requestBody":{"content":{"application/json":{"schema":{"properties":{"data":{"description":"Text, URL, or data to encode","maxLength":4296,"type":"string"},"margin":{"default":2,"description":"Quiet zone in modules","maximum":10,"minimum":0,"type":"integer"},"size":{"default":256,"description":"Image width/height in pixels","maximum":2048,"minimum":32,"type":"integer"}},"required":["data"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"image/png":{"schema":{"format":"binary","type":"string"}}},"description":"QR code PNG image"},"400":{"description":"Invalid request parameters"},"402":{"description":"Payment required (x402)"}},"summary":"Generate a QR code"},"x-bazaar":{"info":{"input":{"body":{"data":"string"},"method":"POST","type":"http"},"output":{"contentType":"image/png","type":"binary"}},"schema":{"description":"Generate QR code images from text, URLs, or any data. Returns a PNG image.","tags":["image","qr-code","generation","utility"]}}},"/read":{"post":{"description":"Fetches the URL and extracts the main article content, stripping navigation, ads, sidebars, and other non-content elements. Returns clean readable text with the page title.","operationId":"read","requestBody":{"content":{"application/json":{"schema":{"properties":{"max_length":{"description":"Max content length in characters","maximum":1000000,"minimum":1,"type":"integer"},"selector":{"description":"CSS selector to wait for before extracting","type":"string"},"stealth":{"default":false,"type":"boolean"},"timeout":{"default":30,"maximum":120,"minimum":1,"type":"integer"},"url":{"description":"URL to read","format":"uri","type":"string"},"user_agent":{"maxLength":512,"type":"string"},"wait":{"maximum":30,"minimum":0,"type":"integer"},"wait_until":{"default":"load","enum":["load","domcontentloaded","networkidle0"],"type":"string"}},"required":["url"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReadResponse"}}},"description":"Extracted article content"},"400":{"description":"Invalid request parameters"},"402":{"description":"Payment required (x402)"}},"summary":"Extract article content (reader mode)"},"x-bazaar":{"info":{"input":{"body":{"max_length":"number","url":"string"},"method":"POST","type":"http"},"output":{"example":{"content":"Article body text...","metadata":{"content_length":3200,"elapsed_ms":1200,"truncated":false},"title":"Example Article","url":"https://example.com/article"},"type":"json"}},"schema":{"description":"Extract clean article content from any web page. Strips navigation, ads, and sidebars. Returns just the main content as readable text.","tags":["web","reader","content-extraction","article"]}}},"/resolve":{"post":{"description":"Given a prediction market question and optional resolution criteria, searches the web for authoritative evidence, reads primary sources, and produces a calibrated probability estimate with supporting evidence. Designed for prediction market bots and agents.","operationId":"resolve","requestBody":{"content":{"application/json":{"schema":{"properties":{"criteria":{"description":"Resolution criteria (how the market resolves YES/NO)","type":"string"},"max_sources":{"default":5,"description":"Maximum web sources to read","maximum":8,"minimum":1,"type":"integer"},"question":{"description":"The prediction market question to analyze","maxLength":2000,"type":"string"},"sources":{"description":"Hint URLs to check for evidence","items":{"format":"uri","type":"string"},"maxItems":3,"type":"array"}},"required":["question"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"confidence":{"enum":["high","medium","low"],"type":"string"},"evidence":{"items":{"properties":{"claim":{"type":"string"},"source":{"type":"string"},"supports":{"type":"string"},"url":{"type":"string"}},"type":"object"},"type":"array"},"metadata":{"properties":{"elapsed_ms":{"type":"integer"},"searches":{"type":"integer"},"sources_read":{"type":"integer"}},"type":"object"},"probability":{"maximum":1,"minimum":0,"type":"number"},"question":{"type":"string"},"reasoning":{"type":"string"},"sources_consulted":{"items":{"properties":{"title":{"type":"string"},"url":{"type":"string"}},"type":"object"},"type":"array"},"verdict":{"enum":["YES","LIKELY_YES","UNCERTAIN","LIKELY_NO","NO"],"type":"string"}},"type":"object"}}},"description":"Resolution analysis"},"400":{"description":"Invalid request parameters"},"402":{"description":"Payment required (x402)"}},"summary":"Resolution intelligence for prediction markets"},"x-bazaar":{"info":{"input":{"body":{"criteria":"string","question":"string"},"method":"POST","type":"http"},"output":{"example":{"probability":0.72,"question":"Will BTC exceed $100K by July 2026?","verdict":"LIKELY_YES"},"type":"json"}},"schema":{"description":"Analyze prediction market questions by searching authoritative sources and estimating resolution probability with evidence.","tags":["prediction-markets","resolution","intelligence","probability"]}}},"/scrape":{"post":{"description":"Fetches the given URL with a headless browser and returns the page content in the requested format. When `evaluate` is provided, the response content contains the JavaScript evaluation result instead of page content.","operationId":"scrape","requestBody":{"content":{"application/json":{"schema":{"properties":{"evaluate":{"description":"JavaScript expression to evaluate on the page. When provided, the response content will contain the evaluation result instead of page content. Use for structured data extraction, e.g. 'JSON.stringify({title: document.title, links: [...document.querySelectorAll(\"a\")].map(a => a.href)})'","type":"string"},"format":{"default":"markdown","description":"Output format for page content","enum":["html","markdown","text","links"],"type":"string"},"max_length":{"description":"Maximum content length in characters. Content exceeding this limit is truncated. Use as a token budget control to keep responses within context window limits.","maximum":1000000,"minimum":1,"type":"integer"},"selector":{"description":"CSS selector to wait for before extracting content. Useful for SPAs where content loads dynamically.","type":"string"},"stealth":{"default":false,"description":"Enable anti-bot stealth mode. Randomizes browser fingerprint and blocks trackers.","type":"boolean"},"timeout":{"default":30,"description":"Page load timeout in seconds","maximum":120,"minimum":1,"type":"integer"},"url":{"description":"The URL to scrape","format":"uri","type":"string"},"user_agent":{"description":"Custom User-Agent string","maxLength":512,"type":"string"},"wait":{"description":"Extra seconds to wait after the page event fires. Useful for pages with delayed rendering.","maximum":30,"minimum":0,"type":"integer"},"wait_until":{"default":"load","description":"Page lifecycle event to wait for. Use 'networkidle0' for JS-heavy pages.","enum":["load","domcontentloaded","networkidle0"],"type":"string"}},"required":["url"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScrapeResponse"}}},"description":"Scraped content"},"400":{"description":"Invalid request parameters"},"402":{"description":"Payment required (x402)"},"500":{"description":"Scrape failed"}},"summary":"Scrape a web page"},"x-bazaar":{"info":{"input":{"method":"POST","queryParams":{"format":"markdown","url":"https://docs.anthropic.com/en/docs/overview"},"type":"http"},"output":{"example":{"content":"# Welcome to Claude\n\nClaude is a family of large language models developed by Anthropic.","format":"markdown","metadata":{"content_length":4521,"elapsed_ms":1850,"truncated":false},"url":"https://docs.anthropic.com/en/docs/overview"},"type":"json"}}}},"/screenshot":{"post":{"description":"Renders the given URL in a headless browser and returns a screenshot as binary image data.","operationId":"screenshot","requestBody":{"content":{"application/json":{"schema":{"properties":{"format":{"default":"png","enum":["png","jpeg","webp"],"type":"string"},"full_page":{"default":false,"description":"Capture the full scrollable page","type":"boolean"},"height":{"default":720,"description":"Viewport height in pixels","maximum":10000,"minimum":1,"type":"integer"},"quality":{"description":"Compression quality (JPEG/WebP only)","maximum":100,"minimum":0,"type":"integer"},"selector":{"description":"CSS selector to wait for before capturing","type":"string"},"stealth":{"default":false,"type":"boolean"},"timeout":{"default":30,"maximum":120,"minimum":1,"type":"integer"},"url":{"description":"URL to screenshot","format":"uri","type":"string"},"user_agent":{"maxLength":512,"type":"string"},"wait":{"description":"Extra seconds to wait after page event","maximum":30,"minimum":0,"type":"integer"},"wait_until":{"default":"load","enum":["load","domcontentloaded","networkidle0"],"type":"string"},"width":{"default":1280,"description":"Viewport width in pixels","maximum":10000,"minimum":1,"type":"integer"}},"required":["url"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"image/jpeg":{"schema":{"format":"binary","type":"string"}},"image/png":{"schema":{"format":"binary","type":"string"}},"image/webp":{"schema":{"format":"binary","type":"string"}}},"description":"Screenshot image"},"400":{"description":"Invalid request parameters"},"402":{"description":"Payment required (x402)"}},"summary":"Screenshot a web page"},"x-bazaar":{"info":{"input":{"body":{"format":"string","full_page":"boolean","height":"number","url":"string","width":"number"},"method":"POST","type":"http"},"output":{"mimeType":"image/png","type":"binary"}},"schema":{"description":"Take a screenshot of any web page. Returns PNG, JPEG, or WebP image data. Supports full-page capture, custom viewport dimensions, and quality settings.","tags":["web","screenshot","headless-browser","visual"]}}},"/search":{"post":{"description":"Searches the web and returns structured results with titles, URLs, and snippets.","operationId":"search","requestBody":{"content":{"application/json":{"schema":{"properties":{"count":{"default":10,"description":"Number of results to return","maximum":50,"minimum":1,"type":"integer"},"query":{"description":"Search query","type":"string"},"timeout":{"default":30,"description":"Search timeout in seconds","maximum":120,"minimum":1,"type":"integer"}},"required":["query"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchResponse"}}},"description":"Search results"},"400":{"description":"Invalid request parameters"},"402":{"description":"Payment required (x402)"}},"summary":"Web search"},"x-bazaar":{"info":{"input":{"method":"POST","queryParams":{"count":5,"query":"x402 protocol USDC payments"},"type":"http"},"output":{"example":{"metadata":{"content_length":0,"elapsed_ms":2100,"truncated":false},"query":"x402 protocol USDC payments","results":[{"snippet":"x402 is an open protocol for HTTP-native payments using USDC stablecoins.","title":"x402 - HTTP-Native Payments","url":"https://x402.org"},{"snippet":"Build APIs that accept pay-per-request payments with the x402 protocol.","title":"Coinbase x402 Documentation","url":"https://docs.cdp.coinbase.com/x402/docs/overview"}]},"type":"json"}}}}},"security":[{"x402":[]}],"servers":[{"description":"Production","url":"https://websearch--gw.swerver.net"},{"description":"Relative","url":"/"}]}