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
11

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

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.