Fetch URLs for context
For tasks involving mathematical calculations or data analytics, add
code_interpreter alongside web extractor to improve accuracy.Getting started
Call web extractor through the Responses API to summarize a web page. The examples below use web_search and web_extractor with qwen3.8-max in thinking mode.
- Python
- Node.js
- curl
Response structure
The response contains the model's generated text plus metadata about tool usage.
| Field | Description |
|---|---|
output_text | The model's final text response, grounded in the extracted web content |
output[] | Array of intermediate items including web_extractor_call objects (each with goal and output fields showing what URL was fetched and the extracted content) |
usage.x_tools.web_extractor.count | Number of web extractor invocations in this request |
usage.x_tools.web_search.count | Number of web search invocations in this request |
How it works
- Include
web_extractor(and typicallyweb_search) in thetoolsarray of your API request, along with a prompt that references a URL or topic. - The model determines which pages to fetch, retrieves their content, and appends it to the context as additional input tokens.
- The model generates a response grounded in the retrieved content.
When to use web extractor
| Scenario | Tool configuration | Why |
|---|---|---|
| Answer questions about a specific URL | web_extractor (optionally with web_search) | The model fetches and reads the full page content, not just a search snippet |
| Research a topic across the web | web_search + web_extractor | web_search finds relevant pages; web_extractor reads them in full |
| Quick factual lookup (no specific URL) | web_search alone | Search snippets are often sufficient; cheaper and faster |
web_extractor when you need the model to read the actual content of a page -- not just a search-result summary.
Invocation methods
Web extractor supports three APIs. The Responses API provides the most control over tool behavior -- use it for new integrations.
| API | Tool configuration | Streaming required | Notes |
|---|---|---|---|
| Responses API (recommended) | Add web_search and web_extractor to tools | No | Exposes intermediate tool execution status |
| Chat Completions API | Set enable_search: true, search_strategy: "agent_max" | Yes | Non-streaming not supported |
| DashScope API | Set enable_search: true, search_strategy: "agent_max" | Yes | Java SDK not supported |
When using
qwen3-max-2026-01-23, set enable_thinking to true.- Responses API
- Chat Completions API
- DashScope API
Stream web extractor events
For general streaming concepts (SSE protocol, how to enable streaming, and token usage), see Streaming output. This section covers only the event types specific to web extractor.
| Event type | Description |
|---|---|
response.reasoning_text.delta | Incremental reasoning text from the model's thinking process |
response.output_item.done | A tool call has completed. Check item.type for web_extractor_call to get the extraction result |
response.output_text.delta | Incremental response text |
response.completed | The response is complete. The usage field contains tool invocation counts |
web_extractor_call event in a stream, check for the event type and read its goal and output fields:
Supported models
Recommended models
Responses API
- Qwen-Max: qwen3.8-max, Qwen3.7-Max series
- Qwen-Plus: Qwen3.7-Plus series, Qwen3.6-Plus series, Qwen3.5-Plus series
- DeepSeek: deepseek-v4-pro-0813, deepseek-v4-flash, deepseek-v4-flash-0731, deepseek-v4-pro
- GLM: glm-5.2
- Qwen3.8 open-source series
- Qwen-Max (thinking mode): Qwen3-Max series
- Qwen-Plus: Qwen3.5-Plus series
Other models
The following models also support this tool but may not perform as well as the recommended models.
- Qwen-Flash: Qwen3.7-Flash series, Qwen3.6-Flash series, Qwen3.5-Flash series
- Qwen3.8 open-source series (
qwen3.8-2.4t-a95b) - Qwen3.6 open-source series (excluding qwen3.6-27b)
- Qwen3.5 open-source series
- DeepSeek:
deepseek-v4-pro-0813,deepseek-v4-flash,deepseek-v4-flash-0731,deepseek-v4-pro - GLM:
glm-5.2
Limitations
- Web extractor retrieves publicly accessible pages only. Pages behind authentication or paywalls return empty content.
- Very large pages may be truncated before being added to the context window.
- Dynamic content rendered exclusively by JavaScript may not be fully captured.
- The extracted content counts as input tokens, which increases both latency and cost for large pages.
Error handling
When extraction fails, the model does not raise an error. Instead, the web_extractor_call item in the response output returns empty or partial content, and the model generates its response based on whatever context is available.
Common failure scenarios:
| Scenario | Behavior |
|---|---|
| URL is unreachable (404, 500, DNS failure) | Extraction returns empty content; model responds using other available context |
| Page load times out | Partial or empty content returned |
| Non-HTML content (PDF, images) | Content may not be extracted; model falls back to other tools or general knowledge |
To verify whether extraction succeeded, inspect the
web_extractor_call items in response.output or check usage.x_tools.web_extractor.count for the number of successful invocations.Billing
Web extractor costs have two components:
The prices listed below are list prices. For current promotions and discounted pricing, visit the Model Marketplace.
| Component | Details |
|---|---|
| Model cost | Extracted web content is appended to the prompt, which increases input tokens. Billed at the model's standard token price. See Pricing for pricing. |
| Web search fee | $10.00 per 1,000 search invocations. Web extractor typically triggers web search internally. |
| Web extractor fee | Free for a limited time. |