---
updatedAt: 2024-12-11T17:28:35.000Z
agentTools:
  projectIndex: https://developer.windward.ai/llms.txt
---

# complianceRiskBy (risk insights)

Returns the risk score of vessels based on regime levels and IMO.

The complianceRiskBy query returns the risk score of vessels related to selected regime levels and vessel IMO. The results are consumed per page, limited to 500 vessels per page. Page size and number are controlled by the limit and offset variables.

# Arguments

| Name  | Type                                                | Description                                    |
| :---- | :-------------------------------------------------- | :--------------------------------------------- |
| input | [ComplianceRiskByInput!](https://developer.windward.ai/reference/complianceriskbyinput) | Filters vessels by compliance risk properties. |

## ComplianceRiskByInput Fields

| Name   | Type                                                            | Description                                                                   |
| :----- | :-------------------------------------------------------------- | :---------------------------------------------------------------------------- |
| filter | [ComplianceRiskByFilterInput!](https://developer.windward.ai/reference/complianceriskbyfilterinput) | Sets the vessel compliance risk filtering criteria.                           |
| limit  | [PositiveInt!](https://developer.windward.ai/reference/scalars)                                     | The maximal number of records to return.                                      |
| offset | [NonNegativeInt!](https://developer.windward.ai/reference/scalars)                                  | The number of returned records to skip from the beginning of the record list. |

# Returns

| Name                                                          | Description                                                                                                    |
| :------------------------------------------------------------ | :------------------------------------------------------------------------------------------------------------- |
| [ComplianceRiskByConnection!](https://developer.windward.ai/reference/complianceriskbyconnection) | The compliance risk information of the vessels filtered by the [complianceRiskBy](https://developer.windward.ai/reference/complianceriskby) query. |

## ComplianceRiskByConnection Fields

| Name       | Type                                                  | Description                                                                             |
| :--------- | :---------------------------------------------------- | :-------------------------------------------------------------------------------------- |
| nodes      | [\[ComplianceVesselRisk!\]](ref:compliancevesselrisk) | The vessels whose compliance risk attributes match the compliance filtering attributes. |
| totalCount | [NonNegativeInt!](https://developer.windward.ai/reference/scalars)                        | The number of vessels returned.                                                         |

# Example Code

## Sample Query

```graphql
query ComplianceRiskBy($input: ComplianceRiskByInput!) {
  complianceRiskBy(input: $input) {
    totalCount
    nodes {
      imo
      level
      program
      isSanctioned
      riskySince
      buildingBlocks {
        name
        count
        program
        recentActivityStartDate
        level
      }
    }
  }
}
```

## Variables

```json
{
  "input": {
    "limit": 200,
    "offset": 100,
    "filter": {
      "regimes": "RUSSIA_GENERAL"
    }
  }
}
```

## Response

```json
{
  "data": {
    "complianceRiskBy": {
      "totalCount": 7942,
      "nodes": [
        {
          "imo": "9119684",
          "level": "Medium",
          "program": [
            "RUSSIA_GENERAL"
          ],
          "isSanctioned": false,
          "riskySince": "2022-07-29T07:10:00.000Z",
          "buildingBlocks": [
            {
              "name": "DARK_ACTIVITY",
              "count": null,
              "program": null,
              "recentActivityStartDate": null,
              "level": "Low"
            },
               .
               .
               .
            {
              "name": "SANCTIONED_COUNTRY_COMPANY",
              "count": null,
              "program": null,
              "recentActivityStartDate": null,
              "level": "Low"
            }
          ]
        },
          .
          .
          .
        {
          "imo": "7618272",
          "level": "Medium",
          "program": [
            "RUSSIA_GENERAL"
          ],
          "isSanctioned": false,
          "riskySince": null,
          "buildingBlocks": [
            {
              "name": "DARK_ACTIVITY",
              "count": null,
              "program": null,
              "recentActivityStartDate": null,
              "level": "Low"
            },
               .
               .
               .
            {
              "name": "SANCTIONED_COUNTRY_COMPANY",
              "count": null,
              "program": [
                "RUSSIA_GENERAL"
              ],
              "recentActivityStartDate": "2021-09-08T00:00:00.000Z",
              "level": "Medium"
            }
          ]
        }
      ]
    }
  }
}
```