PHP Classes

Webshots: Get a screenshot of a page using the plsein API

Recommend this page to a friend!
  Info   View files Example   View files View files (3)   DownloadInstall with Composer Download .zip   Reputation   Support forum (9)   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStarStar 70%Total: 1,493 All time: 2,626 This week: 54Up
Version License PHP version Categories
webshots 1.0.5Free To Use But R...5PHP 5, Graphics, Web services


This class can Get a screenshot of a page using the plsein API.

It can send a HTTP request to the API Web server to get a screenshot of a Web page given its URL.

The API returns the URL for the screenshot image. The class retrieves and copies the screenshot image file to a given local file.

Picture of PLSCIS PLP
Name: PLSCIS PLP <contact>
Classes: 3 packages by
Country: India India
Age: ???
All time rank: 64538 in India India
Week rank: 161 Up13 in India India Up
Innovation award
Innovation award
Nominee: 1x



= "";
$img = "/var/www/images/img.png";

$wobj = new webshots();

$wobj->url_to_image($url, $img)) {
"image created";
} else {
"some error occured please check response from api";


Api parameters:- 1) api url: 2) post parameters: > params: array containing req. info about class file to be generated > url: url of webpage (e.g.: > height: optional height of image (only positive integer) > width: optional width of image (only positive integer) > fullpage: y means image will be of whole page and n means not > trim: y means it will try to remove extra white space surrounding the image > webshot: optional parameter to create webshot instead of guaranteed fullpage image > cropTop: optional parameter to crop image from top instead of center > ui: array containing user identification parameters > sec_code: value of secret code (will be available from profile page) > key: value of secret key (will be available from profile page) 3) response: > date: image content if image is generated > er: error information if any error occured during image creation > Below example is just a demo for how to call api and use its out-put and you can even use its out-put in different way > but we will recommend to call it from ajax, store image at their end once obtained from this api and use that image for multiple loading as direct loading will take much more time for the page to load. > also almost every time image will be png but if you face problem where it gives jpeg image then please check image's mime type beforing storing / creating image st your end. > due to caching some time, image same as that of previous call might be send on subsequent calls even if urls of webpage for which image is req. are different; to prevent this append random unique time based parameter to end of api url (as done in below example) > In-case of any doubt, please feel free to contact us through contact page on our website

  Files folder image Files  
File Role Description
Plain text file readme.txt Doc. documentation file
Plain text file webshots.php Class url to image
Plain text file webshots_test.php Example demo script to use webshots class

 Version Control Unique User Downloads Download Rankings  
This week:0
All time:2,626
This week:54Up
User Ratings User Comments (3)
 All time
Excellent work to generate image view of a website
6 years ago (javaria razzaq)
good job :)
11 years ago (tomtheman)
This is a good and useful class :-)
11 years ago (Josť Filipe Lopes Santos)