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
| Field | Type | Description |
|---|---|---|
headers | object | Response headers returned by the target server. |
cost | integer | Credit cost for the request. |
initial-status-code | integer | Initial target response status code. |
body | string | Scraped page content. |
type | string | Response type, such as html, json, or b64. |
metadata | object | Extracted 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.