HTML or Markdown Response
This example shows how to change the response format from the API to HTML or Markdown content instead of the default JSON format.
This use HTML or Markdown responses, simply set the responseFormat
parameter to HTML
or Markdown
. This will also change the Content-Type
response header to text/html
or text/markdown
respectively.
This is useful if you want to proxy through ScrAPI using your own browser, automation implementation, RAG training, or simply don’t want to parse JSON to get the content. When using this option the other response values usually returned in JSON will be added as headers.
Header | Description |
---|---|
X-ScrAPI-Duration | The amount of time taken to perform the scrape operation. |
X-ScrAPI-Attempts | The number of attempts (retries) to perform the scrape operation. |
X-ScrAPI-CreditsUsed | The number of credits used for the scrape operation. |
X-ScrAPI-Cookies | A semi-colon separated list of cookie key/value pairs that were part of the scrape response. |
X-ScrAPI-Headers | A semi-colon separated list of header key/value pairs that were part of the scrape response. |
X-ScrAPI-CaptchasSolved | The name of captchas detected and how many times they were solved. |
X-ScrAPI-ErrorMessages | A list of error messages that occurred during the scrape operation or while executing browser commands. |
Example Request
GET https://api.scrapi.tech/v1/scrape?url=https://deventerprise.com&responseFormat=HTML
POST https://api.scrapi.tech/v1/scrape
Example For HTML
{
"url": "https://deventerprise.com",
"useBrowser": false,
"responseFormat": "HTML"
}
Example For Markdown
{
"url": "https://deventerprise.com",
"useBrowser": false,
"responseFormat": "Markdown"
}
Testing
If you want to test this request or a variation of it, head to the Playground or the OpenAPI page.