How to capture screenshot of website with a URL using PHP

In this post, we gonna write a simple PHP script to grab given website URL screenshot. So let’s create an HTML form to collect URL form the user.


We have just created a simple form with one field called URL and submit button. Submit button is to send the request to the server. Form action is pointed to screenCaptureFromURL.php, so lets create screenCaptureFromURL.php file.

PHP script to generate screenshot for a given URL

We gonna use google apis to grap the website screenshot and code is commented pretty well, just through the comments for better understanding.

I hope you like this Post, Please feel free to comment below, your suggestion and problems if you face - we are here to solve your problems.

Published by Arjun

I am Arjun from Hyderabad (India). I have been working as a software engineer from last 7+ years, and its my passion to learn new things and implement them as a practice. Aside from work, I likes gardening and spending time with pets.

Leave a comment

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