extract_text
Extract plain text or markdown from a static HTML page, removing tags, scripts, and styles. Output markdown for RAG; use selectors to read only matched elements.
Instructions
Use this for a page's plain text or markdown with tags, scripts and styles removed - the cheapest read of a static HTML page. Use output_format:"markdown" for RAG; selector reads only the matched elements, max_length caps the returned text. Not for article pages (extract_content strips nav and boilerplate), JS-rendered pages (scrape), or when you also want links or metadata (scrape with several formats, one fetch). A PDF or other binary is refused (process_document reads documents); an empty client-rendered shell succeeds with rendered:false and a warning. Set escalate:true when the site is known to block: the plain fetch still runs first, and only if it is walled does the stealth browser re-read the page - projected at 6, charged 1 when the plain fetch worked. Cost: 1 credit. Example: extract_text({url: "https://example.com/article", output_format:"markdown"})
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | The URL to extract text from | |
| escalate | No | When the plain fetch comes back blocked (403/429/444/challenge page/empty shell), re-read the page once in the stealth browser and extract from the rendered document. Under escalate_engine "auto" a Chrome TLS handshake with the honest CrawlForge User-Agent (impit) is tried first, and the browser runs only when that does not get the page. A 404 or 5xx never escalates. Projected at 1+5; the actual charge stays at 1 when the plain fetch succeeded. Default: false | |
| selector | No | CSS selector: read only the matched elements (nav/header/footer are then kept). No match is an error | |
| max_length | No | Maximum characters of text or markdown to return; a longer result is cut, ends with "..." and carries truncated:true | |
| redact_pii | No | Redact personal data from the text this call returns, before it reaches your context window. true means the free regex pass over EMAIL, PHONE, FINANCIAL and SECRET. The result carries redaction:{entities,count}. Default: off | |
| user_agent | No | Override the outbound User-Agent. CrawlForge identifies itself honestly by default; use this only for targets you have your own agreement with. | |
| output_format | No | Output format: "text" (default) or "markdown" — use markdown for RAG workflows | text |
| remove_styles | No | Remove style tags before extraction | |
| remove_scripts | No | Remove script tags before extraction | |
| respect_robots | No | Respect the target site's robots.txt (default: true). Setting this to false is honoured, returns a warning in the response, and is recorded against your API key — it is your decision, not a silent default. | |
| escalate_engine | No | Stealth engine for the escalated retry: "auto" (default — Camoufox when it is installed, Chromium otherwise, reported in warnings), "playwright" (Chromium) or "camoufox" | auto |