Test

A Test is the result object in the Scanerr application. A Test is a representaiton of two Scan objects being compared to one another. A Test has 7 primary components:

  1. type -> an array denoting the types of test to run
  2. html_delta -> a detailed list of code snipits found in one scan and not in the other
  3. logs_delta -> a detailed list of error logs found in one scan and not in the other
  4. lighthouse_delta -> an object containing the differences in Lighthouse scores
  5. yellowlab_delta -> an object containing the differences in Yellow Lab scores
  6. images_delta -> an object containing image info, paried scores, and average score (out of 100)
  7. score -> an over all composite score (out of 100)

Test object

{
   "id":"6f61a9bb-ccec-4cc0-8867-b87a5dd00cc8",          // uuid specific to the Test
   "site":"9fb29910-c88b-4b1e-a226-3baf2fb57a3c",        // uuid specific to the Site
   "page":"9f61a910-c77b-4r1y-avds-3ba90io37a3c",        // uuid specific to the Page
   "time_created":"2021-11-18T16:14:24.835536Z",         // timestamp of when Test began
   "time_completed":"2021-11-18T16:14:54.950246Z",       // timestamp of when Test finished running
   "pre_scan":"5b401f3e-2565-4c0e-b8c9-8643a2e90c37",    // uuid specific to the first scan
   "post_scan":"ed2764ab-6256-44f8-aa08-58a3f9faa275",   // uuid specific to the second scan
   "score": 75.7207405219903,                            // total composite score out of 100 (includes html_delta, logs_delta, lighthouse_delta & yellowlab_delta, and images_delta)
   "type": ["html", "logs", "lighthouse", "yellowlab", "vrt"],     // an array containing the types of test(s) to be run
   "tags": ["tag1", "tag2"],                                       // <optional> list of info for user to track data
   "html_delta":{                   // information for differences in html between the two scans
      "pre_html_delta":[            // an array of code blocks present in first scan (pre_scan) and not in second scan (post_scan)
         "<script id=\"ipV6TestScriptwww2\" type=\"text/javascript\" async= src=\"https://www2.bing.com/ipv6test/test\">",
         "<script charset=\"utf-8\" src=\"//assets.msn.com/bundles/v1/bingHomepage/latest/weather-card.8e98e73a1a3e2faea52f.js\" crossorigin=\"anonymous\">",
         "<script charset=\"utf-8\" src=\"//assets.msn.com/bundles/v1/bingHomepage/latest/social-bar-wc.055529c95c555182e7bb.js\" crossorigin=\"anonymous\">",
         "<script charset=\"utf-8\" src=\"//assets.msn.com/bundles/v1/bingHomepage/latest/traffic-card-wc.da90386757c512f3df0c.js\" crossorigin=\"anonymous\">",
         "<script charset=\"utf-8\" src=\"//assets.msn.com/bundles/v1/bingHomepage/latest/sports-card-wc.c55e240a362818dd4adc.js\" crossorigin=\"anonymous\">",
         "<script charset=\"utf-8\" src=\"//assets.msn.com/bundles/v1/bingHomepage/latest/toast.1"
      ],
      "post_html_delta":[        // an array of code blocks present in second scan (post_scan) and not in first scan (pre_scan)
         "<svg id=\"givemuid_heart_homepage\" \"= width=\"32\" height=\"32\" viewBox=\"0 0 32 32\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">",
         "<span id=\"nc_iid\" _ig=\"B195D32D53414BC1B5EAD99A43E116DB\" _iid=\"SERP.5017\">",
         "<form data-h=\"ID=HpApp,21474.1\" class=\"sb_form hassbi hasmic\" id=\"sb_form\" action=\"/search\">",
         "<a id=\"sb_sbiprilnk\" class=\"sbiinflnk\" target=\"_blank\" data-link=\"http://go.microsoft.com/fwlink/?LinkId=521839\" aria-label=\"Privacy Policy\" href=\"#\" h=\"ID=SBI,5035.1\">",
         "<a id=\"sb_sbisalnk\" class=\"sbiinflnk\" target=\"_blank\" data-link=\"http://go.microsoft.com/fwlink/?LinkID=246338\" aria-label=\"Terms of Use\" href=\"#\" h=\"ID=SBI,5036.1\">",
         "<a id=\"sb_sbi_lmlnk\" class=\"sbi_lmlnk\" title=\"Visual Search\" href=\"/visualsearch?FORM=SBILNM\" h=\"ID=SBI,5037.1\">",
         "<a id=\"sb_sbi_dmlnk\" class=\"sbi_dmlnk\" aria-hidden=\"true\" tabindex=\"-1\" href=\"/images\" h=\"ID=SBI,5038.1\">",
         
      ],
      "pre_micro_delta":{        // object used to highlght exactly what is in first scan but not in second scan
         "delta_parsed":[        // an array of 8 character long strings representing all the data in the pre_html_delta
            "<script ",
            "id=\"ipV6",
            "TestScri",
            "ptwww2\" ",
            "type=\"te",
            "xt/javas",
            // SHOETENED FOR DISPLAY PURPOSES
         ],
         "delta_parsed_diff": [   // an array of 8 character long strings present in first scan but not in second scan
            "ptwww2\" ",
            "type=\"te",
            "xt/javas",
         ]
      },
      "post_micro_delta":{       // object used to highlght exactly what is in second scan but not in first scan
         "delta_parsed":[        // an array of 8 character long strings representing all the data in the post_html_delta
            "<script ",
            "id=\"ipV6",
            "TestScri",
            "ptwww2\" ",
            "type=\"te",
            "xt/javas",
            // SHOETENED FOR DISPLAY PURPOSES
         ],
         "delta_parsed_diff": [    // an array of 8 character long strings present in second scan but not in first scan
            "89293r29jj\" ",
            "TestScri",
            "8h824b224f",
         ]
      }
   },
   "logs_delta":{
      "pre_logs_delta":[           // an array of console error logs found in first scan but not in second scan
         {
            "level":"WARNING",
            "source":"javascript",
            "message":"https://www.example.com/?toWww=1&redig=576E204B22AC4747A9E4DCBCBBD65551 - The resource https://www.example.com/rp/lmu8EBCaPRMKtay8LSArGyY3mv4.br.js was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally.",
            "timestamp":"7180013122691"
         }
      ],
      "post_logs_delta":[          // an array of console error logs found in second scan but not in first scan
         {
            "level":"WARNING",
            "source":"javascript",
            "message":"https://www.example.com/?toWww=1&redig=E41435332AF349D7A5D4FE6146B4C953 - The resource https://www.example.com/rp/lmu8EBCaPRMKtay8LSArGyY3mv4.br.js was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally.",
            "timestamp":"2030354520914"
         }
      ]
   },
   "lighthouse_delta":{             // object representing the differences in Lighthouse scores between the first and second scan
      "scores": {                   // second scan score - first scan score
         "seo_delta": 0,     
         "average_delta": 2.75,   
         "current_average": 78.5,   // average score from second scan
         "performance_delta": -11,   
         "accessibility_delta": 0,   
         "best_practices_delta": 0  
      },     
   },
   "yellowlab_delta":{              // object representing the differences in Yellow Lab scores between the first and second scan
      "scores":{                    // second scan score - first scan score
         "fonts_delta": 0,
         "badCSS_delta": 0,
         "jQuery_delta": 0,
         "average_delta": -2,
         "images_delta": 0,
         "current_average": 67,     // average score from second scan
         "pageWeight_delta": 0,
         "serverConfig_delta": 0,
         "badJavascript_delta": 0,
         "cssComplexity_delta": 0,
         "domComplexity_delta": 0,
         "javascriptComplexity_delta": -11
      }
   },
   "images_delta": {             // object representing the differences in screenshots between the first and second scan
      "images":[                 // array of paired screenshots "pre_img" and "post_img"
         {
            "index": 0,          // position of image pair in array
            "score": 100.0,      // score of image similiarity (0-100)
            "pre_img":{          // image object in first scan, position 0
               "id":"c0ac1656-d1a6-4fa8-a23d-6e5ebcac2c1c",    // uuid specific to the image
               "url":"https://storage-scanerr.sfo3.digitaloceanspaces.com/static/sites/ba601adb-1bd6-471f-9c30-a03e5242f40b/c0ac1656-d1a6-4fa8-a23d-6e5ebcac2c1c.png",     // exact url path to image on s3 storage
               "path":"static/sites/ba601adb-1bd6-471f-9c30-a03e5242f40b/c0ac1656-d1a6-4fa8-a23d-6e5ebcac2c1c.png",     // path to image on s3 storage - used by boto3 library
               "index": 0                                      // position of image in array
            },
            "post_img":{                                       // image object in second scan, position 0
               "id":"f17cdedd-884c-40d6-8d0c-4902371a9e55",    // uuid specific to the image    
               "url":"https://storage-scanerr.sfo3.digitaloceanspaces.com/static/sites/ba601adb-1bd6-471f-9c30-a03e5242f40b/f17cdedd-884c-40d6-8d0c-4902371a9e55.png",     // exact url path to image on s3 storage
               "path":"static/sites/ba601adb-1bd6-471f-9c30-a03e5242f40b/f17cdedd-884c-40d6-8d0c-4902371a9e55.png",     // path to image on s3 storage - used by boto3 library
               "index": 0                                      // position of image in array
            },
            "pre_img_diff":{          // image object in first scan with differenes highlighted, position 0
               "id":"c0ac1656-d1a6-4fa8-a23d-6e5ebcac2c1c",    // uuid specific to the image
               "url":"https://storage-scanerr.sfo3.digitaloceanspaces.com/static/sites/ba601adb-1bd6-471f-9c30-a03e5242f40b/c0ac1656-d1a6-4fa8-a23d-6e5ebcac2c1c.png",     // exact url path to image on s3 storage
               "path":"static/sites/ba601adb-1bd6-471f-9c30-a03e5242f40b/c0ac1656-d1a6-4fa8-a23d-6e5ebcac2c1c.png",     // path to image on s3 storage - used by boto3 library
               "index": 0                                      // position of image in array
            },
            "post_img_diff":{                                  // image object in second scan with differenes highlighted, position 0
               "id":"f17cdedd-884c-40d6-8d0c-4902371a9e55",    // uuid specific to the image    
               "url":"https://storage-scanerr.sfo3.digitaloceanspaces.com/static/sites/ba601adb-1bd6-471f-9c30-a03e5242f40b/f17cdedd-884c-40d6-8d0c-4902371a9e55.png",     // exact url path to image on s3 storage
               "path":"static/sites/ba601adb-1bd6-471f-9c30-a03e5242f40b/f17cdedd-884c-40d6-8d0c-4902371a9e55.png",     // path to image on s3 storage - used by boto3 library
               "index": 0                                      // position of image in array
            }
         },
         // SHOETENED FOR DISPLAY PURPOSES
      ],
      "average_score": 100.0     // average of all scores in "images" array
   }
}

