Fetch rendered web content
litescrape.web.fetchFetch a public HTTP(S) page and return LLM-ready content
- 价格
- $0.00015/success按供应商原价
- 成功率
- 73.1%近 30 天 · 21,047 次
- 延迟 p50
- 7.8 秒p95 28 秒
- 最后验证
- 2026年9月29日实测可用
GEThttps://toolswitch.dev/v1/tools/litescrape.web.fetch?url=https%3A%2F%2Fexample.com&respond_with=markdown预览- 可用平台额度调用
- 同步返回
- 读取公开数据
参数
| 参数 | 类型 | 必填 | 说明 | 示例 |
|---|---|---|---|---|
| 查询参数 | ||||
url | 字符串 | 必填 | Public HTTP(S) URL to capture, 1-8,192 characters. Include http:// or https://; bare domains are rejected. The host must be public, on port 80 or 443, without embedded credentials. | https://example.com |
base | 字符串 | 可选 | Resolve relative links against the requested URL (initial, default) or the final URL after redirects (final). | |
engine | 字符串 | 可选 | auto (default; lightweight HTTP first, a browser when needed), browser, or curl (no JavaScript). | |
locale | 字符串 | 可选 | Browser locale as a language tag, 2-64 characters. Defaults to the browser's own. | en-US |
no_gfm | 字符串 | 可选 | true, false or table: disable GitHub-flavored Markdown, or only its tables. | |
preset | 字符串 | 可选 | Option preset. Fills only the options the request leaves unset. | |
referer | 字符串 | 可选 | HTTP(S) URL sent as the Referer. | https://example.com |
timeout | 数字 | 可选 | Optional budget for the entire request in seconds, measured from gateway receipt until the response is ready to send. Includes admission, queueing and settlement. Must be greater than 0 and at most 90. On expiry, the call is not billed and returns 503 request_deadline_exceeded with retryable=true and a request ID. Omit to retain the standard server deadline. | |
max_tokens | 整数 | 可选 | Integer 500-10,000,000. Trim content to this many tokens. | |
robots_txt | 字符串 | 可选 | User agent, 1-256 characters, to check against the site's robots.txt; disallowed URLs are rejected. | MyBot |
user_agent | 字符串 | 可选 | User-Agent for the page request, 1-1,024 characters without control characters. Defaults to the browser's own. | |
with_iframe | 字符串 | 可选 | true, false or quoted: include iframe content before extraction. | |
page_timeout | 整数 | 可选 | Seconds from 1 through 180 for page loading and browser operations. Cannot extend the total request budget set by timeout. | 30 |
respond_with | 字符串 | 可选 | Output format: content (default; main content as Markdown, or the whole page when extraction keeps too little), markdown (whole page as Markdown), html, text, frontmatter (content plus front matter), or a '+' combination such as markdown+frontmatter. For screenshots use /api/web/screenshot. | markdown |
retain_links | 字符串 | 可选 | Links to keep: all (default), text (link text only), none, or gpt-oss (citation format with a links summary). | |
retain_media | 字符串 | 可选 | How video, audio and embedded video appear: none, text, link (default), image or html. | |
token_budget | 整数 | 可选 | Integer 1-10,000,000. Reject the page when its token count exceeds the budget. | |
retain_images | 字符串 | 可选 | Images to keep: all (default), alt (alt text only) or none. | alt |
remove_overlay | 布尔 | 可选 | Remove modal and cookie-banner overlays from the page. | |
respond_timing | 字符串 | 可选 | Page readiness condition to reach before responding. | network-idle |
remove_selector | 字符串 | 可选 | CSS selector removed before extraction, 1-2,048 characters; POST also accepts a list of 1-16 selectors. | nav, footer |
target_selector | 字符串 | 可选 | CSS selector to extract, 1-2,048 characters; POST also accepts a list of 1-16 selectors. Implies waiting for the selector. Match-all selectors are rejected. | article |
with_shadow_dom | 布尔 | 可选 | Include open shadow DOM content before extraction. | |
detach_invisibles | 布尔 | 可选 | Drop display:none elements from the page. | |
keep_img_data_url | 布尔 | 可选 | Keep inline data: images in Markdown. | |
markdown_chunking | 字符串 | 可选 | true, h1-h5, structured or s1-s5: split the Markdown and return chunks. | |
wait_for_selector | 字符串 | 可选 | CSS selector to wait for after navigation, 1-2,048 characters. POST also accepts a list of 1-16 selectors. | main |
assert_status_code | 整数 | 可选 | Expected origin HTTP status, 100-599. A different status is rejected; otherwise a rendered error page is a successful capture. | 200 |
with_links_summary | 字符串 | 可选 | true, false or all: add a links list to the response. | |
with_images_summary | 布尔 | 可选 | Add an images list to the response. | |
- 查询参数
url字符串必填Public HTTP(S) URL to capture, 1-8,192 characters. Include http:// or https://; bare domains are rejected. The host must be public, on port 80 or 443, without embedded credentials.
示例:
https://example.combase字符串可选Resolve relative links against the requested URL (initial, default) or the final URL after redirects (final).
engine字符串可选auto (default; lightweight HTTP first, a browser when needed), browser, or curl (no JavaScript).
locale字符串可选Browser locale as a language tag, 2-64 characters. Defaults to the browser's own.
示例:
en-USno_gfm字符串可选true, false or table: disable GitHub-flavored Markdown, or only its tables.
preset字符串可选Option preset. Fills only the options the request leaves unset.
referer字符串可选HTTP(S) URL sent as the Referer.
示例:
https://example.comtimeout数字可选Optional budget for the entire request in seconds, measured from gateway receipt until the response is ready to send. Includes admission, queueing and settlement. Must be greater than 0 and at most 90. On expiry, the call is not billed and returns 503 request_deadline_exceeded with retryable=true and a request ID. Omit to retain the standard server deadline.
max_tokens整数可选Integer 500-10,000,000. Trim content to this many tokens.
robots_txt字符串可选User agent, 1-256 characters, to check against the site's robots.txt; disallowed URLs are rejected.
示例:
MyBotuser_agent字符串可选User-Agent for the page request, 1-1,024 characters without control characters. Defaults to the browser's own.
with_iframe字符串可选true, false or quoted: include iframe content before extraction.
page_timeout整数可选Seconds from 1 through 180 for page loading and browser operations. Cannot extend the total request budget set by timeout.
示例:
30respond_with字符串可选Output format: content (default; main content as Markdown, or the whole page when extraction keeps too little), markdown (whole page as Markdown), html, text, frontmatter (content plus front matter), or a '+' combination such as markdown+frontmatter. For screenshots use /api/web/screenshot.
示例:
markdownretain_links字符串可选Links to keep: all (default), text (link text only), none, or gpt-oss (citation format with a links summary).
retain_media字符串可选How video, audio and embedded video appear: none, text, link (default), image or html.
token_budget整数可选Integer 1-10,000,000. Reject the page when its token count exceeds the budget.
retain_images字符串可选Images to keep: all (default), alt (alt text only) or none.
示例:
altremove_overlay布尔可选Remove modal and cookie-banner overlays from the page.
respond_timing字符串可选Page readiness condition to reach before responding.
示例:
network-idleremove_selector字符串可选CSS selector removed before extraction, 1-2,048 characters; POST also accepts a list of 1-16 selectors.
示例:
nav, footertarget_selector字符串可选CSS selector to extract, 1-2,048 characters; POST also accepts a list of 1-16 selectors. Implies waiting for the selector. Match-all selectors are rejected.
示例:
articlewith_shadow_dom布尔可选Include open shadow DOM content before extraction.
detach_invisibles布尔可选Drop display:none elements from the page.
keep_img_data_url布尔可选Keep inline data: images in Markdown.
markdown_chunking字符串可选true, h1-h5, structured or s1-s5: split the Markdown and return chunks.
wait_for_selector字符串可选CSS selector to wait for after navigation, 1-2,048 characters. POST also accepts a list of 1-16 selectors.
示例:
mainassert_status_code整数可选Expected origin HTTP status, 100-599. A different status is rejected; otherwise a rendered error page is a successful capture.
示例:
200with_links_summary字符串可选true, false or all: add a links list to the response.
with_images_summary布尔可选Add an images list to the response.
代码示例
将 $TOOLSWITCH_KEY 替换为你在控制台创建的密钥。
curl -X GET 'https://toolswitch.dev/v1/tools/litescrape.web.fetch?url=https%3A%2F%2Fexample.com&respond_with=markdown' \
-H "X-Toolswitch-Key: $TOOLSWITCH_KEY"import os
import requests
response = requests.request(
"GET",
"https://toolswitch.dev/v1/tools/litescrape.web.fetch?url=https%3A%2F%2Fexample.com&respond_with=markdown",
headers={"X-Toolswitch-Key": os.environ["TOOLSWITCH_KEY"]},
)
response.raise_for_status()
print(response.text)const response = await fetch("https://toolswitch.dev/v1/tools/litescrape.web.fetch?url=https%3A%2F%2Fexample.com&respond_with=markdown", {
method: "GET",
headers: {
"X-Toolswitch-Key": process.env.TOOLSWITCH_KEY ?? "",
},
});
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
console.log(await response.text());网关接口为预览版,地址与鉴权方式可能调整。 示例参数仅为样例数据。 调用按 $0.00015/success 计费,已含服务费。