Web

Generate web page HTML

Fetch cleaned HTML for a web page URL.

GET/v1/web/html
x-api-keystringheader

API key (`sfk_...`)

Parameters
5
urlstringrequiredquery

Web page URL to fetch.

min 1 chars · max 2083 chars

scanFullPagebooleanoptionalquery

When true, scroll the page to load dynamically appended content (infinite scroll). Default false.

waitForstringoptionalquery

Wait for a CSS selector before extraction. Must be prefixed with "css:" (e.g. css:main). JavaScript wait conditions are not supported.

max 200 chars

proxystringoptionalquery

Most expensive proxy tier to use. The page is tried on `datacenter` first and moves up only if it is blocked, stopping at this tier. Default: every tier (`mobile`).

one of: datacenter, residential, mobile

maxCreditsintegeroptionalup to maxCreditsquery

Most credits this call may cost (1–25). Default 1, which loads about 1.6 MB on the datacenter proxy or 190 KB on residential or mobile. Raise it for heavy pages; you're charged only for what the page uses.

≥ 1 · ≤ 25

Response fields
37

Endpoint-specific response payload.

datalookupStatus
string

Whether page content could be extracted. `restricted`: bot protection blocked the page on every proxy tier allowed. `budget_exceeded`: the page needed more than `maxCredits` allows before any content loaded.

one of: found, restricted, budget_exceeded

dataproxy
stringnullable

Proxy tier the page was loaded on: the tier that served it, or the last one tried. Null when not measured.

one of: datacenter, residential, mobile, null

databudgetExceeded
boolean

Whether the page needed more than `maxCredits` allows. Loading stopped early, so content may be incomplete.

databytesTransferred
integernullable

Data the page loaded through the proxy, in bytes, across every tier tried. Null when not measured.

≥ 0

dataurl
string

URL that was fetched.

datastatus
integernullable

HTTP status code reported for the page fetch when available; null when restricted.

datahtml
stringnullable

Cleaned or processed HTML when lookupStatus is found; null when restricted.

datametadata
objectoptional

Page metadata such as title when available.

Links discovered on the page when available.

Same-host links discovered on the page.

datalinksinternal[]href
string

Absolute or page-relative link href.

datalinksinternal[]text
stringoptional

Anchor text when available.

datalinksinternal[]title
stringoptional

Title attribute when available.

Cross-host links discovered on the page.

datalinksexternal[]href
string

Absolute or page-relative link href.

datalinksexternal[]text
stringoptional

Anchor text when available.

datalinksexternal[]title
stringoptional

Title attribute when available.

Media assets discovered on the page when available.

Images on the page.

datamediaimages[]src
string

Image source URL.

datamediaimages[]alt
stringoptional

Alt text when available.

datamediaimages[]score
numberoptional

Optional relevance score from the crawler.

Videos on the page.

datamediavideos[]src
string
datamediavideos[]alt
stringoptional
datamediavideos[]score
numberoptional

Audio elements on the page.

datamediaaudios[]src
string
datamediaaudios[]alt
stringoptional
datamediaaudios[]score
numberoptional

Metadata describing the request and billing outcome.

metarequestId
string

Unique request identifier for tracing this API call.

min 1 chars

metacreditsCharged
integer

Credits charged for this request.

≥ 0

metaversion
string

Public API version that served the response.

one of: v1

metastale
booleanoptional

Present, and `true`, only when the source couldn't be reached and this is the last good answer for the same request instead, up to 24 hours old. Absent on every live answer.

one of: true

metafetchedAt
stringoptional

When a stale answer (`stale: true`) was originally fetched (ISO 8601, UTC). Absent on every live answer.

Code example

curl "https://api.socialfetch.dev/v1/web/html?url=https://www.socialfetch.dev" \
  -H "x-api-key: $SOCIALFETCH_API_KEY"

Responses

HTML extraction result.