Create a Test

There are two endpoints for creating a Test. The most commonly used is the delay endpoint which allows the creation task to run asynchronously on the server and resolves quickly. Alternatively, you may use the traditional endpoint which may take several seconds to resolve as the server is actively creating a test and will return the entire Test object.

data in this request:

"data": {
   "site_id": "<site:id>",    // <required> if no "page_id" 
   "page_id":"<page:id>",     // <required if not "site_id"
   "type": ["html", "logs", "lighthouse", "yellowlab", "vrt"],    // <optional> an array containing the types of test(s) to be run
   "tags": ["tag1", "tag2"],                                      // <optional> list of info for user to track data
   "index": 1,                                                    // <optional> integer denoting which frame of the Scan to test 
   "configs": {                                    // <optional> Configurations for webdriver
      "driver": "selenium",                        // webdriver type - one of selenium or puppeteer
      "device": "desktop",                         // sets the user-Agent, one of dekstop or mobile
      "mask_ids": "example-id-1, example-id-2",    // element id's you wish to mask when taking a screenshot (seperated by comma)
      "interval": 5,                               // time (seconds) the driver will wait between checking if page has loaded
      "window_size": "1920,1080",                  // dimensions of webdriver window. format -> (width,height)
      "max_wait_time": 60,                         // maximum time (seconds) the driver will wait before moving on to next task
      "min_wait_time": 10,                         // minimum time (seconds) the driver will wait before checking if page has loaded and or moving on to next task
      "disable_animations": false,                 // bool which, when true, will disable all animations and videos on the site during a Scan
      "timeout": 300                               // maximum time (seconds) the driver will run before completely timing out during an the VRT process
   }
}

