Page2images Website Thumbnail

FREE
By suzhoukada
Updated 4 months ago
Tools
1.3/10
Popularity Score
342ms
Latency
100%
Success Rate

Page2images Website Thumbnail API Documentation

Send us a url. We return the image of it. Support iPhone, Android & iPad.

View API Details
GETRestfullink Get
GETRestfullink Get
Header Parameters
X-RapidAPI-HostSTRING
REQUIRED
X-RapidAPI-KeySTRING
REQUIRED
Required Parameters
p2i_urlSTRING
REQUIREDURL of target page. Do not need to be encode. Valid inputs: www.google.com google.com http://www.google.com https://www.google.com
p2i_keySTRING
REQUIRED - CONSTANT
Optional Parameters
p2i_sizeSTRING
OPTIONALThe thumbnail file size you want to get. Not the screen size of device. If you want a big image, you need enlarge the width and height. If you need a small one, you need reduce the width and height. But it will take some more time to download a big image than a small one. Format: widthxheight e.g. 300x300 We predefined the size for those devices for most usage: Mobile Phones: 320x480 Tablets: 512x384 Desktop: 640x400 Advanced information: 1) If you only know the fixed width or height of the images you want to get, you can just pass the width or height to us by following format: 512x0 or 0x512. We will resize the image to fit that width/height and make sure it is the biggest image we can generate. 2) The screenshot image will be resized to fit the width and height without stretching
p2i_imageformatSTRING
OPTIONALpng or jpg We strongly recommend jpg since most jpg file is smaller than png.
p2i_fullpageSTRING
OPTIONALFull page or just the screen area. If the value is 1 or true, we will take the full page screenshot. If the value is 0 or false, we will take the screen area only.
p2i_deviceSTRING
OPTIONALOur system can generate the screenshot for those smart phones and desktops. Please pass it to server as needed. Following are devices we supported: 0 - iPhone4, 1 - iPhone5, 2 - Android, 3 - WinPhone, 4 - iPad, 5 - Android Pad, 6 - Desktop
p2i_screenSTRING
OPTIONALThe screen size of device you want to simulate. Format: screen_widthxscreen_height e.g. 1024x768 We predefined the size for those devices for most usage: Mobile: 320x480 Mobile iPhone5: 320x500 Tablets: 1024x768 Desktop: 1280x800 Advanced information: 1) The screen size should not be less than image size.
p2i_waitSTRING
OPTIONALHow many second wait after page load complete. System will not accept the value less than 30 seconds.
p2i_refreshSTRING
OPTIONALWe will cache the screenshot result for 24 hours. If you does not want to use the cache, please set this value to 1.
Code Snippet
unirest.get("https://p2i.p.rapidapi.com/restfullink?p2i_size=300x300&p2i_imageformat=jpg&p2i_fullpage=0&p2i_device=6&p2i_screen=1024x768&p2i_wait=10&p2i_refresh=0&p2i_url=http%3A%2F%2Fwww.google.com&p2i_key=c8cc5e1a0e739ff8")
.header("X-RapidAPI-Host", "p2i.p.rapidapi.com")
.header("X-RapidAPI-Key", "SIGN-UP-FOR-KEY")
.end(function (result) {
  console.log(result.status, result.headers, result.body);
});
Sample Response
General
Request URL: https://p2i.p.rapidapi.com/restfullink
Request Method: GET
Response Headers
Response Body

Install SDK for NodeJS

Installing

To utilize unirest for node.js install the the npm module:

$ npm install unirest

After installing the npm package you can now start simplifying requests like so:

var unirest = require('unirest');

Creating Request

unirest.get("https://p2i.p.rapidapi.com/restfullink?p2i_size=300x300&p2i_imageformat=jpg&p2i_fullpage=0&p2i_device=6&p2i_screen=1024x768&p2i_wait=10&p2i_refresh=0&p2i_url=http%3A%2F%2Fwww.google.com&p2i_key=c8cc5e1a0e739ff8")
.header("X-RapidAPI-Host", "p2i.p.rapidapi.com")
.header("X-RapidAPI-Key", "SIGN-UP-FOR-KEY")
.end(function (result) {
  console.log(result.status, result.headers, result.body);
});
OAuth2 Authentication
Client ID
Client Secret
OAuth2 Authentication