API 문서는 영어로 제공됩니다.

Fetch

Get a web page as Markdown, HTML or plain text.

GET/api/v1/web/fetch

Alpha: this endpoint is new and its response fields may still change.

Costs 1 credit per request; failed requests are refunded. Authentication, the search_metadata envelope and error codes are the same as for every endpoint (see the API reference). Try it in the playground.

Parameters

Page

Capture a public page and return its content.

ParameterTypeDescription
urlrequiredstringPublic 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.Up to 8,192 characters.
remove_overlaybooleanRemove modal and cookie-banner overlays from the page.
detach_invisiblesbooleanDrop display:none elements from the page.
refererstringHTTP(S) URL sent as the Referer.Up to 8,192 characters.
assert_status_codeintegerExpected origin HTTP status, 100-599. A different status is rejected; otherwise a rendered error page is a successful capture.Range: 100 to 599.
robots_txtstringUser agent, 1-256 characters, to check against the site's robots.txt; disallowed URLs are rejected.Up to 256 characters.
respond_withstringOutput 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.Up to 64 characters.
with_links_summarystringtrue, false or all: add a links list to the response.
with_images_summarybooleanAdd an images list to the response.
retain_media"none" | "text" | "link" | "image" | "html"How video, audio and embedded video appear: none, text, link (default), image or html.
preset"reader" | "index" | "research" | "agent" | "spider"Option preset. Fills only the options the request leaves unset.
no_gfmstringtrue, false or table: disable GitHub-flavored Markdown, or only its tables.
keep_img_data_urlbooleanKeep inline data: images in Markdown.
engine"auto" | "browser" | "curl"auto (default; lightweight HTTP first, a browser when needed), browser, or curl (no JavaScript).
token_budgetintegerInteger 1-10,000,000. Reject the page when its token count exceeds the budget.Range: 1 to 10000000.
markdown_chunking"true" | "h1" | "h2" | "h3" | "h4" | "h5" | "structured" | "s1" | "s2" | "s3" | "s4" | "s5"true, h1-h5, structured or s1-s5: split the Markdown and return chunks.
max_tokensintegerInteger 500-10,000,000. Trim content to this many tokens.Range: 500 to 10000000.
base"initial" | "final"Resolve relative links against the requested URL (initial, default) or the final URL after redirects (final).

Extraction

ParameterTypeDescription
retain_images"none" | "all" | "alt"Images to keep: all (default), alt (alt text only) or none.
retain_links"none" | "all" | "text" | "gpt-oss"Links to keep: all (default), text (link text only), none, or gpt-oss (citation format with a links summary).
target_selectorstringCSS 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.Up to 2,048 characters.
remove_selectorstringCSS selector removed before extraction, 1-2,048 characters; POST also accepts a list of 1-16 selectors.Up to 2,048 characters.
with_iframestringtrue, false or quoted: include iframe content before extraction.
with_shadow_dombooleanInclude open shadow DOM content before extraction.

Browser

ParameterTypeDescription
wait_for_selectorstringCSS selector to wait for after navigation, 1-2,048 characters. POST also accepts a list of 1-16 selectors.Up to 2,048 characters.
user_agentstringUser-Agent for the page request, 1-1,024 characters without control characters. Defaults to the browser's own.Up to 1,024 characters.
page_timeoutintegerSeconds from 1 through 180 for page loading and browser operations. Cannot extend the total request budget set by timeout.Range: 1 to 180.
localestringBrowser locale as a language tag, 2-64 characters. Defaults to the browser's own.Up to 64 characters.
respond_timing"html" | "visible-content" | "mutation-idle" | "resource-idle" | "media-idle" | "network-idle"Page readiness condition to reach before responding.

Response

A JSON object with search_metadata (request id, credits used and remaining) and the result groups the page returns. Groups and fields depend on the content of each page, so treat every field as optional.

Examples

cURL
curl "https://serpfast.com/api/v1/web/fetch?url=https%3A%2F%2Fexample.com&respond_with=markdown" \
  -H "Authorization: Bearer $SERPFAST_KEY"
Node.js 18+
const params = new URLSearchParams({
  "url": "https://example.com",
  "respond_with": "markdown"
});
const res = await fetch(`https://serpfast.com/api/v1/web/fetch?${params}`, {
  headers: { Authorization: `Bearer ${process.env.SERPFAST_KEY}` },
});
const data = await res.json();
console.log(data);
Python
import os, requests

params = {
  "url": "https://example.com",
  "respond_with": "markdown"
}
res = requests.get(
    "https://serpfast.com/api/v1/web/fetch",
    params=params,
    headers={"Authorization": f"Bearer {os.environ['SERPFAST_KEY']}"},
    timeout=120,
)
print(res.json())