Documentation

Documentation to build on the Passmarked platform

View Report

Passmarked runs tests on websites, which can be either single pages or full websites. The API can be used to start and wait for reports to run and return with the results.

The result of these reports create tons of data which can be used by anyone integrating with the platform. We've placed a ton of focus on supplying data which would be useful for our market of developers.

Install

To enable the Passmarked Client side API in your project, add the following script:

<script src="//jsapi.passmarked.com/v1.js"></script>

For more details, see github.com/passmarked/js on the project itself.

After adding the script, the passmarked object will become available for use

Request

To request the report, the .getReport() function is provided. The function is called as such:

passmarked.getReport({
  uid: '(report-uid)'
}, function(err, report) {
  if(err) {
    console.error(err);
  } else {
    console.log('Report for ' + report.getDomain());
    console.log('Which was run on ' + report.getCreated());
    console.log('And scored ' + report.getScore());
  }
});

The function supports and expects a few parameters as such:

NameTypeDescription
uidstringREQUIRED - The UID of the report to fetch

Response

The function will return a Report object that has the following functions:

NameTypeDescription
.getUID()stringReturns the UID of the report
.getURL()stringFinal url of the page/website that was tested
.getOrigin()stringReturns null if the page was not redirected, but if redirected will contain the initial supplied url to be tested.
.getProtocol()stringReturns the protocol that was used when testing the page, either http or https
.getDomain()stringReturns the domain of the page/website
.getPort()integerReturns the port that was used while testing
.getCountry()stringReturns an ISO code of the country where the servers are located and that responded to our request for the website/page
.getRegion()stringReturns an ISO code of the region that the servers are located in
.getCity()stringReturns the name of the city in which the servers are hosting the website/page
.getLat()stringReturns the latitude (normally the center of a city) where the servers are located
.getLng()stringReturns the longitude (normally the center of a city) where the servers are located
.getIP()stringReturns the IP of the server that was connected while testing the page/website
.getFamily()stringReturns the family of connection used when connecting to the server, either IPV4 or IPV6.
.getStatus()stringReturns the current status of the page, which could be:
  • pending - The report has been queued to test
  • running - Currently connecting to the page and rendering
  • testing - Running tests on the results of the connection and rendering
  • done - The report is finished, and will contain an score, depending on result.
.getResult()stringReturns the result of testing the page
  • success - Everything worked like a charm, we were able to connect and test the page/website
  • timeout - The request to the page took either more than 30 seconds to get a HTML response, or more than 60 seconds to render the complete JS of the page.
  • notfound - The page returned a 404 NOT FOUND
  • auth - The page requested authentication using AUTH BASIC or 401
  • invalid - The page responded with something other than a 200 status code or text/html
  • failed - After trying all our options, we just were not able to connect to the server. ALL HOPE IS LOST !
  • expired - The report was sitting in our queue for more than 1 hour and expired. This is more to ensure we do not have stale reports that never complete.
  • error - We had a error and the team was notified :(
.isRecursive()booleanReturns true or false based on if this is a report for a single page (non-recursive) or an entire website (recursive)
.getPreviews()array[object]Returns a list of different previews/screenshots in various sizes and configs from our run on the website. See Previews for more information.
.getPalette()array[string]Returns a list of predominant colors found on the page in HEX from the various previews/screenshots. See Palette for more information.
.getScore()floatIf the result was success, the report will contain a calculated score from our weighted rules from the community that can be used to signal quality of page/website.
.getSize()integerReturns the size of the page/website in bytes
.getLoadtime()integerReturns the total time it took to load the page/website with all images and javascript
.getRequests()integerReturns the number of requests made to render the page
.getNotices()integerReturns the number of issues found marked as a notice
.getWarnings()integerReturns the number of issues found marked as a warning
.getErrors()integerReturns the number of issues found marked as a error
.getCriticals()integerReturns the number of issues found marked as a critical
.getCount()integerReturns the total number of issues found on the page
.getTests()array[object]Returns the list of tests that were run on the page/website along with their individual results. See Tests for more information.
.getStack()array[string]Returns any technologies found on the page from list of known vendors. See Technology Stacks for more information and a list of known vendors.

Previews / Screenshots

When testing a website/page, screenshots are taking in various configs and screen sizes to test the page's responsive capabilities along with support for various modern devices. Each of these screenshots are appended to the results of the report and supplied with the following information:

NameTypeDescription
widthintegerWidth of the screen when taking the screenshot
heightintegerHeight of the screen when taking the screenshot
palettearray[string]List of predominant colors in the screenshot
urlstringURL of the screenshot itself
keystring"key" of the screenshot. Currently this only includes desktop and mobile

Palette

When testing the Previews / Screenshots from the page/website are used to generate a list of main colors in HEX format.

These colors are then combined to form a single list of main colors found on the site, and returned an array in the property palette.

Technology Stacks

The platform is able to detect over 700 technologies on pages being tested, which allows the platform to make decisions based on technology used.

Signup icon
Ready to see how well your site scores?

Passmarked works best when you have an account. It allows you to keep a dashboard with saved data of the sites you have run through the system, we’ll alert you about important updates and you get access to the Passmarked Slack forum.

Sign up to get started