Resources

Recommendations

Overview

Recommendations represent pending savings opportunities identified by LevelFour across your cloud accounts. Each recommendation includes the affected service, estimated monthly and annual savings, and available actions (accept, reject, execute).

Methods

Get Savings by Provider

Returns a summary of potential savings grouped by cloud provider (AWS, GCP, Azure, K8s).

summary = client.recommendations.get_savings_by_provider()

Get Potential Savings

Returns potential savings summary grouped by provider.

potential = client.recommendations.get_potential_savings()

Get Overview

Returns overview metrics across all providers: total spend, available savings, pending savings, and saved-to-date.

overview = client.recommendations.get_overview()

List Recommendations

Returns a paginated list of all recommendations. Supports sorting by multiple fields.

page = client.recommendations.list(
    page=1,
    page_size=50,
    sort_by="monthly_savings",
    sort_order="desc",
)

for rec in page:
    print(f"{rec.service}: ${rec.monthly_savings}/mo")

Parameters

ParameterTypeDescription
pageintPage number (1-indexed)
page_sizeintItems per page (max 100)
sort_bystringSort field: recommendation_id, service, environment, monthly_savings, annual_savings, savings_percentage, analysis_period, created_at
sort_orderstringasc or desc

Get Recommendation

Returns complete details for a specific recommendation by ID.

detail = client.recommendations.get("rec_123")

List In-Progress

Returns all recommendations currently in processing status.

processing = client.recommendations.list_in_progress()

Response Types

RecommendationItem

Returned in paginated list responses.

FieldTypeDescription
recommendation_idstringUnique business identifier
servicestringCloud service name
environmentstring?Environment tag
analysis_periodstring?Analysis time window
monthly_savingsfloatEstimated monthly savings
annual_savingsfloatEstimated annual savings
current_spendingfloatCurrent monthly spend
savings_percentagefloatSavings as percentage of current spend
actionsobject?Available actions for this recommendation

Example: Find High-Value AWS Recommendations

from levelfour import LevelFour

client = LevelFour()

for rec in client.providers.list_recommendations(
    "aws",
    page_size=20,
    sort_by="monthly_savings",
    sort_order="desc",
    display_status=["available"],
):
    if rec.monthly_savings > 100:
        print(f"{rec.recommendation_id}: ${rec.monthly_savings}/mo")