WARNING

Passing the configs object is optional. However, if you do pass the object you must specify all sub-components.

POST - /test/delay

# import env vars
SCANERR_API_BASE_URL = os.environ.get('SCANERR_API_BASE_URL')
SCANERR_API_TOKEN = os.environ.get('SCANERR_API_BASE_URL')

# setup configs
url = f'{SCANERR_API_BASE_URL}/test/delay'
headers = {
    "content-type": "application/json",
    "Authorization" : SCANERR_API_TOKEN
}
data = {
   "page_id": "<page:id>",
   "type": ["html", "logs", "lighthouse", "yellowlab" "vrt"],  
   "tags": ["tag1", "tag2"],
   "index": 1, 
   "configs": { 
      "driver": "selenium",
      "device": "desktop",
      "mask_ids": "example-id-1, example-id-2",
      "interval": 5,
      "window_size": "1920,1080", 
      "max_wait_time": 60, 
      "min_wait_time": 10,
      "disable_animations": False,
      "timeout": 300 
   }
}

# send the request
res = requests.post(
    url=url,
    headers=headers,
    data=json.dumps(data)
)

# retrieve response data
json_response = res.json()
print(json_response)

Output:


{
   "status": true,
   "id": "6f61a9bb-ccec-4cc0-8867-b87a5dd00cc8"
   "message": "test is being created in the background"
}

Retrieve a Test

This endpoint returns a single Test object and is useful as a simple "detailed view" of the test.

GET - /test/<test:id>

import requests, os

# import env vars
SCANERR_API_BASE_URL = os.environ.get('SCANERR_API_BASE_URL')
SCANERR_API_TOKEN = os.environ.get('SCANERR_API_BASE_URL')

# setup configs
url = f'{BASE_URL}/test/<test:id>'
headers = {
    "content-type": "application/json",
    "Authorization" : SCANERR_API_TOKEN
}

# send the request
res = requests.get(
    url=url,
    headers=headers,
)

# retrieve response data
json_response = res.json()
print(json_response)

View Full Output

Output:

