Web

Extract structured data from a web page

Extract structured fields from a web page using a CSS selector schema.

POST/v1/web/extract
x-api-keystringheader

API key (`sfk_...`)

Request body

requiredapplication/json
Response fields
14

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.

Structured rows extracted via CSS schema when lookupStatus is found; null when restricted.

dataextracted[]
objectoptional
datametadata
objectoptional

Page metadata such as title when available.

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

Code example

curl "https://api.socialfetch.dev/v1/web/extract" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://www.socialfetch.dev/","schema":{"name":"socialfetch_home","baseSelector":"main","fields":[{"name":"headline","selector":"h1","type":"text"},{"name":"description","selector":"p","type":"text"}]}}' \
  -X POST

Responses

Structured CSS extraction result.