April 24, 2024

New API for Pulling Website Screenshots Programmatically

Have you ever needed to pull a fullscreen website photo without grabbing a screenshot manually? Dynamic libraries do exist, although they’re few and far between. Custom coding is another option but requires a lot more time.

http2pic is a free open source API for pulling images via HTTP. It works from any website URL and can be set to deliver a very specific width/height value based on custom settings passed to the API call.

You can find the full source code for free on GitHub with a small intro guide. It relies on wkhtmltopdf which converts HTML to a PDF file that can be manipulated.

The options list includes a custom width or full viewport(width+height). You can also set the output type as JPG or PNG, enable/disable JavaScript, or setup caching for the script.

It’s still not perfect and certainly won’t run smooth in all browsers. However this is definitely a cool project that shows how far we’ve come in the past couple decades of web development.

To learn more visit the official GitHub repo for download links & install details.

Jake is a creative writer and UI designer by trade. You can follow him on twitter @jakerocheleau or learn more at his personal website JakeRocheleau.com.

Leave a Reply

Your email address will not be published. Required fields are marked *