{
   "id":"6f61a9bb-ccec-4cc0-8867-b87a5dd00cc8",
   "site":"9fb29910-c88b-4b1e-a226-3baf2fb57a3c",
   "page":"9f61a910-c77b-4r1y-avds-3ba90io37a3c", 
   "time_created":"2021-11-18T16:14:24.835536Z",
   "time_completed":"2021-11-18T16:14:54.950246Z",
   "pre_scan":"5b401f3e-2565-4c0e-b8c9-8643a2e90c37",
   "post_scan":"ed2764ab-6256-44f8-aa08-58a3f9faa275",
   "type": ["vrt", "lighthouse", "logs", "html"],
   "tags": ["tag1", "tag2"],
   "score": 75.7207405219903,
   "html_delta":{
      "pre_html_delta":[
         "<script id=\"ipV6TestScriptwww2\" type=\"text/javascript\" async= src=\"https://www2.bing.com/ipv6test/test\">",
         "<script charset=\"utf-8\" src=\"//assets.msn.com/bundles/v1/bingHomepage/latest/weather-card.8e98e73a1a3e2faea52f.js\" crossorigin=\"anonymous\">",
         "<script charset=\"utf-8\" src=\"//assets.msn.com/bundles/v1/bingHomepage/latest/social-bar-wc.055529c95c555182e7bb.js\" crossorigin=\"anonymous\">",
         "<script charset=\"utf-8\" src=\"//assets.msn.com/bundles/v1/bingHomepage/latest/traffic-card-wc.da90386757c512f3df0c.js\" crossorigin=\"anonymous\">",
         "<script charset=\"utf-8\" src=\"//assets.msn.com/bundles/v1/bingHomepage/latest/sports-card-wc.c55e240a362818dd4adc.js\" crossorigin=\"anonymous\">",
         "<script charset=\"utf-8\" src=\"//assets.msn.com/bundles/v1/bingHomepage/latest/toast.1"
      ],
      "post_html_delta":[
         "<svg id=\"givemuid_heart_homepage\" \"= width=\"32\" height=\"32\" viewBox=\"0 0 32 32\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">",
         "<span id=\"nc_iid\" _ig=\"B195D32D53414BC1B5EAD99A43E116DB\" _iid=\"SERP.5017\">",
         "<form data-h=\"ID=HpApp,21474.1\" class=\"sb_form hassbi hasmic\" id=\"sb_form\" action=\"/search\">",
         "<a id=\"sb_sbiprilnk\" class=\"sbiinflnk\" target=\"_blank\" data-link=\"http://go.microsoft.com/fwlink/?LinkId=521839\" aria-label=\"Privacy Policy\" href=\"#\" h=\"ID=SBI,5035.1\">",
         "<a id=\"sb_sbisalnk\" class=\"sbiinflnk\" target=\"_blank\" data-link=\"http://go.microsoft.com/fwlink/?LinkID=246338\" aria-label=\"Terms of Use\" href=\"#\" h=\"ID=SBI,5036.1\">",
         "<a id=\"sb_sbi_lmlnk\" class=\"sbi_lmlnk\" title=\"Visual Search\" href=\"/visualsearch?FORM=SBILNM\" h=\"ID=SBI,5037.1\">",
         "<a id=\"sb_sbi_dmlnk\" class=\"sbi_dmlnk\" aria-hidden=\"true\" tabindex=\"-1\" href=\"/images\" h=\"ID=SBI,5038.1\">",
      ],
      "pre_micro_delta":{
         "delta_parsed":[
            "<script ",
            "id=\"ipV6",
            "TestScri",
            "ptwww2\" ",
            "type=\"te",
            "xt/javas",
            # SHOETENED FOR DISPLAY PURPOSES
         ],
         "delta_parsed_diff": [
            "ptwww2\" ",
            "type=\"te",
            "xt/javas",
         ]
      }
   },
   "logs_delta":{
      "pre_logs_delta":[
         {
            "level":"WARNING",
            "source":"javascript",
            "message":"https://www.example.com/?toWww=1&redig=576E204B22AC4747A9E4DCBCBBD65551 - The resource https://www.example.com/rp/lmu8EBCaPRMKtay8LSArGyY3mv4.br.js was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally.",
            "timestamp":"7180013122691"
         }
      ],
      "post_logs_delta":[
         {
            "level":"WARNING",
            "source":"javascript",
            "message":"https://www.example.com/?toWww=1&redig=E41435332AF349D7A5D4FE6146B4C953 - The resource https://www.example.com/rp/lmu8EBCaPRMKtay8LSArGyY3mv4.br.js was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally.",
            "timestamp":"2030354520914"
         }
      ]
   },
   "lighthouse_delta":{
      "scores": {
         "seo_delta": 0,
         "average_delta": 2.75,
         "current_average": 78.5,
         "performance_delta": -11,
         "accessibility_delta": 0,
         "best_practices_delta": 0
      },
   },
   "yellowlab_delta":{
      "scores":{
         "fonts_delta": 0,
         "badCSS_delta": 0,
         "jQuery_delta": 0,
         "average_delta": -2,
         "images_delta": 0,
         "current_average": 67,
         "pageWeight_delta": 0,
         "serverConfig_delta": 0,
         "badJavascript_delta": 0,
         "cssComplexity_delta": 0,
         "domComplexity_delta": 0,
         "javascriptComplexity_delta": -11
      }
   },
   "images_delta": {    
      "images":[ 
         {
            "index": 0,     
            "score": 100.0,   
            "pre_img":{    
               "id":"c0ac1656-d1a6-4fa8-a23d-6e5ebcac2c1c",    
               "url":"https://storage-scanerr.sfo3.digitaloceanspaces.com/static/sites/ba601adb-1bd6-471f-9c30-a03e5242f40b/c0ac1656-d1a6-4fa8-a23d-6e5ebcac2c1c.png",     
               "path":"static/sites/ba601adb-1bd6-471f-9c30-a03e5242f40b/c0ac1656-d1a6-4fa8-a23d-6e5ebcac2c1c.png",      
               "index": 0      
            },
            "post_img":{     
               "id":"f17cdedd-884c-40d6-8d0c-4902371a9e55",      
               "url":"https://storage-scanerr.sfo3.digitaloceanspaces.com/static/sites/ba601adb-1bd6-471f-9c30-a03e5242f40b/f17cdedd-884c-40d6-8d0c-4902371a9e55.png",    
               "path":"static/sites/ba601adb-1bd6-471f-9c30-a03e5242f40b/f17cdedd-884c-40d6-8d0c-4902371a9e55.png",      
               "index": 0     
            },
            "pre_img_diff":{
               "id":"c0ac1656-d1a6-4fa8-a23d-6e5ebcac2c1c",  
               "url":"https://storage-scanerr.sfo3.digitaloceanspaces.com/static/sites/ba601adb-1bd6-471f-9c30-a03e5242f40b/c0ac1656-d1a6-4fa8-a23d-6e5ebcac2c1c.png",
               "path":"static/sites/ba601adb-1bd6-471f-9c30-a03e5242f40b/c0ac1656-d1a6-4fa8-a23d-6e5ebcac2c1c.png",
               "index": 0 
            },
            "post_img_diff":{
               "id":"f17cdedd-884c-40d6-8d0c-4902371a9e55",   
               "url":"https://storage-scanerr.sfo3.digitaloceanspaces.com/static/sites/ba601adb-1bd6-471f-9c30-a03e5242f40b/f17cdedd-884c-40d6-8d0c-4902371a9e55.png", 
               "path":"static/sites/ba601adb-1bd6-471f-9c30-a03e5242f40b/f17cdedd-884c-40d6-8d0c-4902371a9e55.png",
               "index": 0
            }
         },
         # SHOETENED FOR DISPLAY PURPOSES
      ],
      "average_score": 100.0 
   }
}

