---
title: List all scores
description: Returns a list of scorecard scores for each aggregation type, with score breakdowns.
breadcrumbs: Docs > API > List all scores
---

> For the complete documentation index, see [llms.txt](https://dnd37xeb23o8n.cloudfront.net/stefon.simmons/docs-astro-web-10435/llms.txt).

# List all scores

## v2 (latest)

| Datadog site      | API endpoint                                                            |
| ----------------- | ----------------------------------------------------------------------- |
| app.datadoghq.com | GET https://api.datadoghq.com/api/v2/scorecard/scores/{aggregation}     |
| us3.datadoghq.com | GET https://api.us3.datadoghq.com/api/v2/scorecard/scores/{aggregation} |
| us5.datadoghq.com | GET https://api.us5.datadoghq.com/api/v2/scorecard/scores/{aggregation} |
| app.datadoghq.eu  | GET https://api.datadoghq.eu/api/v2/scorecard/scores/{aggregation}      |
| ap1.datadoghq.com | GET https://api.ap1.datadoghq.com/api/v2/scorecard/scores/{aggregation} |
| ap2.datadoghq.com | GET https://api.ap2.datadoghq.com/api/v2/scorecard/scores/{aggregation} |
| uk1.datadoghq.com | GET https://api.uk1.datadoghq.com/api/v2/scorecard/scores/{aggregation} |
| app.ddog-gov.com  | GET https://api.ddog-gov.com/api/v2/scorecard/scores/{aggregation}      |
| us2.ddog-gov.com  | GET https://api.us2.ddog-gov.com/api/v2/scorecard/scores/{aggregation}  |

### Overview

Returns a list of scorecard scores for each aggregation type, with score breakdowns.

OAuth apps require the `apm_service_catalog_read` authorization [scope](https://dnd37xeb23o8n.cloudfront.net/stefon.simmons/docs-astro-web-10435/api/latest/scopes.md#scorecards) to access this endpoint.

### Arguments

#### Path Parameters

| Field                    | Type | Description                                                                                                            |
| ------------------------ | ---- | ---------------------------------------------------------------------------------------------------------------------- |
| aggregation [*required*] | enum | The type of scores being requested. Allowed enum values: `by-entity`, `by-rule`, `by-scorecard`, `by-team`, `by-kind`. |

#### Query Strings

| Field                      | Type    | Description                                                                                                                                                |
| -------------------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
| filter[rule][id]           | string  | Filter scores by rule ID(s), comma-separated.                                                                                                              |
| filter[rule][name]         | string  | Filter scores by rule name.                                                                                                                                |
| filter[rule][level]        | string  | Filter scores by rule level(s), comma-separated.                                                                                                           |
| filter[rule][scorecard_id] | string  | Filter scores by scorecard ID(s), comma-separated.                                                                                                         |
| filter[rule][is_custom]    | boolean | Filter scores to show only custom rules.                                                                                                                   |
| filter[rule][is_enabled]   | boolean | Filter scores to show only enabled rules.                                                                                                                  |
| sort                       | string  | Sort scores by field. Use a hyphen prefix for descending order. Options: score, numerator, denominator, total_pass, total_fail, total_skip, total_no_data. |
| page[offset]               | integer | Offset for pagination. Default: `0`.                                                                                                                       |
| page[limit]                | integer | Number of scores to return. Max is 1000. Default: `100`.                                                                                                   |

### Response

{% tabs %}
{% tab label="200" %}
OK

{% tabs %}
{% tab label="Model" %}
A list of scorecard scores for a given aggregation type.

| Parent field  | Field             | Type     | Description                                                                                                      |
| ------------- | ----------------- | -------- | ---------------------------------------------------------------------------------------------------------------- |
|               | data              | [object] | Array of score objects.                                                                                          |
| data          | attributes        | object   | Attributes of a scorecard score.                                                                                 |
| attributes    | aggregation       | enum     | Dimension to group scores by. Allowed enum values: `by-entity`, `by-rule`, `by-scorecard`, `by-team`, `by-kind`. |
| attributes    | denominator       | int64    | The denominator used to compute the score ratio.                                                                 |
| attributes    | level             | int64    | The maturity level of the associated rule.                                                                       |
| attributes    | numerator         | int64    | The numerator used to compute the score ratio.                                                                   |
| attributes    | score             | double   | The computed score ratio (numerator/denominator), from 0 to 1.                                                   |
| attributes    | total_entities    | int64    | The total number of entities evaluated.                                                                          |
| attributes    | total_fail        | int64    | The number of rules that failed.                                                                                 |
| attributes    | total_no_data     | int64    | The number of rules with no data.                                                                                |
| attributes    | total_pass        | int64    | The number of rules that passed.                                                                                 |
| attributes    | total_skip        | int64    | The number of rules that were skipped.                                                                           |
| data          | id [*required*]   | string   | The ID of the entity or resource being scored.                                                                   |
| data          | relationships     | object   | Relationships for a scorecard score, depending on the aggregation type.                                          |
| relationships | entity            | object   | A relationship item for a score.                                                                                 |
| entity        | data              | object   | A relationship data object for a score.                                                                          |
| data          | id [*required*]   | string   | The ID of the related resource.                                                                                  |
| data          | type [*required*] | string   | The type of the related resource.                                                                                |
| relationships | rule              | object   | A relationship item for a score.                                                                                 |
| rule          | data              | object   | A relationship data object for a score.                                                                          |
| data          | id [*required*]   | string   | The ID of the related resource.                                                                                  |
| data          | type [*required*] | string   | The type of the related resource.                                                                                |
| relationships | scorecard         | object   | A relationship item for a score.                                                                                 |
| scorecard     | data              | object   | A relationship data object for a score.                                                                          |
| data          | id [*required*]   | string   | The ID of the related resource.                                                                                  |
| data          | type [*required*] | string   | The type of the related resource.                                                                                |
| relationships | service           | object   | A relationship item for a score.                                                                                 |
| service       | data              | object   | A relationship data object for a score.                                                                          |
| data          | id [*required*]   | string   | The ID of the related resource.                                                                                  |
| data          | type [*required*] | string   | The type of the related resource.                                                                                |
| relationships | team              | object   | A relationship item for a score.                                                                                 |
| team          | data              | object   | A relationship data object for a score.                                                                          |
| data          | id [*required*]   | string   | The ID of the related resource.                                                                                  |
| data          | type [*required*] | string   | The type of the related resource.                                                                                |
| data          | type [*required*] | enum     | The JSON:API resource type. Allowed enum values: `score`. Default: `score`.                                      |
|               | links             | object   | Links attributes.                                                                                                |
| links         | next              | string   | Link for the next set of rules.                                                                                  |
|               | meta              | object   | Pagination metadata for scores.                                                                                  |
| meta          | count             | int64    | The number of results returned in this page.                                                                     |
| meta          | limit             | int64    | The page limit.                                                                                                  |
| meta          | offset            | int64    | The page offset.                                                                                                 |
| meta          | total             | int64    | The total number of results.                                                                                     |
{% /tab %}

{% tab label="Example" %}
```json
{
  "data": [
    {
      "attributes": {
        "aggregation": "by-entity",
        "denominator": "integer",
        "level": "integer",
        "numerator": "integer",
        "score": "number",
        "total_entities": "integer",
        "total_fail": "integer",
        "total_no_data": "integer",
        "total_pass": "integer",
        "total_skip": "integer"
      },
      "id": "",
      "relationships": {
        "entity": {
          "data": {
            "id": "",
            "type": ""
          }
        },
        "rule": {
          "data": {
            "id": "",
            "type": ""
          }
        },
        "scorecard": {
          "data": {
            "id": "",
            "type": ""
          }
        },
        "service": {
          "data": {
            "id": "",
            "type": ""
          }
        },
        "team": {
          "data": {
            "id": "",
            "type": ""
          }
        }
      },
      "type": "score"
    }
  ],
  "links": {
    "next": "/api/v2/scorecard/rules?page%5Blimit%5D=2&page%5Boffset%5D=2&page%5Bsize%5D=2"
  },
  "meta": {
    "count": "integer",
    "limit": "integer",
    "offset": "integer",
    "total": "integer"
  }
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="400" %}
Bad Request

{% tabs %}
{% tab label="Model" %}
API error response.

| Field               | Type     | Description       |
| ------------------- | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    "Bad Request"
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="403" %}
Forbidden

{% tabs %}
{% tab label="Model" %}
API error response.

| Field               | Type     | Description       |
| ------------------- | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    "Bad Request"
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="429" %}
Too many requests

{% tabs %}
{% tab label="Model" %}
API error response.

| Field               | Type     | Description       |
| ------------------- | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    "Bad Request"
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}
{% /tabs %}

### Code Example

{% tabs %}
{% tab label="Curl" %}
```bash
# Path parameters
export aggregation="by-entity"

# Set your Datadog site and credentials
export DD_SITE="datadoghq.com" # Or us3.datadoghq.com, us5.datadoghq.com, datadoghq.eu, ap1.datadoghq.com, ap2.datadoghq.com, uk1.datadoghq.com, ddog-gov.com, us2.ddog-gov.com
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X GET "https://api.${DD_SITE}/api/v2/scorecard/scores/${aggregation}" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"
```
{% /tab %}

{% tab label="Go" %}
```go
// List all scores returns "OK" response

package main

import (
	"context"
	"encoding/json"
	"fmt"
	"os"

	"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
	"github.com/DataDog/datadog-api-client-go/v2/api/datadogV2"
)

func main() {
	ctx := datadog.NewDefaultContext(context.Background())
	ctx = context.WithValue(ctx, datadog.ContextAccessToken, os.Getenv("DD_BEARER_TOKEN"))
	configuration := datadog.NewConfiguration()
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewScorecardsApi(apiClient)
	resp, r, err := api.ListScorecardScores(ctx, datadogV2.SCORECARDSCORESAGGREGATION_BY_ENTITY, *datadogV2.NewListScorecardScoresOptionalParameters())

	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `ScorecardsApi.ListScorecardScores`: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}

	responseContent, _ := json.MarshalIndent(resp, "", "  ")
	fmt.Fprintf(os.Stdout, "Response from `ScorecardsApi.ListScorecardScores`:\n%s\n", responseContent)
}
```

#### Instructions

First [install the library and its dependencies](https://dnd37xeb23o8n.cloudfront.net/api/latest.md?code-lang=go) and then save the example to `main.go` and run following commands:

```bash
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"
```
{% /tab %}

{% tab label="Java" %}
```java
// List all scores returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.ScorecardsApi;
import com.datadog.api.client.v2.model.ListScorecardScoresResponse;
import com.datadog.api.client.v2.model.ScorecardScoresAggregation;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN"));
    ScorecardsApi apiInstance = new ScorecardsApi(defaultClient);

    try {
      ListScorecardScoresResponse result =
          apiInstance.listScorecardScores(ScorecardScoresAggregation.BY_ENTITY);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling ScorecardsApi#listScorecardScores");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}
```

#### Instructions

First [install the library and its dependencies](https://dnd37xeb23o8n.cloudfront.net/api/latest.md?code-lang=java) and then save the example to `Example.java` and run following commands:

```bash
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"
```
{% /tab %}

{% tab label="Python" %}
```python
"""
List all scores returns "OK" response
"""

from os import environ
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.scorecards_api import ScorecardsApi
from datadog_api_client.v2.model.scorecard_scores_aggregation import ScorecardScoresAggregation

configuration = Configuration()
configuration.access_token = environ["DD_BEARER_TOKEN"]
with ApiClient(configuration) as api_client:
    api_instance = ScorecardsApi(api_client)
    response = api_instance.list_scorecard_scores(
        aggregation=ScorecardScoresAggregation.BY_ENTITY,
    )

    print(response)
```

#### Instructions

First [install the library and its dependencies](https://dnd37xeb23o8n.cloudfront.net/api/latest.md?code-lang=python) and then save the example to `example.py` and run following commands:

```bash
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"
```
{% /tab %}

{% tab label="Ruby" %}
```ruby
# List all scores returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
  config.access_token = ENV["DD_BEARER_TOKEN"]
end
api_instance = DatadogAPIClient::V2::ScorecardsAPI.new
p api_instance.list_scorecard_scores(ScorecardScoresAggregation::BY_ENTITY)
```

#### Instructions

First [install the library and its dependencies](https://dnd37xeb23o8n.cloudfront.net/api/latest.md?code-lang=ruby) and then save the example to `example.rb` and run following commands:

```bash
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"
```
{% /tab %}

{% tab label="Rust" %}
```rust
// List all scores returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_scorecards::ListScorecardScoresOptionalParams;
use datadog_api_client::datadogV2::api_scorecards::ScorecardsAPI;
use datadog_api_client::datadogV2::model::ScorecardScoresAggregation;

#[tokio::main]
async fn main() {
    let configuration = datadog::Configuration::new();
    let api = ScorecardsAPI::with_config(configuration);
    let resp = api
        .list_scorecard_scores(
            ScorecardScoresAggregation::BY_ENTITY,
            ListScorecardScoresOptionalParams::default(),
        )
        .await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
```

#### Instructions

First [install the library and its dependencies](https://dnd37xeb23o8n.cloudfront.net/api/latest.md?code-lang=rust) and then save the example to `src/main.rs` and run following commands:

```bash
DD_SITE="datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
```
{% /tab %}

{% tab label="TypeScript" %}
```typescript
/**
 * List all scores returns "OK" response
 */

import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration({
  authMethods: {
    AuthZ: {
      accessToken: process.env.DD_BEARER_TOKEN as string,
    },
  },
});
const apiInstance = new v2.ScorecardsApi(configuration);

const params: v2.ScorecardsApiListScorecardScoresRequest = {
  aggregation: "by-entity",
};

apiInstance
  .listScorecardScores(params)
  .then((data: v2.ListScorecardScoresResponse) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  })
  .catch((error: any) => console.error(error));
```

#### Instructions

First [install the library and its dependencies](https://dnd37xeb23o8n.cloudfront.net/api/latest.md?code-lang=typescript) and then save the example to `example.ts` and run following commands:

```bash
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"
```
{% /tab %}
{% /tabs %}
