How to use the Website Statistics API

This page explains how to use our API to fetch high-level statistics about the websites in your Silktide account.

The common use-case for our API is to extract data for use in your organization’s internal report tools, such as Power BI or Tableau.

All requests to our API should be authenticated using a Silktide account API key. Our API is RESTful and communicates using JSON.

To obtain your API key, please contact your Account Manager to obtain this.

Authenticating a request

Send your API key as a query parameter (?apiKey=[[YOUR_KEY]]) with each request.

If your API key is invalid or you do not have access to the resource you are requesting, you will receive the following response:

{ "error": { "type": "Exception", "message": "Invalid API key", "properties": { "requiredPermission": null } }, "type": "AccessDenied" }

How to use this API Endpoint

Method: GET
Endpoint: https://api.{regionId}.silktide.com/v1/websites/stats

The {regionId} would be which region your account is stored in.
us for USA.
eu for the rest of the world.

Example API request

curl "https://api.us.silktide.com/v1/websites/stats?apiKey=[redacted]"

Example API response

{ "websites": "2": { "name": "My Main Website", "homeUrl": "https:\/\/www.example.com\/", "websiteId": 2, "stats": { "wcag-20-a.score": { "label": "WCAG 2.0 A score", "value": 64.510262 }, "wcag-20-aa.score": { "label": "WCAG 2.0 AA score", "value": 59.042248 }, "wcag-20-aaa.score": { "label": "WCAG 2.0 AAA score", "value": 58.114101 }, "wcag-20.score": { "label": "Accessibility (WCAG 2.0) score", "value": 61.363632 }, "wcag-21-a.score": { "label": "WCAG 2.1 A score", "value": 64.510262 }, ... and many more stats }, "sections": { "3": { "name": "Wines selection", "homeUrl": "https:\/\/www.example.com\/wines", "sectionId": 3, "stats": { "wcag-20-a.score": { "label": "WCAG 2.0 A score", "value": 60.510262 }, "wcag-20-aa.score": { "label": "WCAG 2.0 AA score", "value": 54.042248 }, "wcag-20-aaa.score": { "label": "WCAG 2.0 AAA score", "value": 52.114101 }, "wcag-20.score": { "label": "Accessibility (WCAG 2.0) score", "value": 63.363632 }, "wcag-21-a.score": { "label": "WCAG 2.1 A score", "value": 68.510262 }, ... and many more stats }, } } } }

Response fields

Each result inside the key of websites will be keyed by the Website ID and contain key information about the website. This includes the stats object which will return the headline stats for that website at the current moment in time. The sections object inside a website is keyed by the Section ID, and will contain key information about the section and another stats object for just that section.

Each statistic contains a brief description as to what this is used for.

Need extra help?

Chat with our support team now and we'll be happy to help you with any issues