Retrieve a lean Test

This endpoint returns a an abbreviated version of a single Test object. Omits the larger portions of the Test payload including html_delta, logs_delta, images_delta (except for the average_score).

GET - /test/<test:id>/lean

import requests, os

# import env vars
SCANERR_API_BASE_URL = os.environ.get('SCANERR_API_BASE_URL')
SCANERR_API_TOKEN = os.environ.get('SCANERR_API_BASE_URL')

# setup configs
url = f'{BASE_URL}/test/<test:id>/lean'
headers = {
    "content-type": "application/json",
    "Authorization" : SCANERR_API_TOKEN
}

# send the request
res = requests.get(
    url=url,
    headers=headers,
)

# retrieve response data
json_response = res.json()
print(json_response)

View Full Output

Output:

{
   "id":"6f61a9bb-ccec-4cc0-8867-b87a5dd00cc8",
   "site":"9fb29910-c88b-4b1e-a226-3baf2fb57a3c",
   "page":"9f61a910-c77b-4r1y-avds-3ba90io37a3c", 
   "time_created":"2021-11-18T16:14:24.835536Z",
   "time_completed":"2021-11-18T16:14:54.950246Z",
   "pre_scan":"5b401f3e-2565-4c0e-b8c9-8643a2e90c37",
   "post_scan":"ed2764ab-6256-44f8-aa08-58a3f9faa275",
   "type": ["vrt", "lighthouse", "logs", "html"],
   "tags": ["tag1", "tag2"],
   "score": 75.7207405219903,
   "lighthouse_delta":{
      "scores": {
         "seo_delta": 0,
         "average_delta": 2.75,
         "current_average": 78.5,
         "performance_delta": -11,
         "accessibility_delta": 0,
         "best_practices_delta": 0
      },
   },
   "yellowlab_delta":{
      "scores":{
         "fonts_delta": 0,
         "badCSS_delta": 0,
         "jQuery_delta": 0,
         "average_delta": -2,
         "images_delta": 0,
         "current_average": 67,
         "pageWeight_delta": 0,
         "serverConfig_delta": 0,
         "badJavascript_delta": 0,
         "cssComplexity_delta": 0,
         "domComplexity_delta": 0,
         "javascriptComplexity_delta": -11
      }
   },
   "images_delta": {    
      "average_score": 100.0 
   }
}

Retrieve many Tests

This endpoint returns a paginated response with all Test objects filtered by your account and ordered by time_created. This endpoint is useful when needing to displaying your tests in a table view for example. The limit parameter specifies the total number of objects you want returned per "group" (we recomend keeping this under 10 for best performance). The offset parameter specfies which "group" to return. For example, limit=10&offset=10 in a total dataset of 30 objects would return 10 tests in range test #10 - test #20.

TIP

Additionally, an optional parameter is site_id=<site:id> which would limit the objects filtering to the associated site.

GET - /test?limit=10&offset=0

import requests, os

# import env vars
SCANERR_API_BASE_URL = os.environ.get('SCANERR_API_BASE_URL')
SCANERR_API_TOKEN = os.environ.get('SCANERR_API_BASE_URL')

# setup configs
url = f'{BASE_URL}/test?limit=10&offset=0'
headers = {
    "content-type": "application/json",
    "Authorization" : SCANERR_API_TOKEN
}

# send the request
res = requests.get(
    url=url,
    headers=headers,
)

# retrieve response data
json_response = res.json()
print(json_response)

View Full Output

Output:

