API Documentation > Sample Codes > Create Website Screenshot For iPhone/Android/Win Phone/iPad/Desktop

Create Website Screenshot For iPhone/Android/Win Phone/iPad/Desktop

It is very easy to use page2images.com to generate a screenshot for following devices: iPhone4, iPhone5, Android phones, windows phones, ipad, android pads and desktop computer. You just need pass the device number to us and we will handle everything else. No user agent need. No screen size need. All of those information are defined pretty well by us.

At the mean while, our system will handle all kinds of Javascript redirect code on the target page. If the target page use Javascript to detect the device and redirect to the mobile version or iPad version, our system will follow up the redirect actions automatically.

Generate iPhone4 Website Screenshot

Rest API

http://api.page2images.com/restfullink?p2i_url=TARGET_URL&p2i_key=YOUR_API_KEY&p2i_device=0

IMG API

<img src='http://api.page2images.com/directlink?p2i_url=TARGET_URL&p2i_key=YOUR_API_KEY&p2i_device=0'>

JS API

<img src='http://api.page2images.com/directlink?p2i_url=TARGET_URL&p2i_key=YOUR_API_KEY&p2i_device=0'> 
<script src="http://www.page2images.com/js/p2i.js"></script> <script> var p2i=new page2images(); p2i.thumbnail('demo');</script>
Click this here to see the demo image

Generate iPhone5 Website Screenshot

Rest API

http://api.page2images.com/restfullink?p2i_url=TARGET_URL&p2i_key=YOUR_API_KEY&p2i_device=1

IMG API

<img src='http://api.page2images.com/directlink?p2i_url=TARGET_URL&p2i_key=YOUR_API_KEY&p2i_device=1'>

JS API

<img src='http://api.page2images.com/directlink?p2i_url=TARGET_URL&p2i_key=YOUR_API_KEY&p2i_device=1'> 
<script src="http://www.page2images.com/js/p2i.js"></script> <script> var p2i=new page2images(); p2i.thumbnail('demo');</script>
Click this here to see the demo image

Generate Android Website Screenshot

Rest API

http://api.page2images.com/restfullink?p2i_url=TARGET_URL&p2i_key=YOUR_API_KEY&p2i_device=2

IMG API

<img src='http://api.page2images.com/directlink?p2i_url=TARGET_URL&p2i_key=YOUR_API_KEY&p2i_device=2'>

JS API

<img src='http://api.page2images.com/directlink?p2i_url=TARGET_URL&p2i_key=YOUR_API_KEY&p2i_device=2'> 
<script src="http://www.page2images.com/js/p2i.js"></script> <script> var p2i=new page2images(); p2i.thumbnail('demo');</script>
Click this here to see the demo image

Generate WinPhone Website Screenshot

Rest API

http://api.page2images.com/restfullink?p2i_url=TARGET_URL&p2i_key=YOUR_API_KEY&p2i_device=3

IMG API

<img src='http://api.page2images.com/directlink?p2i_url=TARGET_URL&p2i_key=YOUR_API_KEY&p2i_device=3'>

JS API

<img src='http://api.page2images.com/directlink?p2i_url=TARGET_URL&p2i_key=YOUR_API_KEY&p2i_device=3'> 
<script src="http://www.page2images.com/js/p2i.js"></script> <script> var p2i=new page2images(); p2i.thumbnail('demo');</script>
Click this here to see the demo image

Generate iPad Website Screenshot

Rest API

http://api.page2images.com/restfullink?p2i_url=TARGET_URL&p2i_key=YOUR_API_KEY&p2i_device=4

IMG API

<http://api.page2images.com/restfullink?p2i_url=TARGET_URL&p2i_key=YOUR_API_KEY&p2i_device=4>

JS API

<img src='http://api.page2images.com/directlink?p2i_url=TARGET_URL&p2i_key=YOUR_API_KEY&p2i_device=4'> 
<script src='http://api.page2images.com/directlink?p2i_url=TARGET_URL&p2i_key=YOUR_API_KEY&p2i_device=4'> </script> <script> var p2i=new page2images(); p2i.thumbnail('demo');</script>
Click this here to see the demo image

Generate Android Pad Website Screenshot

Rest API

http://api.page2images.com/restfullink?p2i_url=TARGET_URL&p2i_key=YOUR_API_KEY&p2i_device=5

IMG API

<img src='http://api.page2images.com/directlink?p2i_url=TARGET_URL&p2i_key=YOUR_API_KEY&p2i_device=5'>

JS API

<img src='http://api.page2images.com/directlink?p2i_url=TARGET_URL&p2i_key=YOUR_API_KEY&p2i_device=5'> 
<script src="http://www.page2images.com/js/p2i.js"></script> <script> var p2i=new page2images(); p2i.thumbnail('demo');</script>
Click this here to see the demo image

Generate Desktop Website Screenshot

Rest API

http://api.page2images.com/restfullink?p2i_url=TARGET_URL&p2i_key=YOUR_API_KEY&p2i_device=6

IMG API

<img src='http://api.page2images.com/directlink?p2i_url=TARGET_URL&p2i_key=YOUR_API_KEY&p2i_device=6'>

JS API

<img src='http://api.page2images.com/directlink?p2i_url=TARGET_URL&p2i_key=YOUR_API_KEY&p2i_device=6'> 
<script src="http://www.page2images.com/js/p2i.js"></script> <script> var p2i=new page2images(); p2i.thumbnail('demo');</script>
Click this here to see the demo image
Sample Codes
Download Java sample source code for website screenshot
Download PHP sample source code for website screenshot
Download Python sample source code for website screenshot
Download PHP sample source code for convert HTML to image
Use Code Generator to Build the Code

Using our Code Generator, you can quickly generate the source code for IMG Tags. Use page2images code generator for website screenshot.

Free Engineering Service

Premium and XLarge rate plan users get free help with writing and testing code. Please contact us if you need help.

version:1.7