Skip to content
Browse all functions

Convert HTML to an Image

images/html2ogimage

html2ogimage (Convert HTML to an Image) is a 1001fx API function in the group Images: POST https://api.1001fx.com/images/html2ogimage, 5 credits per item. It works in Make, n8n, scripts and AI agents as a plain HTTP call.

Converts an HTML snippet (with Tailwind classes) into an image, e.g. an Open Graph image for social media.

Try it in the 1001fx app

Run html2ogimage in your browser with your API key – fill the form, click Run and get the answer or the file.

html2ogimage in the 1001fx app: the form with example values
Convert HTML to an Image in the 1001fx app

Endpoint

POSThttps://api.1001fx.com/images/html2ogimage
Header
X-API-KEY: YOURSECRETAPIKEY How to
Content type
application/json

Parameters

  • htmlstringrequired

    HTML to render as an image. You can use tailwind classes provided in a tw tag in your elements. The following font families are supported: Alegreya, Barlow, Inter, Lato, Montserrat, OpenSans, Oswald, Poppins, PTSans, Raleway, Roboto

    Example:
    <div>Hello</div>
  • widthnumberrequired

    The image width.

    Min:
    1
    Max:
    10000
    Example:
    500
  • heightnumberrequired

    The image height.

    Min:
    1
    Max:
    10000
    Example:
    500
  • outputFormatenumrequired

    The desired output format

    Values:
    png
    jpeg
    Example:
    png
  • defaultFontenumoptional

    A default font that is injected at top level into your html. Can be overwritten by providing another font-family in a sub element.

    Values:
    Alegreya
    Barlow
    Inter
    Lato
    Montserrat
    OpenSans
    Oswald
    Poppins
    PTSans
    Raleway
    Roboto
    Example:
    OpenSans

Try html2ogimage now

Run it in your browser or create a free account and get 100 credits every month.

Changelog

  • 1.0.001.03.2023created
Ask 1001fx