<!-- https://developers.silktide.com/v1/governance/checks/get-check | Governance / Checks -->

# Get one check and its history

`GET /v1/results/check`

Returns one check on a website or section: where it stands now, the same as
in [Get checks](https://developers.silktide.com/v1/governance/checks/get-checks.md), and every past
measurement of its score and issue count.

The last entry in `history` is the latest measurement again, timed at the
moment you asked, so a chart drawn from it runs up to now. Ignore it if you
only want real measurements.

`history` always covers the check's whole history; this query takes no
`period`.

A `checkId` the website is not tested with is an error, but it comes back
with status `200` and an `error` body of type `ModelNotFound`. Check for
`error` before reading `result`.

## Request

### Query parameters

- `checkId` (string, required): The check, by the id Get checks returns.
- `websiteId` (integer, required, at least 1): The website.
- `sectionId` (integer, optional): A section of the website. Defaults to `0`, the whole website.

## Response

Status `200`.

- `result` (object, required): The answer.
  - `check` (object, required): The check now.
    - `checkId` (string, required): The check's id, such as `broken-links`. Use it with Get check.
    - `checkerId` (string, required): The internal name of the code that runs the check, such as `Links/BrokenLinks`.
    - `name` (string, required): What the check asks for, in the API user's language.
    - `subName` (string, required): The standard it tests against, such as `WCAG 2.0 A 1.3.1`. Can be empty.
    - `shortName` (string, required): A short name for the check.
    - `policyId` (integer, required): The policy the check comes from, or `0` for Silktide's own checks.
    - `checkType` (string, required): The older classification: `auto` (automatic), `assist` (needs a person's judgment), `info`, or empty.
    - `confidence` (string, required): How sure Silktide is of an issue: `error`, `warning` or `review`. Can be `info` or empty for older checks.
    - `status` (string, required): `open` when it has something to fix, `done` when it does not. One of: `open`, `done`.
    - `severity` (number, required, 0 to 100): How much its issues matter, from 0 to 100.
    - `opened` (integer, required): When it was opened. `0` if it never was.
    - `closed` (integer, required): When it was closed. `0` if it is not.
    - `numIssues` (integer, required): How many issues it found.
    - `score` (number, required, can be null, 0 to 100): Its score out of 100. Null when it cannot be scored.
  - `history` (list of objects, required): Each measurement of the check. The last entry repeats the latest one, timed when you asked.
    - `time` (integer, required): When it was measured.
    - `score` (number, required, can be null, 0 to 100): Its score then.
    - `numIssues` (integer, required): Its issues then.
- `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` | `checkId` is missing. The body is an error despite the status. |
| 200 | `ModelNotFound` | The website or section is not tested with that check. 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 4 and Silktide 5
- Cost: free
- Stability: stable, since 1.0.0

## Example: Broken links on a website

```bash
curl "https://api.eu.silktide.com/v1/results/check?checkId=broken-links&websiteId=3" \
  -H "Authorization: silktide token=$SILKTIDE_API_KEY"
```

Response:

```json
{
  "result": {
    "check": {
      "checkId": "broken-links",
      "checkerId": "Links/BrokenLinks",
      "name": "Check and fix broken links",
      "subName": "",
      "shortName": "Broken links",
      "policyId": 0,
      "checkType": "auto",
      "confidence": "error",
      "status": "open",
      "severity": 77.625,
      "opened": 1790224865,
      "closed": 0,
      "numIssues": 4,
      "score": 82.5
    },
    "history": [
      {
        "time": 1790215200,
        "score": 82.608696,
        "numIssues": 8
      },
      {
        "time": 1790820000,
        "score": 82.5,
        "numIssues": 4
      }
    ]
  },
  "selector": "/v1/results/check",
  "duration": 0.006
}
```
