Screenshot API

API to take screenshots of websites

Our service for making screenshots is super easy to use. If you've got HTML stuff ready, just send it over to our API, and we'll turn it into a screenshot of the website in PNG format right away. If your HTML is on the internet, just tell us the URL, and our service will go fetch the HTML code using a real headless browser.

There's this optional thing called vars where you can put a JSON object. We use this data to dynamically put stuff into the HTML document using handlebars in the background.

Starting with our service is no big deal: just pick the plan you like and sign up. Once you're in, you'll get to use our RapidAPI screenshot endpoint. You can work with this endpoint using whatever programming language you like, making it super easy to add website screenshot taking to your apps.

Go to RapidAPI

cURL Example with URL

 curl --request POST \
	--url https://pdfgenerator.p.rapidapi.com/pdf \
    --header 'Accept: image/png' \
	--header 'X-RapidAPI-Host: pdfgenerator.p.rapidapi.com' \
	--header 'X-RapidAPI-Key: 90144518e8msh2e0250d70209f2cp19eaeejsnf674dc984054' \
	--header 'content-type: application/json' \
	--data '{
    "url": "https://sparksuite.github.io/simple-html-invoice-template",
    "screenshot": true
}' > screenshot1.png 

cURL Example with HTML + vars

curl --request POST \
--url https://pdfgenerator.p.rapidapi.com/pdf \
--header 'Accept: image/png' \
--header 'X-RapidAPI-Host: pdfgenerator.p.rapidapi.com' \
--header 'X-RapidAPI-Key: 90144518e8msh2e0250d70209f2cp19eaeejsnf674dc984054' \
--header 'content-type: application/json' \
--data '{ "html": " {{title}} ", "vars": {"title": "Hello World"},
    "screenshot": true
}' > screenshot2.png 

cURL Example with HTML Code

 curl --request POST \
	--url https://pdfgenerator.p.rapidapi.com/pdf \
    --header 'Accept: image/png' \
	--header 'X-RapidAPI-Host: pdfgenerator.p.rapidapi.com' \
	--header 'X-RapidAPI-Key: 90144518e8msh2e0250d70209f2cp19eaeejsnf674dc984054' \
	--header 'content-type: application/json' \
	--data '{
    "html": "<html lang=\"en\"> <head> <meta charset=\"UTF-8\"> <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"> <title>Invoice</title> </head> <body> <h1>Invoice</h1> <table> <tr> <th>Position</th> <th>Description</th> <th>Amount</th> <th>Price per Piece</th> <th>Total</th> </tr> <tr> <td>1</td> <td>Product A</td> <td>2</td> <td>€10,00</td> <td>€20,00</td> </tr> <tr> <td>2</td> <td>Product B</td> <td>3</td> <td>€15,00</td> <td>€45,00</td> </tr> <tr> <td>3</td> <td>Product C</td> <td>1</td> <td>€25,00</td> <td>€25,00</td> </tr> </table> <p>Total: €90,00</p> </body> </html>",
    "screenshot": true
}' > screenshot3.png 

PDF Generation Service API
?