Skip to main content
Version: v2

JSON (extended) 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>"
}
]
}
ParameterTypeDescription
htmlStringContent from the scraped web page
textStringText content from the scraped web page
cookiesStringResponse cookies from the scraped web page
status_codeNumberStatus code received from the scraped page
headersArrayResponse headers from the scraped web page
xhrsArrayXHR and FETCH requests from the scraped web page (applicable only for browser-rendered requests)
iframesArrayIframes 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.

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.