API v2 extended JSON response
Extended endpoint with a rich data output
In case you prefer working with JSON response format, or you need to operate the response cookies and status code you can use the extended response endpoint:
https://api.scrapingant.com/v2/extended
It uses the same request structure as the general endpoint, but provides the extended response.
Response structure
ScrapingAnt's extended endpoint returns a JSON object with the content, text ,cookies, status_code, headers, xhrs and iframes properties:
{
"html": "<html><body><h1>Hello, World!</h1></body></html>",
"text": "Hello, World!",
"cookies": "cookie_name_1=cookie_value_1;cookie_name_2=cookie_value_2",
"status_code": 200,
"headers": [
{
"name": "Content-Type",
"value": "text/html; charset=utf-8"
}
],
"xhrs": [
{
"url": "https://example.com/xhr1",
"status": 200,
"method": "GET",
"headers": [
{
"name": "Content-Type",
"value": "application/json"
}
],
"request_body": "",
"body": "Hello, World!"
}
],
"iframes": [
{
"src": "https://example.com/iframe1",
"html": "<html><body><h1>Hello, World!</h1></body></html>"
}
]
}
| Parameter | Type | Description |
|---|---|---|
html | String | Content from the scraped web page |
text | String | Text content from the scraped web page |
cookies | String | Response cookies from the scraped web page |
status_code | Number | Status code received from the scraped page |
headers | Array | Response headers from the scraped web page |
xhrs | Array | XHR and FETCH requests from the scraped web page (applicable only for browser-rendered requests) |
iframes | Array | Iframes content from the scraped web page (applicable only for browser-rendered requests) |
This endpoint is useful when you need to get the response cookies or status code, or you need to operate the response headers.
The JSON status_code belongs to the target website, not the outer API response. For a non-success API response, inspect its HTTP status and JSON detail using the error reference. For Python parsing errors such as KeyError: 'html', see SDK troubleshooting.
Also, you can use it to extract the content from the iframes or XHR/fetch requests and avoid making additional requests to the target website API or parsing the content from the web page.