0CodeKit icon

0CodeKit

A toolbox of no-code utilities

Actions132

Image → Convert HTML to Image

AI-generated

Overview

The node provides a utility to convert HTML content or a webpage URL into an image. This is useful in scenarios where you want to generate visual representations of web content dynamically, such as creating thumbnails for webpages, capturing snapshots of HTML reports, or converting HTML email templates into images for embedding or archiving.

For example:

  • Converting a marketing email's HTML code into an image preview.
  • Generating a screenshot image from a given URL to display on dashboards.
  • Creating image thumbnails from custom HTML content for social media sharing.

Properties

Name Meaning
Data Type Choose the source type of the input data: either "URL" (a webpage URL) or "HTML" (raw HTML content).
HTML Content The raw HTML string to convert into an image. Used only if "Data Type" is set to "HTML".
Webpage URL The URL of the webpage to convert into an image. Used only if "Data Type" is set to "URL".

Output

The node outputs JSON data representing the result of the conversion request. Typically, this will include metadata about the generated image or a direct link/reference to the image resource created from the HTML or URL input.

If the node supports binary output (not explicitly shown in the provided code), it would represent the actual image file data (e.g., PNG or JPEG) that can be used downstream in workflows for saving, uploading, or further processing.

Dependencies

  • Requires an API key credential for authentication with the external service at https://prod.0codekit.com.
  • The node sends a POST request to the /image/html endpoint of the service, passing the selected data type and corresponding HTML or URL data.
  • No other external dependencies are indicated.

Troubleshooting

  • Invalid or missing API key: Ensure the API key credential is correctly configured in n8n; otherwise, requests will fail authentication.
  • Incorrect input data: If the HTML content is malformed or the URL is unreachable/invalid, the conversion may fail or produce unexpected results.
  • Network issues: Connectivity problems to the external service endpoint will cause errors; verify network access.
  • Empty input fields: Make sure to provide either valid HTML content or a valid URL depending on the selected data type.

Common error messages might include HTTP 4xx or 5xx responses indicating client or server errors. Checking the input parameters and API key validity usually resolves these.

Links and References

  • 0CodeKit API Documentation (assumed base URL for the service)
  • General info on HTML to Image conversion tools and use cases (external resources can be searched as needed)

Discussion