Jump to Content
Cost Management

Using Google Cloud’s new Pricing API

August 11, 2023
Shruthi Nambi

Product Manager

Whether you’re new to Google Cloud or a veteran user, the new Pricing API gives you the tools you need to better understand your costs and improve visibility into your spend.

If you are an existing Google Cloud user, you might already be familiar with the Billing Catalog API, which provides programmatic access to list prices for all public services and SKUs in billing. A service groups together SKUs of the same product line. Recently, Google Cloud released a new Pricing API that is an improvement over the existing Catalog API. The new Pricing API is available  in public preview and open to all customers. 

The new Pricing API allows you to not only get list prices on all the available services but also account-specific custom prices and discounts with additional metadata, down to the SKU level. Visibility into your custom pricing and discounts along with SKU-level metadata, including product and geo taxonomy, allows this API to efficiently facilitate improved cost auditing, estimation, and spend optimization.

Why does pricing matter?

Every organization in the cloud wants to optimize costs. However, it can be  difficult to assess current costs or estimate future trends without understanding prices. The price of a SKU is calculated using a pricing model that takes into consideration the list price of that SKU, account-specific discounts, and accrued usage in the past. Different services and SKUs employ different pricing models. Depending on your negotiated contract or agreement, your account may have varied types of discounts. Additionally, foreign exchange rates may also play a role in determining the price in your local currency. Given all these variables, understanding price is not straightforward. However, knowing the exact price specific to your account is important to support your cost optimization goals, with Pricing API’s intent being to help you in this journey! 

How is the new Pricing API different from the existing Billing Catalog API?

For starters, the Catalog API only provides an inventory of public services and SKUs with their list prices. The Pricing API, on the other hand, gives you visibility into all public services and SKUs plus the ones that are available to your billing account as part of your contract or agreement. What specifically differentiates it from the Catalog API is that it shows your negotiated contract pricing and discounts, if any, for all the SKUs, specific to your account. In addition to metadata such as SKU-to-service mapping that is already provided by the Catalog API, it provides additional information such as list of SKU groups, SKU-to-SKU group mapping, and geo and product taxonomy that allows you to further slice and dice the SKUs for improved analysis.  

The release of the Pricing API opens up multiple possibilities for pricing and cost analysis. As similar types of resources are priced differently across regions, this API allows you to track and compare your prices to determine the ideal SKU for cost optimization. It also allows you to track your custom discounts across resources and regions to understand how your savings compare. Further, you can also use this API, along with usage metrics, to analyze any spikes indicated in your cost reports. For instance, assume your reports showed a cost increase for one of the services used by your account, say Cloud SQL. In addition to analyzing your usage of this service, you could filter and drill into the SKUs that belong to this specific service by using the Pricing API’s ListBillingAccountSkus method. Your query and JSON response, for this example, would look something like the below. Please note these are sample responses for illustrative purposes.

Loading...

Loading...

Note that the response to the above query has been limited to two SKUs for the purposes of this example. 

You can further drill into any of the SKUs to understand the exact contracted price and discount, using the GetBillingAccountPrice method. Your query and response for this specific example would look something like this:

Loading...

Loading...

Loading...

Loading...

Based on the above response, you can see that the SKU for ‘Cloud SQL for PostgreSQL’ in the us-west3 region is slightly cheaper than the other SKU. However, they both get the same type of discount, related to SKU group, and in this case they both belong to the same SKU Group. From here, you could drill into the specific SKU Group, using ListSkuGroupSkus method, to understand if there are other SKUs that align with your usage needs and are better positioned to bring your costs down. 

What the Pricing API effectively does is enable you to build applications on top of it that compare different SKUs on varied parameters, including price, to aid your usage and cost analyses. Additional uses include support in helping determine your budgets, and efficient auditing of your payments and invoices. Like I said, the possibilities for analysis using this API are endless!

How to get started

To understand more about the Pricing API and to get started, check out the documentation here. It gives a detailed description of all the API calls, sample responses, resources and permissions you need to access desired information. To stay on top of what’s new with Google Cloud billing, head over to Cloud Billing Release Notes

Additionally, if you are planning to attend Google Cloud Next, be sure to stop by the following FinOps and cost optimization sessions:

  1. Unlock Cloud value for everyone using Google Cloud FinOps tools

  2. Control cost and build financial resilience with automation: An SAP story

  3. Use Looker to empower Cloud financial decisions and FinOps

  4. Optimize your Google Cloud costs with data-driven approaches

  5. Optimize your data and analytics costs

  6. Create a FinOps culture change through automation

Posted in