{"openapi":"3.0.3","info":{"title":"🕸️ web-scraper","description":"Generic web scraping: fetches an arbitrary caller-supplied URL, always through a proxy obtained from proxy-pool -- never a direct/unproxied fetch. Retries only on a transport failure (a real HTTP response from the target, whatever its status code, is returned as-is -- never masked or retried away).","x-guidance":"Generic web scraping: fetches an arbitrary caller-supplied URL, always through a proxy obtained from proxy-pool -- never a direct/unproxied fetch. Retries only on a transport failure (a real HTTP response from the target, whatever its status code, is returned as-is -- never masked or retried away).","version":"1.0.0","contact":{"email":"contact@17711.xyz"}},"paths":{"/v1/web-scraper/scrape_url":{"post":{"operationId":"web_scraper_scrape_url","summary":"Web scraper: fetches any URL through a proxy and returns its status, content type and raw HTML ($0.004, x402)","description":"Fetches a caller-supplied URL (http/https only) ALWAYS through a proxy sourced from `proxy-pool` -- never a direct/unproxied request, same invariant `websearch` already enforces. Retries with a different proxy on a TRANSPORT-level failure (connection refused/timeout/proxy build failure) or a 403/429/502/503/504 (near-universal proxy/gateway-block signals); any other real HTTP response actually received from the target, whatever its status code (404/500 included), is returned as-is and is never itself a reason to retry: for a generic scraper, the target's real status is often exactly the information the caller wants, unlike a search where only one answer is 'right'. No JavaScript rendering (a static HTTP fetch, not a headless browser), no charset detection (UTF-8 lossy decode only), and no `robots.txt` handling -- responsible use is the caller's own responsibility. `html` is truncated to this service's own fixed, operator-configured byte ceiling (not caller-adjustable) if needed -- see `truncated`. A repeat of the exact same URL is served from a short-lived in-process cache. Free for the first few calls, then a real x402 payment (a `402` response carrying a `PAYMENT-REQUIRED` challenge) is required to continue. Free trial: 3 free calls per caller IP address, per tool, per 24 hours (and at most 50 free calls per window for this tool across all callers; MCP callers, whose address is not known, share a single anonymous free call). After that, every call is paid via x402 at $0.004 USDC per call.","x-price-usdc":"0.004","x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.004000"},"protocols":[{"x402":{}}]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","description":"The target URL to fetch, e.g. `\"https://example.com/page\"`. Must be `http://` or `https://` -- any other scheme is rejected before any fetch is attempted."}},"required":["url"]},"example":{"url":"string"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","description":"The URL as requested, verbatim."},"final_url":{"type":"string","description":"The URL actually reached, after any redirects the target sent."},"status":{"type":"integer","minimum":0,"maximum":65535,"description":"The REAL HTTP status the target returned -- never masked, never itself a reason to retry."},"content_type":{"type":["string","null"]},"html":{"type":"string","description":"Raw response body, decoded as UTF-8 (lossy -- see this tool's own description for why), truncated to this service's own fixed byte ceiling if needed."},"truncated":{"type":"boolean","description":"`true` if `html` was cut short by this service's own fixed byte ceiling."}},"required":["url","final_url","status","html","truncated"]},"example":{"url":"string","final_url":"string","status":0,"content_type":"string","html":"string","truncated":false}}}},"402":{"description":"Payment required -- a free-call quota exists (default 5 calls, see PLATFORM_FREEMIUM_FREE_CALLS) before this status applies; beyond it, pay via the real x402 protocol (PAYMENT-REQUIRED response header, decode and retry with a signed PAYMENT-SIGNATURE header).","content":{"application/json":{"schema":{"type":"object","description":"x402 v2 PaymentRequired challenge","properties":{"x402Version":{"type":"integer"},"error":{"type":"string"},"resource":{"type":"object","properties":{"url":{"type":"string"},"description":{"type":"string"},"mimeType":{"type":"string"}}},"accepts":{"type":"array","items":{"type":"object","properties":{"scheme":{"type":"string"},"network":{"type":"string"},"amount":{"type":"string","description":"Token atomic units, NOT decimal USD -- see x-payment-info.price.amount for the decimal form."},"asset":{"type":"string"},"payTo":{"type":"string"},"maxTimeoutSeconds":{"type":"integer"},"extra":{"type":"object"}}}}},"required":["x402Version","accepts"]}}}},"default":{"description":"Standardized error envelope, on every non-2xx response from this fleet: {\"error\": {\"code\": <dotted string, e.g. \"request.bad_request\">, \"index\": <integer>, \"status\": <HTTP status code>, \"message\": <client-safe description>, \"debug\": <object, present only for an authorized caller>}}.","content":{"application/json":{"schema":{"type":"object","description":"ErrorEnvelope"}}}}}}},"/v1/web-scraper/extract_markdown":{"post":{"operationId":"web_scraper_extract_markdown","summary":"Web scraper to Markdown: fetches a URL and returns its main article content as clean Markdown ($0.004, x402)","description":"Fetches a caller-supplied URL through the SAME proxied fetch as `web_scraper_scrape_url` (never a direct/unproxied request), then strips navigation, ads, and sidebar boilerplate and returns the main article content as clean Markdown (plus its title, when found) -- not raw HTML. Markdown is the only output format; there is no format parameter. Best for article/blog/documentation-style pages; a page with no clearly identifiable main content (a pure app shell, a listing page, a non-HTML response) returns an error rather than a low-quality guess. `truncated` mirrors the underlying fetch's own byte-ceiling truncation flag -- the extracted Markdown may then also be incomplete. Free for the first call, then a real x402 payment (a `402` response carrying a `PAYMENT-REQUIRED` challenge) is required to continue. Free trial: 3 free calls per caller IP address, per tool, per 24 hours (and at most 50 free calls per window for this tool across all callers; MCP callers, whose address is not known, share a single anonymous free call). After that, every call is paid via x402 at $0.004 USDC per call.","x-price-usdc":"0.004","x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.004000"},"protocols":[{"x402":{}}]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","description":"The target URL to fetch, e.g. `\"https://example.com/article\"`. Must be `http://` or `https://` -- same validation as `web_scraper_scrape_url`, since this tool fetches through the exact same internal scraper."}},"required":["url"]},"example":{"url":"string"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","description":"The URL as requested, verbatim."},"final_url":{"type":"string","description":"The URL actually reached, after any redirects the target sent."},"status":{"type":"integer","minimum":0,"maximum":65535,"description":"The REAL HTTP status the underlying fetch received."},"content_type":{"type":["string","null"]},"title":{"description":"Article title, if Readability found one.","type":["string","null"]},"markdown":{"type":"string","description":"Boilerplate-stripped main article content, as Markdown -- navigation, ads, and sidebars removed, not the raw page HTML."},"truncated":{"type":"boolean","description":"`true` if the underlying fetch's HTML was truncated by web-scraper's own fixed byte ceiling (see `web_scraper_scrape_url`'s own `truncated` field) -- `markdown` may then also be incomplete."}},"required":["url","final_url","status","markdown","truncated"]},"example":{"url":"string","final_url":"string","status":0,"content_type":"string","title":"string","markdown":"string","truncated":false}}}},"402":{"description":"Payment required -- a free-call quota exists (default 5 calls, see PLATFORM_FREEMIUM_FREE_CALLS) before this status applies; beyond it, pay via the real x402 protocol (PAYMENT-REQUIRED response header, decode and retry with a signed PAYMENT-SIGNATURE header).","content":{"application/json":{"schema":{"type":"object","description":"x402 v2 PaymentRequired challenge","properties":{"x402Version":{"type":"integer"},"error":{"type":"string"},"resource":{"type":"object","properties":{"url":{"type":"string"},"description":{"type":"string"},"mimeType":{"type":"string"}}},"accepts":{"type":"array","items":{"type":"object","properties":{"scheme":{"type":"string"},"network":{"type":"string"},"amount":{"type":"string","description":"Token atomic units, NOT decimal USD -- see x-payment-info.price.amount for the decimal form."},"asset":{"type":"string"},"payTo":{"type":"string"},"maxTimeoutSeconds":{"type":"integer"},"extra":{"type":"object"}}}}},"required":["x402Version","accepts"]}}}},"default":{"description":"Standardized error envelope, on every non-2xx response from this fleet: {\"error\": {\"code\": <dotted string, e.g. \"request.bad_request\">, \"index\": <integer>, \"status\": <HTTP status code>, \"message\": <client-safe description>, \"debug\": <object, present only for an authorized caller>}}.","content":{"application/json":{"schema":{"type":"object","description":"ErrorEnvelope"}}}}}}},"/v1/web-scraper/scrape_url_async":{"post":{"operationId":"web_scraper_scrape_url_async","summary":"Enqueues a web_scraper_scrape_url job and returns a task id immediately ($0.004, x402)","description":"Fire-and-forget sibling of `web_scraper_scrape_url`: enqueues the SAME fetch onto this service's task queue and returns a `task_id` immediately, without waiting for the fetch itself (which can legitimately take up to ~2 minutes worst-case against slow/blocked free proxies). Requires at least one instance of this service running with `PLATFORM_MODE=worker` to ever process the enqueued job. Poll `web_scraper_get_task_status` with the returned `task_id` for the eventual result, or set `callback_url` to have it POSTed there instead. Priced identically to `web_scraper_scrape_url` -- free for the first few calls, then a small x402 payment, same quota. Free trial: 3 free calls per caller IP address, per tool, per 24 hours (and at most 50 free calls per window for this tool across all callers; MCP callers, whose address is not known, share a single anonymous free call). After that, every call is paid via x402 at $0.004 USDC per call.","x-price-usdc":"0.004","x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.004000"},"protocols":[{"x402":{}}]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","description":"The target URL to fetch, e.g. `\"https://example.com/page\"`. Must be `http://` or `https://` -- any other scheme is rejected before any fetch is attempted."},"callback_url":{"description":"When set, the worker that processes this task POSTs the eventual result (a `TaskResult` JSON body) here, best-effort -- polling `web_scraper_get_task_status` always works too, regardless of whether this is set.","type":["string","null"]}},"required":["url"]},"example":{"url":"string","callback_url":"string"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"task_id":{"type":"string"}},"required":["task_id"],"description":"The fixed response shape of every `*_async` tool -- deliberately NOT generic over the underlying sync tool's own response type, since no work has actually happened yet at this point."},"example":{"task_id":"string"}}}},"402":{"description":"Payment required -- a free-call quota exists (default 5 calls, see PLATFORM_FREEMIUM_FREE_CALLS) before this status applies; beyond it, pay via the real x402 protocol (PAYMENT-REQUIRED response header, decode and retry with a signed PAYMENT-SIGNATURE header).","content":{"application/json":{"schema":{"type":"object","description":"x402 v2 PaymentRequired challenge","properties":{"x402Version":{"type":"integer"},"error":{"type":"string"},"resource":{"type":"object","properties":{"url":{"type":"string"},"description":{"type":"string"},"mimeType":{"type":"string"}}},"accepts":{"type":"array","items":{"type":"object","properties":{"scheme":{"type":"string"},"network":{"type":"string"},"amount":{"type":"string","description":"Token atomic units, NOT decimal USD -- see x-payment-info.price.amount for the decimal form."},"asset":{"type":"string"},"payTo":{"type":"string"},"maxTimeoutSeconds":{"type":"integer"},"extra":{"type":"object"}}}}},"required":["x402Version","accepts"]}}}},"default":{"description":"Standardized error envelope, on every non-2xx response from this fleet: {\"error\": {\"code\": <dotted string, e.g. \"request.bad_request\">, \"index\": <integer>, \"status\": <HTTP status code>, \"message\": <client-safe description>, \"debug\": <object, present only for an authorized caller>}}.","content":{"application/json":{"schema":{"type":"object","description":"ErrorEnvelope"}}}}}}},"/v1/web-scraper/get_task_status":{"post":{"operationId":"web_scraper_get_task_status","summary":"Polls for the result of a task enqueued by a *_async tool","description":"Reads back the result of a task previously enqueued by `web_scraper_scrape_url_async` -- pure read, no fetch performed. `status` is one of `pending` (still queued/running), `finished` (see `ok`/`result`), or `unknown` (the id is invalid or has expired).","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"task_id":{"type":"string","description":"The `task_id` a `*_async` tool returned."}},"required":["task_id"]},"example":{"task_id":"string"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"$ref":"#/components/schemas/TaskStatusKind"},"ok":{"type":["boolean","null"]},"result":true},"required":["status"]},"example":{"status":"pending","ok":false,"result":null}}}},"default":{"description":"Standardized error envelope, on every non-2xx response from this fleet: {\"error\": {\"code\": <dotted string, e.g. \"request.bad_request\">, \"index\": <integer>, \"status\": <HTTP status code>, \"message\": <client-safe description>, \"debug\": <object, present only for an authorized caller>}}.","content":{"application/json":{"schema":{"type":"object","description":"ErrorEnvelope"}}}}}}}},"servers":[{"url":"/registry/web-scraper"}],"components":{"schemas":{"TaskStatusKind":{"type":"string","enum":["pending","finished","unknown"],"description":"`\"pending\"` (enqueued, no result yet), `\"finished\"` (a worker wrote a result -- see `ok`/ `result`), or `\"unknown\"` (this id was never valid, or both it and its result have expired -- see [`nimpoleon_tasks::TaskState`]'s own doc comment for why this is 3 states, not 2)."}}}}