Get Google Cloud Platform Pricing Information

This page shows you how to use the Cloud Billing Catalog API to:

  • Get a list of all public services including relevant metadata about each service.
  • Get a list of all public SKUs within a service including:
    • Human readable description of the SKU.
    • Public pricing of the SKU.
    • Regions where the SKU is available for purchase.
    • Categorization data about the SKU.

Before you begin

Calling the Cloud Billing Catalog API requires an API Key. You can find details about API Keys in Using API Keys.

Listing public services from the catalog

In this step you will get a list of all public services including relevant metadata about each service.

API

The following code snippet lists all public services in the catalog:

Request:

GET https://cloudbilling.googleapis.com/v1/services?key=API_KEY

Response:

{
  "services": [
    {
      "name": "[SERVICE_NAME]",
      "serviceId": "[SERVICE_ID]",
      "displayName": "[DISPLAY_NAME]",
    },
    [...]
  ]
}

Where:

  • [SERVICE_NAME] is the resource name for the service.
  • [SERVICE_ID] is the identifier for the service.
  • [DISPLAY_NAME] is the human readable display name for the service.

Getting the list of SKUs for a service

API

The following code snippet lists the SKUs in the catalog for the specified service:

Request:

GET https://cloudbilling.googleapis.com/v1/services/SERVICE_ID/skus?key=API_KEY

Where:

  • SERVICE_ID is the identifier of the parent service.

Response:

{
  "skus": [
    {
        "name": "[SKU_NAME]",
        "skuId": "[SKU_ID]",
        "description": "[SKU_DESCRIPTION]",
        "category": {
            "serviceDisplayName": "[SVC_DISPLAY_NAME]",
            "resourceFamily": "[FAMILY]",
            "resourceGroup": "[GROUP]",
            "usageType": "[USAGE]",
        },
        "serviceRegions": [
          "[REGION]"
        ],
        "pricingInfo": [
          {
              "effectiveTime": "[TIME]",
              "summary": "[SUMMARY]",
              "pricingExpression": {
                  "usageUnit": "[UNIT]",
                  "usageUnitDescription": "[UNIT_DESCRIPTION]",
                  "displayQuantity": [DISPLAY_QUANTITY],
                  "tieredRates": [
                    {
                        "startUsageAmount": [START_AMOUNT],
                        "unitPrice": {
                            "currencyCode": "[CURRENCY_CODE]",
                            "units": [UNITS],
                            "nanos": [NANOS],
                        },
                    }
                  ],
              },
              "aggregationInfo": {
                  "aggregationLevel": enum("[AGGREGATION_LEVEL]"),
                  "aggregationInterval": enum("[AGGREGATION_INTERVAL]"),
                  "aggregationCount": [AGGREGATION_COUNT],
              },
              "currencyConversionRate": [CONVERSION_RATE],
          }
        ],
        "serviceProviderName": "[SERVICE_PROVIDER]",
    }
  ]
}

Where:

  • [SKU_NAME] is the resource name for the SKU in the form services/{SERVICE_ID}/skus/{SKU_ID}.
  • [SKU_ID] is the unique identifier for the SKU.
  • [SKU_DESCRIPTION] is a human readable description of the SKU.
  • [SVC_DISPLAY_NAME] is the display name of the service to which the SKU belongs.
  • [FAMILY] is the type of product the SKU refers to. For example, "Compute", "Storage", "Network", etc.
  • [GROUP] is a group classification for related SKUs. For example, "RAM, "GPU", "Prediction", etc.
  • [USAGE] represents how the SKU is consumed. For example, "OnDemand, "Preemptible, "Commit1Mo", "Commit1Yr", etc.
  • [REGION] is the list of service regions in which the SKU is offered. For example, "asia-east1".
  • [TIME] is a timestamp representing the time from which this pricing was effective in the form 2014-10-02T15:01:23.045123456Z.
  • [SUMMARY] is a human readable summary of the pricing information,
  • [UNIT] is the short hand for the unit of usage in which the pricing is specified. For example, usageUnit of "GiBy" means that usage is specified in "Gibibytes".
  • [UNIT_DESCRIPTION] is the unit of usage in human readable form, for example, "Gibibyte".
  • [DISPLAY_QUANTITY] is the recommended quantity of units for displaying pricing info. When displaying pricing info, it is recommended to display: (unitPrice * displayQuantity) per displayQuantity usageUnit. This field does not affect the pricing formula and is for display purposes only. For example, if the unitPrice is "0.0001 USD", the usageUnit is "GB" and the displayQuantity is "1000", then the recommended way to display the pricing info is "0.10 USD per 1000 GB".
  • [START_AMOUNT] Usage is priced at the rate only after this amount is consumed. For example, a startUsageAmount of 10 indicates that the usage will be priced at the price defined below after the first 10 usage_units.
  • [CURRENCY_CODE] is the three-letter currency code defined as in ISO 4217.
  • [UNITS] is the whole units of the amount. For example if currencyCode is "USD", then 1 unit is one US dollar.
  • [NANOS] is the number of nano (10^-9) units of the amount. The value must be between -999,999,999 and +999,999,999 inclusive. If units is positive, nanos must be positive or zero. If units is zero, nanos can be positive, zero, or negative. If units is negative, nanos must be negative or zero. For example $-1.75 is represented as units=-1 and nanos=-750,000,000.
  • [AGGREGATION_LEVEL] is the level at which usage is aggregated to compute cost. Valid values are ACCOUNT, PROJECT, and AGGREGATION_LEVEL_UNSPECIFIED.
  • [AGGREGATION_INTERVAL] is the interval at which usage is aggregated to compute cost. Valid values are DAILY, MONTHY, and AGGREGATION_INTERVAL_UNSPECIFIED.
  • [AGGREGATION_COUNT] is the number of intervals to aggregate over. For example, if aggregationLevel is "DAILY" and aggregationCount is 14, aggregation will be over 14 days.
  • [CONVERSION_RATE] is the conversion rate for currency conversion, from USD to the currency specified in the request. If the currency is not specified this defaults to 1.0.
  • [SERVICE_PROVIDER] identifies the service provider. This is 'Google' for first party services in Google Cloud Platform.
Was this page helpful? Let us know how we did: