Google Price Calculator API GCP

0 votes

I want to create a straightforward invoicing application for cloud resources using the Google Price Calculator.

 https://cloud.google.com/products/calculator/

Does Google offer any APIs that can be used to communicate with the Google Price Calculator?

I looked, but I couldn't locate any!

Nov 10, 2022 in GCP by Tejashwini
• 3,820 points
1,121 views

1 answer to this question.

0 votes

The official documentation states that the Cloud Billing Catalog API is available for use:

Get a list of all available SKUs for a service, such as:

The SKU's human accessible description.

The SKU's retail price.

locations where the SKU can be purchased.

information on the SKU's categories.

a case in point

Request:

GET https://cloud.google.com/billing/v1/how-tos/catalog-api

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]",
    }
  ]
}

You should employ the following answer objects in response to your query:

The abbreviation [UNIT] stands for the unit of consumption for which the pricing is provided. Usage is stated in "Gibibytes," for instance, if usage unit of GiBy is used.
The suggested number of units for showing pricing information is [DISPLAY QUANTITY]. It is advised to display (unitPrice * displayQuantity) per display quantity usageUnit when displaying pricing information. This field is just used for display purposes and has no bearing on the price formula. For instance, if the usage unit is "GB," the unitPrice is "0.0001 USD," and the display quantity is "1000," the suggested way to display the pricing information is "0.10 USD per 1000 GB."

I hope this helps!

Join our GCP Certification online program and learn about google price calculator API in detail.

Thanks!

answered Nov 10, 2022 by Ashwini
• 5,430 points

Related Questions In GCP

0 votes
1 answer

Is there any API for GCP Pricing Calculator for https://cloud.google.com/compute/all-pricing?

You can take a look at the ...READ MORE

answered Mar 9, 2022 in GCP by Korak
• 5,820 points
2,198 views
0 votes
1 answer

(GCP) API keys. Your app contains exposed Google Cloud Platform (GCP) API keys

You must look under "Credentials" in the ...READ MORE

answered Nov 7, 2022 in GCP by Tejashwini
• 3,820 points

edited Sep 6, 2023 by Khan Sarfaraz 1,986 views
0 votes
0 answers
0 votes
1 answer

Does Google cloud platform (GCP) offer IaaS ? Or just PaaS?

GCP provides IaaS as well, although it ...READ MORE

answered Sep 20, 2019 in GCP by Sirajul
• 59,230 points
7,012 views
0 votes
2 answers
0 votes
1 answer
0 votes
1 answer

Changing Machine Instance on GCP

There is no direct method to change ...READ MORE

answered Aug 1, 2018 in GCP by kurt_cobain
• 9,350 points
644 views
0 votes
1 answer
0 votes
1 answer

GCP - how to add a Google account as an IAM principal to a project?

I post this community wiki answer to ...READ MORE

answered Nov 10, 2022 in GCP by Ashwini
• 5,430 points
1,177 views
0 votes
1 answer

sending and receiving emails with GCP

If you're still considering using Mailgun on ...READ MORE

answered Nov 8, 2022 in GCP by Ashwini
• 5,430 points
1,728 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP