<!-- https://developers.silktide.com/v1/governance/scores/get-module-scores | Governance / Scores -->

# Get a website's Silktide 5 scores

`GET /v1/results/module-scores`

Returns a website's scores as Silktide 5 works them out: one for each module,
and its WCAG conformance at each version and level. Each is its latest value
in the period. With no `period`, that is the latest score there is.

This is for accounts that have Silktide 5. An account that has only
Silktide 4 gets an `EditionNotAvailable` error; it reads
[Get a website's scores](https://developers.silktide.com/v1/governance/scores/get-scores.md) instead. The two
editions score websites differently, so their numbers are not comparable.
[Scores](https://developers.silktide.com/v1/concepts/scores.md) explains which to use.

Every id is always in the answer, so you can read the ones you need without
checking. A score with no value in the period, such as one for a website
Silktide has not tested yet, is `null`.

Use an id with
[Get how a Silktide 5 score changed](https://developers.silktide.com/v1/governance/scores/get-module-score-trend.md)
to see how it changed.

## Request

### Query parameters

- `websiteId` (integer, required, at least 1): The website.
- `sectionId` (integer, optional): A section of the website. Defaults to `0`, the whole website.
- `period` (string, optional): The date range. Defaults to `all`. The spaced forms (`-7 days`, `month to date`) are older names that keep working. `custom` needs `from` and `to`. One of: `all`, `today`, `last-7-days`, `last-30-days`, `last-90-days`, `month-to-date`, `last-month`, `year-to-date`, `last-12-months`, `custom`, `-7 days`, `-30 days`, `-90 days`, `-1 month`, `month to date`, `year to date`, `-12 months`.
- `from` (string, optional): With `period=custom`, the first day, such as `2026-10-01`.
- `to` (string, optional): With `period=custom`, the last day.
- `timezone` (string, optional): The IANA time zone days are read in, such as `America/New_York`. Defaults to `UTC`.

## Response

Status `200`.

- `result` (object, required): The answer.
  - `scores` (object, required): Every score by id, out of 100 to one decimal place. Every id is always present; null when the website has no value for it in the period.
    - `accessibility` (number, required, can be null, 0 to 100): The Accessibility module.
    - `compliance` (number, required, can be null, 0 to 100): The Compliance module.
    - `content` (number, required, can be null, 0 to 100): The Content module.
    - `user-experience` (number, required, can be null, 0 to 100): The User experience module.
    - `wcag-20-a` (number, required, can be null, 0 to 100): WCAG 2.0, level A.
    - `wcag-20-aa` (number, required, can be null, 0 to 100): WCAG 2.0, level AA.
    - `wcag-20-aaa` (number, required, can be null, 0 to 100): WCAG 2.0, level AAA.
    - `wcag-21-a` (number, required, can be null, 0 to 100): WCAG 2.1, level A.
    - `wcag-21-aa` (number, required, can be null, 0 to 100): WCAG 2.1, level AA.
    - `wcag-21-aaa` (number, required, can be null, 0 to 100): WCAG 2.1, level AAA.
    - `wcag-22-a` (number, required, can be null, 0 to 100): WCAG 2.2, level A.
    - `wcag-22-aa` (number, required, can be null, 0 to 100): WCAG 2.2, level AA.
    - `wcag-22-aaa` (number, required, can be null, 0 to 100): WCAG 2.2, level AAA.
- `selector` (string, required): The query that answered, as its path: `/v1/results/scores`.
- `duration` (number, required): Seconds Silktide took to answer.

## Errors

| Status | Type | When |
| --- | --- | --- |
| 404 | `ModelNotFound` | No website or section with that id exists in the account, or the API key's user cannot see it. |
| 200 | `InvalidContext` | No `websiteId` was sent. The body is an error despite the status. |
| 200 | `InvalidArgument` | `period` is not one of its values. The body is an error despite the status. |
| 200 | `EditionNotAvailable` | The account does not have Silktide 5. Its `status` is `403`, and `instead` names `/v1/results/scores`. The body is an error despite the status. |
| 401 | `NotLoggedIn` | No API key was sent, or it is not a key for this region. |
| 429 | `TooManyRequests` | Too many requests to this path in five seconds. Retry after the number of seconds in the `Retry-After` header, which `properties.retryAfter` repeats. |
| 503 | - | Silktide is busy. Retry after the number of seconds in the `Retry-After` header. |

## Access

- Permission: any user of the account
- Plan feature: none
- Edition: Silktide 5 only
- Cost: free
- Stability: stable, since 1.1.0

## Example: A website's latest Silktide 5 scores

```bash
curl "https://api.eu.silktide.com/v1/results/module-scores?websiteId=2" \
  -H "Authorization: silktide token=$SILKTIDE_API_KEY"
```

Response:

```json
{
  "result": {
    "scores": {
      "accessibility": 94.3,
      "compliance": 90.6,
      "content": 71.2,
      "user-experience": 71.6,
      "wcag-20-a": 96.8,
      "wcag-20-aa": 96.4,
      "wcag-20-aaa": 95.9,
      "wcag-21-a": 95.9,
      "wcag-21-aa": 95.4,
      "wcag-21-aaa": 94.7,
      "wcag-22-a": 95.7,
      "wcag-22-aa": 95.3,
      "wcag-22-aaa": 94.5
    }
  },
  "selector": "/v1/results/module-scores",
  "duration": 0.021
}
```
