HTTP EndpointAPI Client Library Documentation
This documentation is for the HTTP Endpoint. For
For API Libraries and Examples in these or other languages, refer to the Docs Index Page
We have introduced a new rendering engine based on Chrome v68. While it offers a superior experience to Webkit, it is currently in preview mode. If you want to give it a try, please be sure to include
backend:"chrome" in your request.
These examples use
GET requests because they are the simplest way of showing examples and getting started, but it is strongly suggested you use the
POST endpoint for "real" usage.
pngif you need transparency (if the backgrounds are weirdly black)
@media:printdirectives if you set IRenderSettings.emulateMedia, but we default to @media:screen for improved compatibility *
pageResponse.pageRequestfor the default values to other parameters.
imgtag. For more info on using selectors, see This Mozilla page
viewportto 640px width, zooms out, and sets a 640x500
clipRectangleto generate a thumbnail image of the CNN.com website.
www.highcharts.comhas been replaced with
wikipedia.orgbut the path is preserved. read the text of the output error message to see this.
clearCache:trueparameter. This is required so that .css resources are re-requested and blocked.
clearCache:trueparameter. This is required so that all resources are re-requested so headers are populated.
Accept-encoding:tacosvalues in the resulting HTML. Uses our example show request details page
outputAsJson:trueor you will not get usable results
application/jsonContent-Type and submit POST data. Check the
payloadsection of the output results.
resourceTimeoutparameter like this example does. We will be developing our own proxy service in the coming months.
Other Examples: See the Docs Index Page Usage FAQ for other examples (such as Page Automation / Button Clicking)
Test Pages: These pages are used in some of the above examples, and might be useful to you when evaluating this service:
To use this API, you need to submit a
POST request to the API endpoint:
GET requests are the simplest way of showing examples and getting started, but it is strongly suggested you use the
POST endpoint for "real" usage.
[REQUEST-JSON]should be encoded via
encodeURIComponent(), do not encode the parts individually.
Your key used for creditBalance/billing. You can obtain this by signing up, or use the special key
a-demo-key-with-low-quota-per-ip-address for testing.
The details of your request as a JSON object. This JSON can take one of the following three forms, each of which are described here:
url is required, everything else is optional. Click here to view the default values if you leave the various parameters blank
You can use
CORS (preferred) or
JSONP to integrate api calls from PhantomJs Cloud directly into your webpage.
CORSenabled by default.
JSONPformat, add the
?callback=CALLBACK_FUNCTION_NAMEquerystring to your request (for either
POSTrequests). You MUST set
outputAsJson:truefor JSONP to work. Here is an example JSONP simple request.
Please refer to the main Docs Index Page for Basic Troubleshooting, Testing and Performance Optimization, Usage FAQ, and language-specific samples.
select the browser engine you will use
you may choose from the following shortcuts: "
webkit pjs2.1.1, will change to
chrome v68 soon
chrome v68. may change at any time as this is for testing new backends or feature enhancements.
webkit: the latest stabke version of the default PhantomJs rendering engine:
chrome: the latest stable version of chrome, (currently
or choose a specific backend:
all IBackendType choices are converted into one of these internally