July 23, 2014 4:20 am

How to capture website screenshot with PHP

I have received many requests from my readers to write on screenshot capture with PHP so I have found a service using that service we can take websites screenshots very easily in PHP. Used API’s from GrabzIt for testing in our demo you can get a website’s screenshot by sending a web url.

How to capture website screenshot with PHP

First of all you need to create your account on Grabz.It and they will give you API keys using these keys you can easily integrate it in your application.

Let’s come to the code:

Above code is used to create class object with your account API key and secret after creating object we are calling 3 different methods SetImageOptions used to capture image of given page output, SetPDFOptions used to create PDF of given url and SetTableOptions is used to extract tables from the web page.

To save screenshot in your website use below function:

Use this function after your screenshot call and it will save your results directory make sure that you have given writing rights to that directory.

That’s all for screen capture application I hope it helps you guyz please share it with your friends. Follow us on twitter for more updates.


Author Huzoor Bux

I am Huzoor Bux from Karachi (Pakistan). I have been working as a PHP Developer from last 5+ years, and its my passion to learn new things and implement them as a practice. Basically I am a PHP developer but now days exploring more in HTML5, CSS and jQuery libraries.

Tutorial Categories:
  • Tariq ali

    Awesome, But how to remove watermark from captured image ?

  • Awesome, This is a really nice article, easy to use to capture website screenshot!

  • Sandip Das

    this article is good but there need api key and SECRET code can u help without api key and SECRET code. this article good for home practice not for any real project

  • Sandip Das

    gijo can u help me how to do this and its working thats really good

  • Adan Chou

    How to remove water mark and make better quality of image?

  • thanks to share php capture … such a great !

  • Xghost Ma