Skip to main content
GET
/
recommendations
/
by_type
/
{type}
/
resources
Get all resources for a recommendation type
curl --request GET \
  --url https://api.vantage.sh/v2/recommendations/by_type/{type}/resources \
  --header 'Authorization: Bearer <token>'
import requests

url = "https://api.vantage.sh/v2/recommendations/by_type/{type}/resources"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch('https://api.vantage.sh/v2/recommendations/by_type/{type}/resources', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.vantage.sh/v2/recommendations/by_type/{type}/resources",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer <token>"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.vantage.sh/v2/recommendations/by_type/{type}/resources"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://api.vantage.sh/v2/recommendations/by_type/{type}/resources")
  .header("Authorization", "Bearer <token>")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://api.vantage.sh/v2/recommendations/by_type/{type}/resources")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
{
  "resources": [
    {
      "token": "pvdr_rsrc_abc123",
      "resource_id": "i-1234567890abcdef0",
      "recommendation_actions": [
        {
          "action": "modify",
          "instance_type": "c5a.xlarge",
          "description": "Migrate to c5a.xlarge for cost savings.",
          "potential_savings": "100.00"
        }
      ]
    }
  ],
  "links": {
    "first": "/v2/recommendations/by_type/aws:ec2:co-rightsizing/resources?workspace_token=wrkspc_abc123&page=1",
    "last": "/v2/recommendations/by_type/aws:ec2:co-rightsizing/resources?workspace_token=wrkspc_abc123&page=1"
  }
}
{
  "errors": [
    "<string>"
  ],
  "links": {
    "self": "<string>",
    "first": "<string>",
    "next": "<string>",
    "last": "<string>",
    "prev": "<string>"
  }
}

Authorizations

Authorization
string
header
required

The access token received from the authorization server in the OAuth 2.0 flow.

Path Parameters

type
string
required

Query Parameters

provider_ids
enum<string>[]

Filter by one or more providers. Requires workspace_token.

Available options:
aws,
gcp,
azure,
kubernetes,
datadog
billing_account_ids
string[]

Filter by billing account identifiers. Requires workspace_token.

account_ids
string[]

Filter by account identifiers. Requires workspace_token.

regions
string[]

Filter by region slugs (e.g. us-east-1, eastus, asia-east1). Requires workspace_token.

tag_key
string

Filter by tag key (must be used with tag_value). Requires workspace_token.

tag_value
string

Filter by tag value (requires tag_key). Requires workspace_token.

start_date
string

Filter recommendations created on/after this YYYY-MM-DD date. Requires workspace_token.

end_date
string

Filter recommendations created on/before this YYYY-MM-DD date. Requires workspace_token.

status
enum<string>

Filter by status.

Available options:
active,
archived
min_savings
number<float>

Filter by recommendations whose potential savings are greater than or equal to this amount, in the workspace's currency. Requires workspace_token.

page
integer<int32>

The page of results to return.

limit
integer<int32>

The number of results to return. The maximum is 1000.

workspace_token
string
required

The workspace token to filter recommendations by. Required.

Response

RecommendationProviderResources model

resources
object[]
required