{
   "count":30,
   "next":"https://api.scanerr.io/v1/ops/test?limit=10&offset=20",
   "previous":"https://api.scanerr.io/v1/ops/test?limit=10&offset=10", 
   "results":[
         {
            "id":"6f61a9bb-ccec-4cc0-8867-b87a5dd00cc8",
            "site":"9fb29910-c88b-4b1e-a226-3baf2fb57a3c",
            "page":"9f61a910-c77b-4r1y-avds-3ba90io37a3c", 
            "time_created":"2021-11-18T16:14:24.835536Z",
            "time_completed":"2021-11-18T16:14:54.950246Z",
            "pre_scan":"5b401f3e-2565-4c0e-b8c9-8643a2e90c37",
            "post_scan":"ed2764ab-6256-44f8-aa08-58a3f9faa275",
            "type": ["vrt", "lighthouse", "logs", "html"],
            "tags": ["tag1", "tag2"],
            "score": 75.7207405219903,
            "html_delta":{
               "pre_html_delta":[
                  "<script id=\"ipV6TestScriptwww2\" type=\"text/javascript\" async= src=\"https://www2.bing.com/ipv6test/test\">",
                  "<script charset=\"utf-8\" src=\"//assets.msn.com/bundles/v1/bingHomepage/latest/weather-card.8e98e73a1a3e2faea52f.js\" crossorigin=\"anonymous\">",
                  "<script charset=\"utf-8\" src=\"//assets.msn.com/bundles/v1/bingHomepage/latest/social-bar-wc.055529c95c555182e7bb.js\" crossorigin=\"anonymous\">",
                  "<script charset=\"utf-8\" src=\"//assets.msn.com/bundles/v1/bingHomepage/latest/traffic-card-wc.da90386757c512f3df0c.js\" crossorigin=\"anonymous\">",
                  "<script charset=\"utf-8\" src=\"//assets.msn.com/bundles/v1/bingHomepage/latest/sports-card-wc.c55e240a362818dd4adc.js\" crossorigin=\"anonymous\">",
                  "<script charset=\"utf-8\" src=\"//assets.msn.com/bundles/v1/bingHomepage/latest/toast.1"
               ],
               "post_html_delta":[
                  "<svg id=\"givemuid_heart_homepage\" \"= width=\"32\" height=\"32\" viewBox=\"0 0 32 32\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">",
                  "<span id=\"nc_iid\" _ig=\"B195D32D53414BC1B5EAD99A43E116DB\" _iid=\"SERP.5017\">",
                  "<form data-h=\"ID=HpApp,21474.1\" class=\"sb_form hassbi hasmic\" id=\"sb_form\" action=\"/search\">",
                  "<a id=\"sb_sbiprilnk\" class=\"sbiinflnk\" target=\"_blank\" data-link=\"http://go.microsoft.com/fwlink/?LinkId=521839\" aria-label=\"Privacy Policy\" href=\"#\" h=\"ID=SBI,5035.1\">",
                  "<a id=\"sb_sbisalnk\" class=\"sbiinflnk\" target=\"_blank\" data-link=\"http://go.microsoft.com/fwlink/?LinkID=246338\" aria-label=\"Terms of Use\" href=\"#\" h=\"ID=SBI,5036.1\">",
                  "<a id=\"sb_sbi_lmlnk\" class=\"sbi_lmlnk\" title=\"Visual Search\" href=\"/visualsearch?FORM=SBILNM\" h=\"ID=SBI,5037.1\">",
                  "<a id=\"sb_sbi_dmlnk\" class=\"sbi_dmlnk\" aria-hidden=\"true\" tabindex=\"-1\" href=\"/images\" h=\"ID=SBI,5038.1\">",
               ],
               "pre_micro_delta":{
                  "delta_parsed":[
                     "<script ",
                     "id=\"ipV6",
                     "TestScri",
                     "ptwww2\" ",
                     "type=\"te",
                     "xt/javas",
                     # SHOETENED FOR DISPLAY PURPOSES
                  ],
                  "delta_parsed_diff": [
                     "ptwww2\" ",
                     "type=\"te",
                     "xt/javas",
                  ]
               }
            },
            "logs_delta":{
               "pre_logs_delta":[
                  {
                     "level":"WARNING",
                     "source":"javascript",
                     "message":"https://www.example.com/?toWww=1&redig=576E204B22AC4747A9E4DCBCBBD65551 - The resource https://www.example.com/rp/lmu8EBCaPRMKtay8LSArGyY3mv4.br.js was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally.",
                     "timestamp":"7180013122691"
                  }
               ],
               "post_logs_delta":[
                  {
                     "level":"WARNING",
                     "source":"javascript",
                     "message":"https://www.example.com/?toWww=1&redig=E41435332AF349D7A5D4FE6146B4C953 - The resource https://www.example.com/rp/lmu8EBCaPRMKtay8LSArGyY3mv4.br.js was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally.",
                     "timestamp":"2030354520914"
                  }
               ]
            },
            "lighthouse_delta":{
               "scores": {
                  "seo_delta": 0,
                  "average_delta": 2.75,
                  "current_average": 78.5,
                  "performance_delta": -11,
                  "accessibility_delta": 0,
                  "best_practices_delta": 0
               },
            },
            "yellowlab_delta":{
               "scores":{
                  "fonts_delta": 0,
                  "badCSS_delta": 0,
                  "jQuery_delta": 0,
                  "average_delta": -2,
                  "images_delta": 0,
                  "current_average": 67,
                  "pageWeight_delta": 0,
                  "serverConfig_delta": 0,
                  "badJavascript_delta": 0,
                  "cssComplexity_delta": 0,
                  "domComplexity_delta": 0,
                  "javascriptComplexity_delta": -11
               }
            },
            "images_delta": {    
               "images":[ 
                  {
                     "index": 0,     
                     "score": 100.0,   
                     "pre_img":{    
                        "id":"c0ac1656-d1a6-4fa8-a23d-6e5ebcac2c1c",    
                        "url":"https://storage-scanerr.sfo3.digitaloceanspaces.com/static/sites/ba601adb-1bd6-471f-9c30-a03e5242f40b/c0ac1656-d1a6-4fa8-a23d-6e5ebcac2c1c.png",     
                        "path":"static/sites/ba601adb-1bd6-471f-9c30-a03e5242f40b/c0ac1656-d1a6-4fa8-a23d-6e5ebcac2c1c.png",      
                        "index": 0      
                     },
                     "post_img":{     
                        "id":"f17cdedd-884c-40d6-8d0c-4902371a9e55",      
                        "url":"https://storage-scanerr.sfo3.digitaloceanspaces.com/static/sites/ba601adb-1bd6-471f-9c30-a03e5242f40b/f17cdedd-884c-40d6-8d0c-4902371a9e55.png",    
                        "path":"static/sites/ba601adb-1bd6-471f-9c30-a03e5242f40b/f17cdedd-884c-40d6-8d0c-4902371a9e55.png",      
                        "index": 0     
                     },
                     "pre_img_diff":{
                        "id":"c0ac1656-d1a6-4fa8-a23d-6e5ebcac2c1c",  
                        "url":"https://storage-scanerr.sfo3.digitaloceanspaces.com/static/sites/ba601adb-1bd6-471f-9c30-a03e5242f40b/c0ac1656-d1a6-4fa8-a23d-6e5ebcac2c1c.png",
                        "path":"static/sites/ba601adb-1bd6-471f-9c30-a03e5242f40b/c0ac1656-d1a6-4fa8-a23d-6e5ebcac2c1c.png",
                        "index": 0 
                     },
                     "post_img_diff":{
                        "id":"f17cdedd-884c-40d6-8d0c-4902371a9e55",   
                        "url":"https://storage-scanerr.sfo3.digitaloceanspaces.com/static/sites/ba601adb-1bd6-471f-9c30-a03e5242f40b/f17cdedd-884c-40d6-8d0c-4902371a9e55.png", 
                        "path":"static/sites/ba601adb-1bd6-471f-9c30-a03e5242f40b/f17cdedd-884c-40d6-8d0c-4902371a9e55.png",
                        "index": 0
                     }
                  },
                  # SHOETENED FOR DISPLAY PURPOSES
               ],
               "average_score": 100.0 
            }
         },
        {
            "id":"6f61a9bb-ccec-4cc0-8867-b87a5dd00cc8",
            "site":"9fb29910-c88b-4b1e-a226-3baf2fb57a3c",
            "page":"9f61a910-c77b-4r1y-avds-3ba90io37a3c", 
            "page":"9fb29910-c88b-4b1e-a226-3baf2fb57a3c",
            "time_created":"2021-11-18T16:14:24.835536Z",
            "time_completed":"2021-11-18T16:14:54.950246Z",
            "pre_scan":"5b401f3e-2565-4c0e-b8c9-8643a2e90c37",
            "post_scan":"ed2764ab-6256-44f8-aa08-58a3f9faa275",
            "type": ["vrt", "lighthouse", "logs", "html"],
            "tags": ["tag1", "tag2"],
            "score": 75.7207405219903,
            "html_delta":{
               "pre_html_delta":[
                  "<script id=\"ipV6TestScriptwww2\" type=\"text/javascript\" async= src=\"https://www2.bing.com/ipv6test/test\">",
                  "<script charset=\"utf-8\" src=\"//assets.msn.com/bundles/v1/bingHomepage/latest/weather-card.8e98e73a1a3e2faea52f.js\" crossorigin=\"anonymous\">",
                  "<script charset=\"utf-8\" src=\"//assets.msn.com/bundles/v1/bingHomepage/latest/social-bar-wc.055529c95c555182e7bb.js\" crossorigin=\"anonymous\">",
                  "<script charset=\"utf-8\" src=\"//assets.msn.com/bundles/v1/bingHomepage/latest/traffic-card-wc.da90386757c512f3df0c.js\" crossorigin=\"anonymous\">",
                  "<script charset=\"utf-8\" src=\"//assets.msn.com/bundles/v1/bingHomepage/latest/sports-card-wc.c55e240a362818dd4adc.js\" crossorigin=\"anonymous\">",
                  "<script charset=\"utf-8\" src=\"//assets.msn.com/bundles/v1/bingHomepage/latest/toast.1"
               ],
               "post_html_delta":[
                  "<svg id=\"givemuid_heart_homepage\" \"= width=\"32\" height=\"32\" viewBox=\"0 0 32 32\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">",
                  "<span id=\"nc_iid\" _ig=\"B195D32D53414BC1B5EAD99A43E116DB\" _iid=\"SERP.5017\">",
                  "<form data-h=\"ID=HpApp,21474.1\" class=\"sb_form hassbi hasmic\" id=\"sb_form\" action=\"/search\">",
                  "<a id=\"sb_sbiprilnk\" class=\"sbiinflnk\" target=\"_blank\" data-link=\"http://go.microsoft.com/fwlink/?LinkId=521839\" aria-label=\"Privacy Policy\" href=\"#\" h=\"ID=SBI,5035.1\">",
                  "<a id=\"sb_sbisalnk\" class=\"sbiinflnk\" target=\"_blank\" data-link=\"http://go.microsoft.com/fwlink/?LinkID=246338\" aria-label=\"Terms of Use\" href=\"#\" h=\"ID=SBI,5036.1\">",
                  "<a id=\"sb_sbi_lmlnk\" class=\"sbi_lmlnk\" title=\"Visual Search\" href=\"/visualsearch?FORM=SBILNM\" h=\"ID=SBI,5037.1\">",
                  "<a id=\"sb_sbi_dmlnk\" class=\"sbi_dmlnk\" aria-hidden=\"true\" tabindex=\"-1\" href=\"/images\" h=\"ID=SBI,5038.1\">",
               ],
               "pre_micro_delta":{
                  "delta_parsed":[
                     "<script ",
                     "id=\"ipV6",
                     "TestScri",
                     "ptwww2\" ",
                     "type=\"te",
                     "xt/javas",
                     # SHOETENED FOR DISPLAY PURPOSES
                  ],
                  "delta_parsed_diff": [
                     "ptwww2\" ",
                     "type=\"te",
                     "xt/javas",
                  ]
               }
            },
            "logs_delta":{
               "pre_logs_delta":[
                  {
                     "level":"WARNING",
                     "source":"javascript",
                     "message":"https://www.example.com/?toWww=1&redig=576E204B22AC4747A9E4DCBCBBD65551 - The resource https://www.example.com/rp/lmu8EBCaPRMKtay8LSArGyY3mv4.br.js was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally.",
                     "timestamp":"7180013122691"
                  }
               ],
               "post_logs_delta":[
                  {
                     "level":"WARNING",
                     "source":"javascript",
                     "message":"https://www.example.com/?toWww=1&redig=E41435332AF349D7A5D4FE6146B4C953 - The resource https://www.example.com/rp/lmu8EBCaPRMKtay8LSArGyY3mv4.br.js was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally.",
                     "timestamp":"2030354520914"
                  }
               ]
            },
            "lighthouse_delta":{
               "scores": {
                  "seo_delta": 0,
                  "average_delta": 2.75,
                  "current_average": 78.5,
                  "performance_delta": -11,
                  "accessibility_delta": 0,
                  "best_practices_delta": 0
               },
            },
            "yellowlab_delta":{
               "scores":{
                  "fonts_delta": 0,
                  "badCSS_delta": 0,
                  "jQuery_delta": 0,
                  "average_delta": -2,
                  "images_delta": 0,
                  "current_average": 67,
                  "pageWeight_delta": 0,
                  "serverConfig_delta": 0,
                  "badJavascript_delta": 0,
                  "cssComplexity_delta": 0,
                  "domComplexity_delta": 0,
                  "javascriptComplexity_delta": -11
               }
            },
            "images_delta": {    
               "images":[ 
                  {
                     "index": 0,     
                     "score": 100.0,   
                     "pre_img":{    
                        "id":"c0ac1656-d1a6-4fa8-a23d-6e5ebcac2c1c",    
                        "url":"https://storage-scanerr.sfo3.digitaloceanspaces.com/static/sites/ba601adb-1bd6-471f-9c30-a03e5242f40b/c0ac1656-d1a6-4fa8-a23d-6e5ebcac2c1c.png",     
                        "path":"static/sites/ba601adb-1bd6-471f-9c30-a03e5242f40b/c0ac1656-d1a6-4fa8-a23d-6e5ebcac2c1c.png",      
                        "index": 0      
                     },
                     "post_img":{     
                        "id":"f17cdedd-884c-40d6-8d0c-4902371a9e55",      
                        "url":"https://storage-scanerr.sfo3.digitaloceanspaces.com/static/sites/ba601adb-1bd6-471f-9c30-a03e5242f40b/f17cdedd-884c-40d6-8d0c-4902371a9e55.png",    
                        "path":"static/sites/ba601adb-1bd6-471f-9c30-a03e5242f40b/f17cdedd-884c-40d6-8d0c-4902371a9e55.png",      
                        "index": 0     
                     },
                     "pre_img_diff":{
                        "id":"c0ac1656-d1a6-4fa8-a23d-6e5ebcac2c1c",  
                        "url":"https://storage-scanerr.sfo3.digitaloceanspaces.com/static/sites/ba601adb-1bd6-471f-9c30-a03e5242f40b/c0ac1656-d1a6-4fa8-a23d-6e5ebcac2c1c.png",
                        "path":"static/sites/ba601adb-1bd6-471f-9c30-a03e5242f40b/c0ac1656-d1a6-4fa8-a23d-6e5ebcac2c1c.png",
                        "index": 0 
                     },
                     "post_img_diff":{
                        "id":"f17cdedd-884c-40d6-8d0c-4902371a9e55",   
                        "url":"https://storage-scanerr.sfo3.digitaloceanspaces.com/static/sites/ba601adb-1bd6-471f-9c30-a03e5242f40b/f17cdedd-884c-40d6-8d0c-4902371a9e55.png", 
                        "path":"static/sites/ba601adb-1bd6-471f-9c30-a03e5242f40b/f17cdedd-884c-40d6-8d0c-4902371a9e55.png",
                        "index": 0
                     }
                  },
                  # SHOETENED FOR DISPLAY PURPOSES
               ],
               "average_score": 100.0 
            }
         },
      
      ### SHORTENED FOR DISPLAY PURPOSES ###
      
   ]
}

