Output Types
You can specify the output type of the response you want to receive from the API.
Plain HTML
The response will be plain HTML if you do not explicitly specify the output types with your request. This applies to both whether JavaScript rendering is enabled or disabled.
Example request:
Markdown
ScrapeAutomate allows you to generate markdowns from a webpage very easily. By including the markdown=true
parameter in your request, the response will be returned in Markdown format. This is useful for extracting content for LLMs or simplifying web data for better readability.
You can use this with both javascript rendering enabled or disabled, but you might need to use javascript rendering when loading dynamic content from a webpage.
Remember, ScrapeAutomate automatically removes unnecessary elements, such as navbars, from the body content.
Screenshot
To capture a screenshot of the webpage, we provide two query parameters. Screenshots are currently available only in PNG format:
screenshot
: Capture a screenshot of the visible area of the webpage.screenshot_full_page
: It captures a screenshot of the entire webpage, including the parts that are not visible.
Since screenshots rely on rendering the page visually, JavaScript rendering must be enabled to use this feature.
Screenshot of Visible Area
To capture a screenshot of the visible area, include the screenshot
query parameter and set it to true
with a request. The response will contain a png
image.
Full Page Screenshot
To capture a screenshot of the entire page, set the screenshot_full_page
parameter to true
. This will take a full-page screenshot of the webpage and return it as part of the API response.
Webhook
If you prefer to have your responses sent to a webhook instead of receiving them directly, you can utilize our Webhook feature. To use the webhook you need to simply include your webhook_url
in the query parameters, and the API will send the response to that webhook. You can receive all types of responses, including HTML, Markdown, and screenshots.
When you call the API, it will automatically send the response to the specified webhook instead of returning the response data directly to the requester. However, you will still receive a confirmation indicating whether or not the webhook was successfully triggered. Here’s an example:
One important thing to note is that if you use a webhook, you will always receive a success message in response to your API request, even if an error occurs during the scraping process. Any errors encountered will be sent directly to the webhook rather than being returned in the main request.
This functionality also applies to API workflows. Just ensure that you include the webhook URL in the query parameters when creating or editing the workflow. This way, when you send a request to the scraper route, the response will be delivered directly to the specified webhook.