Search cost recommendations

Note: This endpoint is in preview and is subject to change. If you have any feedback, contact Datadog support.

POST https://api.ap1.datadoghq.com/api/v2/cost/recommendationshttps://api.ap2.datadoghq.com/api/v2/cost/recommendationshttps://api.datadoghq.eu/api/v2/cost/recommendationshttps://api.ddog-gov.com/api/v2/cost/recommendationshttps://api.us2.ddog-gov.com/api/v2/cost/recommendationshttps://api.datadoghq.com/api/v2/cost/recommendationshttps://api.us3.datadoghq.com/api/v2/cost/recommendationshttps://api.us5.datadoghq.com/api/v2/cost/recommendations

Overview

List cost recommendations matching a filter, with pagination and sorting.

OAuth apps require the cloud_cost_management_read authorization scope to access this endpoint.

Arguments

Query Strings

Name

Type

Description

page[size]

string

Number of results per page (1–10000).

page[token]

string

Pagination token from a previous response.

Request

Body Data (required)

Expand All

Field

Type

Description

filter

string

Filter expression applied to the recommendations.

sort

[object]

Ordered list of sort clauses applied to the result set.

expression

string

Field to sort by (for example, potential_daily_savings.amount).

order

string

Sort direction, either ASC or DESC.

view

string

Active view name (for example, active, dismissed, open, in-progress, or completed).

{
  "filter": "string",
  "sort": [
    {
      "expression": "string",
      "order": "string"
    }
  ],
  "view": "string"
}

Response

OK

A page of cost recommendations with pagination metadata.

Expand All

Field

Type

Description

data [required]

[object]

The list of cost recommendations on this page.

attributes

object

Attributes describing a single cost recommendation.

dd_resource_key

string

Datadog resource key identifying the recommended resource.

potential_daily_savings

object

Estimated daily savings if the recommendation is applied.

amount

double

Numeric amount of the potential daily savings.

currency

string

ISO 4217 currency code for the savings amount.

recommendation_type

string

The kind of recommendation (for example, terminate or rightsize).

resource_id

string

Cloud provider identifier of the resource.

resource_type

string

Resource type (for example, aws_ec2_instance).

tags

[string]

Tags attached to the recommended resource.

id

string

Unique identifier for the recommendation.

type [required]

enum

Recommendation resource type. Allowed enum values: recommendation

default: recommendation

meta

object

Top-level JSON:API meta object for paginated cost recommendation responses.

page

object

Pagination metadata for a page of cost recommendations.

filter

string

The filter expression that was applied to produce this page.

next_page_token

string

Opaque token used to fetch the next page; absent on the last page.

page_size

int32

Number of items returned in this page (1–10000).

page_token

string

Pagination token echoed back from the request.

{
  "data": [
    {
      "attributes": {
        "dd_resource_key": "string",
        "potential_daily_savings": {
          "amount": "number",
          "currency": "string"
        },
        "recommendation_type": "string",
        "resource_id": "string",
        "resource_type": "string",
        "tags": []
      },
      "id": "string",
      "type": "recommendation"
    }
  ],
  "meta": {
    "page": {
      "filter": "string",
      "next_page_token": "string",
      "page_size": "integer",
      "page_token": "string"
    }
  }
}

Too many requests

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Code Example

                  ## default
# 

# Curl command
curl -X POST "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.us2.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/cost/recommendations" \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \ -d @- << EOF { "filter": "@resource_table:aws_ec2_instance", "sort": [ { "expression": "potential_daily_savings.amount", "order": "DESC" } ] } EOF