Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Pricing | Compute Engine :Virtual Machines | GCP

Hello,

I am exploring Cloud Billing API for Compute Engine Virtual Machines - https://cloud.google.com/billing/docs/reference/rest/v1/services.skus/list#PricingExpression

As per the API, it is giving the response for all sku's present for Service - Compute Engine. I wanted the response for single sku based on region.

Also can we get the retail price of single sku by passing sku id, serivce id, region as query parameters in the api.

Please let me know if the above mentioned points can be possible with the Cloud Billing API or let me know if there is any other API available from GCP.

Thank you in Advance 🙂

0 6 2,368
6 REPLIES 6

 

I couldn't find a specific API service that could help you to receive the pricing information of a single SKU service. However, Google Cloud has a pricing estimator link available publicly. You could use that link to get the pricing information associated with a specific SKU. 

Does the mentioned estimator link serve your purpose?

Thank you for the response @digil .

I checked the link you shared and was able to get details specific to sku id, for that webpage I checked in UI console and found below api which is called internally by GCP to get the sku details - 

Request URL - https://lepton.appspot.com/skus?currency=USD&filter=0013-863C-A2FF

Response - 

)
]
}'
{
"message": "",
"status": "SUCCESS",
"skus": [
{
    "SkuId": "0013-863C-A2FF",
    "Category": "Compute Engine",
    "CloudServiceId": "6F81-5844-456A",
    "Description": "Licensing Fee for SQL Server 2016 Standard on VM with 18 VCPU",
    "LastUpdated": "2022-01-10T15:04:39.696087000Z",
    "Prices": {
        "currency": "USD",
        "pricing_quantity": 1.0,
        "usage_unit": "h",
        "aggregation_interval": "AGGREGATION_INTERVAL_UNSPECIFIED",
        "aggregation_level": "AGGREGATION_LEVEL_UNSPECIFIED",
        "price_tiers": [
            {
                "tier_bottom": 0.0,
                "units": 2,
                "nanos": 961000000
            }
        ]
    },
    "ServiceRegions": [
        "global"
    ]
}
],
"last_updated": "2021-08-05T19:12:51.377299000Z"
}

I wanted to use this api in our project to get the retail price of sku for some calculation purpose. so this api will play very important role and hence it should be reliable.

I observed that there is no official documentation present for the above mentioned api. Also it is internally called by GCP, so in future if there is any change in the above api, we will not be aware of and will break our project. Could you please suggest is this api reliable to use or is there any other option for such scenario.

The closest API service that I could find is this one. As you probably know, it provides( is listing) all publicly available SKUs for a given cloud service, not just a specific SKU. 

I further searched through the Cloud Billing Catalog help center article. But I couldn't find a specific API or service that serves your purpose. It looks like a feature request for Cloud Billing API. Feel free to use this template for submitting a feature request with the Cloud Billing API team. An example of one such feature request can be found here.

However, before submitting a feature request with the Cloud Billing API team, I would strongly recommend you to get in touch with Google Cloud Platform's billing support team to see if they are having any new information about this.  If there exists any such API or a service-connected with Cloud Billing API, the Cloud billing team should be able to help you with that information. 

 

 

@digil Thank you for the prompt response. I have created feature request as per the guidance you provided 🙂 

Did you hear back or found the solution to your problem ? 

@rwalde - Did you hear back anything on the feature request. Looking for similar API to fetch per VM cost from GCP.