Delete a Test

DANGER

Please use caution with this endpoint as it is irreversible.

DELETE - /test/<test:id>

import requests, os

# import env vars
SCANERR_API_BASE_URL = os.environ.get('SCANERR_API_BASE_URL')
SCANERR_API_TOKEN = os.environ.get('SCANERR_API_BASE_URL')

# setup configs
url = f'{BASE_URL}/test/<test:id>'
headers = {
    "content-type": "application/json",
    "Authorization" : SCANERR_API_TOKEN
}

# send the request
res = requests.delete(
    url=url, 
    headers=headers, 
)

# retrieve response data
json_response = res.json()
print(json_response)

View Full Output

Output:

    {
      "message": "test deleted successfully"
    }

Delete many Tests

This endpoint allows the user to send an array of Test id's to be deleted. Scanerr will iterate through the id's and respond with an object detailing which Tests were successfully deleted and which were not.

DANGER

Please use caution with this endpoint as it is irreversible.

POST - /tests/delete

import requests, os

# import env vars
SCANERR_API_BASE_URL = os.environ.get('SCANERR_API_BASE_URL')
SCANERR_API_TOKEN = os.environ.get('SCANERR_API_BASE_URL')

# setup configs
url = f'{BASE_URL}/tests/delete'
headers = {
    "content-type": "application/json",
    "Authorization" : SCANERR_API_TOKEN
}

data = {
   "ids": ['<test:id1>', '<test:id2>', '<test:id3>']
}

# send the request
res = requests.post(
    url=url, 
    headers=headers, 
    data=data,
)

# retrieve response data
json_response = res.json()
print(json_response)

View Full Output

Output:

    {
      "status": true,
      "num_succeeded": 3,
      "succeeded": [ 
         '<test:id1>',
         '<test:id2>', 
         '<test:id3>'
      ],
      "num_failed": 1,
      "failed": []
    }

Last Updated:
Contributors: landon, Landon