WebScrapingAPI Docs
Web Scraping APIAdvanced API Features

Full JSON Response

Wrap WebScrapingAPI output in a JSON response with headers, body, cost, and metadata.

By default, WebScrapingAPI returns the scraped page body directly. Add json_response=1 when your integration needs response metadata or a JSON envelope around the page content.

Request

curl --get "https://api.webscrapingapi.com/v2" \
  --data-urlencode "api_key=YOUR_API_KEY" \
  --data-urlencode "url=https://example.com" \
  --data-urlencode "json_response=1"

Response Fields

FieldTypeDescription
headersobjectResponse headers returned by the target server.
costintegerCredit cost for the request.
initial-status-codeintegerInitial target response status code.
bodystringScraped page content.
typestringResponse type, such as html, json, or b64.
metadataobjectExtracted microdata and JSON-LD metadata.

Example

{
  "headers": {
    "content-type": "text/html; charset=UTF-8"
  },
  "cost": 1,
  "initial-status-code": 200,
  "body": "<!doctype html><html>...</html>",
  "type": "html",
  "metadata": {
    "microdata": {
      "items": []
    },
    "json-ld": []
  }
}

Use json_response=1 when downstream systems require JSON. If you only need page HTML, omit it and parse the raw response body directly.

On this page