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

# Get how a Silktide 5 score changed over time

`GET /v1/results/module-score-trend`

Returns every measurement of one Silktide 5 score in the period, oldest
first, for a website or one of its sections. Take score ids from
[Get a website's Silktide 5 scores](https://developers.silktide.com/v1/governance/scores/get-module-scores.md).

This is for accounts that have Silktide 5. An account that has only
Silktide 4 gets an `EditionNotAvailable` error; it reads
[Get how a score changed](https://developers.silktide.com/v1/governance/scores/get-score-trend.md) instead.
[Scores](https://developers.silktide.com/v1/concepts/scores.md) explains which to use.

Unlike the Silktide 4 trend, a `scoreId` that is missing or not one of the
values is refused, and the error lists the values. Scores here are never
below `0`.

## Request

### Query parameters

- `scoreId` (string, required): The score, by the id Get Silktide 5 scores uses, such as `accessibility`. One of: `accessibility`, `compliance`, `content`, `user-experience`, `wcag-20-a`, `wcag-20-aa`, `wcag-20-aaa`, `wcag-21-a`, `wcag-21-aa`, `wcag-21-aaa`, `wcag-22-a`, `wcag-22-aa`, `wcag-22-aaa`.
- `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` (list of objects, required): Every measurement in the period, oldest first. Empty when there are none.
    - `time` (integer, required): When the score was measured.
    - `score` (number, required, 0 to 100): The score then, to one decimal place.
- `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 | `InvalidRequest` | `scoreId` is missing or is not one of its values. Its `status` is `400`, and `properties.scoreIds` lists the values. 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/score-trend`. 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: Accessibility over the last 90 days

```bash
curl "https://api.eu.silktide.com/v1/results/module-score-trend?scoreId=accessibility&websiteId=2&period=last-90-days" \
  -H "Authorization: silktide token=$SILKTIDE_API_KEY"
```

Response:

```json
{
  "result": {
    "scores": [
      {
        "time": 1790216529,
        "score": 94.7
      },
      {
        "time": 1790567588,
        "score": 94.9
      },
      {
        "time": 1793646780,
        "score": 94.3
      }
    ]
  },
  "selector": "/v1/results/module-score-trend",
  "duration": 0.006
}
```
