Demystifying AWS Pricing APIs & its Cryptic Codes

Story of Bob:

Bob is a senior IT in charge of a mid-sized manufacturing company, having its operations in 10 countries, and factories in 2 countries.

The company decided two years back to migrate 80% of its IT infrastructure to AWS. As Bob led this activity, he was the go-to-guy for the finance dept., for verifying the bills.

For few months, Bob managed the verification of bills and budget planning, by going through AWS website and scrubbing pricing data, through his own eyes and mind.

But, Bob was a certified smart guy. So, he decided to automate it.

How? Let’s hear from Bob.

——–

Me: Hey Bob, How you doing?

Bob: (smiles, coz he got who I sounded like) cool man, thanks.

Me: Bob, you used the AWS pricing APIs. What compelled you to do so?

Bob: The time taken to go through the AWS site, for pricing details.

We use 100s of EC2s of different flavours, of different sizes, TBs of different types of storages, databases, etc. And that’s just a small part of huge offerings by AWS.

Manually going through the prices, noting it at a particular date, keep looking for changes was too much. So, decided to do something about it.

By integrating the AWS APIs, now we have a dashboard tailored to our needs, and is always up-to-date. We have also created our own customized calculator for our users. It integrates the AWS prices and that from local vendors.

This has helped in streamlining our consumption and price is now more predictable.

Me: This makes sense for somebody like you, who deals with these many AWS components day-in-day-out, and is accountable for the expense.

Bob: Yes that true.

Me: I went through the API documentation of AWS Pricing. Let me summarize what I have understood, and ask you my doubts.

Bob: Sure

Me: First, the basics:

  1. The API access is through https.
  2. AWS provides the pricing information as json or csv.
  3. The APIs are publicly accessible, without AWS account.
  4. The base address for accessing json/csv is https://pricing.us-east-1.amazonaws.com/
  5. us-east-1 in above url is where all information is available and is not limited only to this zone.

To access the data, I followed these steps

Step1: Got the list of offerings from AWS by downloading

It has details of all AWS products and information of where to get its prices from.

For eg.

"AmazonEC2":
{
 
"offerCode" : "AmazonEC2",
 
"versionIndexUrl" : "/offers/v1.0/aws/AmazonEC2/index.json",
 
"currentVersionUrl": "/offers/v1.0/aws/AmazonEC2/current/index.json",
 
"currentRegionIndexUrl": "/offers/v1.0/aws/AmazonEC2/current/region_index.json"
 
},

(Note: A product, like AmazonEC2, is referred as ‘Offer’)

Step2: From the above set, accessed the ‘currentRegionIndexUrl’ url –

https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonEC2/current/region_index.json

It gave details of prices in each region.

For eg.

"ap-south-1" :
 
{
 
"regionCode" : "ap-south-1",
 
"currentVersionUrl":"/offers/v1.0/aws/AmazonEC2/20180628005902/ap-south-1/index.json"
 
},

Step3: Accessed region specific file through above information. The resulting url was https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonEC2/20180628005902/ap-south-1/index.json

Now, the things are getting murkier. It’s a sea of confusing data.

There are some cryptic codes involved, and I couldn’t find any AWS document explaining these codes. Also, some sections show price as 0.0 dollars. How’s that possible?

Bob: The summary till now is correct. You have reached the source of data, but you are struggling to extract information out of it. To do that, you have to understand the offerings, and find patterns.

For example, you are accessing EC2 pricing. Now, EC2 pricing has variations like on-demand, dedicated hosts, reserved hosts. Then again, variations like full/no/partial upfront payment, etc.

Such variations are captured through those alien-looking codes.

Let’s take an example:

We want to check the price of Linux m5.large with SQL Enterprise preinstalled.

Through parsing, you get the code of this variant – ZV5VAXGR4YZS96VY

Search with this code and you will get multiple blocks in the file.

Each block represents a unique variant of the same product – the varying factors are mentioned above, like payment terms, dedicated hosts, etc

Each block will have a unique identifier, ‘Offertermcode’. For eg., ‘JRTCKXETXF’ represents on-demand pricing, payable per hr.

Another example, ‘HU7G6KETJZ’ represents reserved pricing with partial upfront fees. So the billing will include some amount to be paid upfront and some per month. ‘2TG2D8R56U’ is for upfront & ‘6YS6EN2CT7’ is for per/hr.

That’s it.

To summarize, there are three level of depths.

  1. Unique code of EC2 – say ZV5VAXGR4YZS96VY
  2. Unique offertermcode of above variant –

On-demand, fully-upfront-paid, no-upfront-paid, etc –~13 unique offertermcode

  1. Upfront and/or Per-hr payment terms

Me: Thanks Bob. It’s clear and demystified now.

I really want to be like you.

—-

AWS Price API documentation can be accessed here.

We, at Calsoft, have done AWS & Azure Price API integration, as well as other API integrations of varied scale and flavours, for and with, numerous vendors. Get in touch to know more.

 

 
Share:

Related Posts

Gen AI Trends 2025

Top Generative AI Trends Shaping 2025

Modernization of industries began with the Industrial Revolution in the early 19th Century with the use of machines, and it has continued with the digitization of devices…

Share:
IoT and its Applications in Driving Smart Manufacturing

IoT and its Applications in Driving Smart Manufacturing

The Internet of Things (IoT) is a key element of global industrial transformation, and the manufacturing sector leads in leveraging this technology. The millions of IoT devices,…

Share:
Product Lifecycle Management in Software Development using Large Language Models

Product Lifecycle Management in Software Development using Large Language Models

The data of any organization is of extreme value. But what happens when that data is not trustworthy and accessible to your teams? You will face challenges…

Share:
Understanding the Differences Between Public, Private, and Hybrid Cloud Solutions

Understanding the Differences Between Public, Private, and Hybrid Cloud Solutions

Discover the key distinctions between public, private, and hybrid cloud solutions to help choose the right model for your business needs.

Share:
Virtual Machines or Containers Which is Better in NFV Infrastructure

Virtual Machines or Containers. Which is Better in NFV Infrastructure?

Discover whether Virtual Machines or Containers are better for NFV infrastructure. Explore their benefits, challenges, and impact on 5G networks.

Share:
How Server Virtualization Works

How Server Virtualization Works

Discover how server virtualization optimizes hardware utilisation by creating multiple virtual servers on a single physical machine, enhancing efficiency and flexibility in IT environments.

Share: