Creating An Image

Make an HTTP POST request to the IMAGE endpoint below.

curl --location --request POST 'https://www.htmltoimagepdf.com/api/v1/image/html/' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
    "html": "<div class='\''container'\''> <div class='\''banner'\''> <div class='\''avatar-block'\''> <img src='\''https://www.htmltoimagepdf.com/house.jpg'\'' class='\''avatar'\''> </div><div class='\''text-block'\''> <h1>Brian O'\''Brien</h1> <h2>Real Estate Agent</h2> <p>Phone: 087 123456</p></div></div></div>",
    "css": ".container{background-size:500px 300px;background-repeat:no-repeat;background-image:url(https://www.htmltoimagepdf.com/house.jpg);width:500px;height:500px;}.banner{opacity:0.8;background-color:black;margin-top:220px;float:left;width:100%;font-family:Arial;color:white;padding:5px;}.avatar{width:60px;}.text-block{width:80%;float:left;}h1{margin:5px 0 0 0;font-size:14px;font-family:Arial,sans-serif;}h2{margin:2px 0 0 0;font-size:12px;font-family:Arial,sans-serif;}p{margin:3px 0 0 0;font-size:12px;font-family:Arial,sans-serif;}.avatar-block{width:20%;float:left;}",
    "width": 500,
    "height": 300
}'

Parameters

Parameter Type Mandatory
html string yes
css string no
height int no
width int no
delay int no