Web

Extract structured data from a web page

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

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

API key (`sfk_...`)

Request body

requiredapplication/json
Response fields
12

Endpoint-specific response payload.

datalookupStatus
string

Whether page content could be extracted. Restricted means bot protection or similar access controls blocked automated fetching.

one of: found, restricted

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

metacached
booleanoptional

True when served from shared response cache. Credits still apply (full endpoint price); Age header may be present.

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://example.com/products","schema":{"name":"products","baseSelector":"div.product","fields":[{"name":"name","selector":"h2","type":"text"},{"name":"price","selector":".price","type":"text"}]}}' \
  -X POST

Responses

Structured CSS extraction result.